Skip to content

Commit b6c160d

Browse files
Change the language id from c# to csharp in md code snippets
1 parent 0f947ad commit b6c160d

File tree

11 files changed

+33
-33
lines changed

11 files changed

+33
-33
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ libuiohook also provides functions to get various system properties. The corresp
123123
SharpHook provides the `IGlobalHook` interface along with three default implementations which you can use to control the
124124
hook and subscribe to its events. Here's a basic usage example:
125125

126-
```c#
126+
```csharp
127127
using SharpHook;
128128

129129
// ...
@@ -211,7 +211,7 @@ SharpHook with Rx.NET.
211211
SharpHook.Reactive provides the `SharpHook.Reactive.IReactiveGlobalHook` interface along with a default implementation
212212
which you can use to use to control the hook and subscribe to its observables. Here's a basic example:
213213

214-
```c#
214+
```csharp
215215
using SharpHook.Reactive;
216216

217217
// ...
@@ -263,7 +263,7 @@ R3.
263263
SharpHook.R3 provides the `SharpHook.R3.IR3GlobalHook` interface along with a default implementation which you can use
264264
to use to control the hook and subscribe to its observables. Here's a basic example:
265265

266-
```c#
266+
```csharp
267267
using SharpHook.R3;
268268

269269
// ...
@@ -312,7 +312,7 @@ provider can be specified for all observables.
312312
SharpHook provides the ability to simulate keyboard and mouse events in a cross-platform way as well. Here's a quick
313313
example:
314314

315-
```c#
315+
```csharp
316316
using SharpHook;
317317
using SharpHook.Native;
318318

@@ -367,7 +367,7 @@ surrogate pairs, e.g., emojis) is supported.
367367
libuiohook can log messages throughout its execution. By default the messages are not logged anywhere, but you can get
368368
these logs by using the `ILogSource` interface and its default implementation, `LogSource`:
369369

370-
```c#
370+
```csharp
371371
using SharpHook.Logging;
372372

373373
// ...
@@ -388,7 +388,7 @@ of `LogSource` in release builds.
388388
SharpHook.Reactive contains the `IReactiveLogSource` and `ReactiveLogSourceAdapter` so you can use them in a more
389389
reactive way:
390390

391-
```C#
391+
```csharp
392392
using SharpHook.Logging;
393393
using SharpHook.Reactive.Logging;
394394

@@ -401,7 +401,7 @@ reactiveLogSource.MessageLogged.Subscribe(this.OnMessageLogged);
401401

402402
SharpHook.R3 contains the `IR3LogSource` and `R3LogSourceAdapter` so you can use them in a more reactive way as well:
403403

404-
```C#
404+
```csharp
405405
using SharpHook.Logging;
406406
using SharpHook.R3.Logging;
407407

SharpHook.R3/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Refer to the [SharpHook](https://www.nuget.org/packages/SharpHook) package for t
1818
SharpHook.R3 provides the `IR3GlobalHook` interface along with a default implementation and an adapter which you can use
1919
to use to control the global hook and subscribe to its observables. Here's a basic example:
2020

21-
```c#
21+
```csharp
2222
using SharpHook.R3;
2323

2424
// ...
@@ -66,7 +66,7 @@ provider can be specified for all observables.
6666

6767
SharpHook.R3 contains `IR3LogSource` and `R3LogSourceAdapter` so you can use them in a more reactive way:
6868

69-
```c#
69+
```csharp
7070
using SharpHook.Logging;
7171
using SharpHook.R3.Logging;
7272

SharpHook.Reactive/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Refer to the [SharpHook](https://www.nuget.org/packages/SharpHook) package for t
1818
SharpHook.Reactive provides the `IReactiveGlobalHook` interface along with a default implementation and an adapter
1919
which you can use to use to control the global hook and subscribe to its observables. Here's a basic example:
2020

21-
```c#
21+
```csharp
2222
using SharpHook.Reactive;
2323

2424
// ...
@@ -67,7 +67,7 @@ to `IGlobalHook`. A default scheduler can be specified for all observables.
6767
SharpHook.Reactive contains `IReactiveLogSource` and `ReactiveLogSourceAdapter` so you can use them in a more reactive
6868
way:
6969

70-
```c#
70+
```csharp
7171
using SharpHook.Logging;
7272
using SharpHook.Reactive.Logging;
7373

SharpHook/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ libuiohook also provides functions to get various system properties. The corresp
4646
SharpHook provides the `IGlobalHook` interface along with three default implementations which you can use to control the
4747
hook and subscribe to its events. Here's a basic usage example:
4848

49-
```c#
49+
```csharp
5050
using SharpHook;
5151

5252
// ...
@@ -133,7 +133,7 @@ Use the [SharpHook.R3](https://www.nuget.org/packages/SharpHook.R3) package for
133133
SharpHook provides the ability to simulate keyboard and mouse events in a cross-platform way as well. Here's a quick
134134
example:
135135

136-
```c#
136+
```csharp
137137
using SharpHook;
138138
using SharpHook.Data;
139139

@@ -188,7 +188,7 @@ surrogate pairs, e.g., emojis) is supported.
188188
libuiohook can log messages throughout its execution. By default the messages are not logged anywhere, but you can get
189189
these logs by using the `ILogSource` interface and its default implementation, `LogSource`:
190190

191-
```c#
191+
```csharp
192192
using SharpHook.Logging;
193193

194194
// ...

docs/articles/custom.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ subscribers).
1111

1212
As an example, here's the implementation of `SimpleGlobalHook` (with XML comments removed):
1313

14-
```c#
14+
```csharp
1515
namespace SharpHook;
1616

1717
public sealed class SimpleGlobalHook : GlobalHookBase
@@ -59,7 +59,7 @@ itself extends: `HandleHookEvent`, `BeforeRun`, `AfterStop`, and `Dispose`.
5959
As an example, here's a global hook which raises a single event for all hook events instead of different events for each
6060
event type:
6161

62-
```c#
62+
```csharp
6363
public sealed class StraightforwardGlobalHook : BasicGlobalHookBase
6464
{
6565
protected override void HandleHookEvent(ref UioHookEvent e) =>
@@ -78,21 +78,21 @@ hook, but you may nonetheless want to implement everything from scratch. You can
7878
When calling `SetDispatchProc`, the function must be wrapped into a delegate reference and the reference must be stored
7979
to prevent garbage collection. This is because the following code:
8080

81-
```c#
81+
```csharp
8282
provider.SetDispatchProc(someObj.SomeMethod, IntPtr.Zero);
8383
```
8484

8585
is actually transformed into this code by the C# compiler:
8686

87-
```c#
87+
```csharp
8888
provider.SetDispatchProc(new DispatchProc(someObj.SomeMethod), IntPtr.Zero);
8989
```
9090

9191
The CLR protects the `DispatchProc` reference from being garbage-collected only until the `SetDispatchProc` methods
9292
exits (which happens almost instantly). The CLR does not and cannot know that the reference will be used later and so it
9393
will happily collect this reference thinking it's not needed anymore. Instead, the following should be done:
9494

95-
```c#
95+
```csharp
9696
DispatchProc dispatchProc = someObj.SomeMethod; // This reference should be stored, e.g., as a field of the object
9797
provider.SetDispatchProc(dispatchProc, IntPtr.Zero);
9898
```

docs/articles/hooks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ SharpHook provides the `SharpHook.IGlobalHook` interface along with three defaul
66
control the hook and subscribe to its events. This way is preferred to using native functions since it's more
77
convenient. Here's a basic usage example:
88

9-
```c#
9+
```csharp
1010
using SharpHook;
1111

1212
// ...

docs/articles/logging.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ to use the debug level for long periods of time since a debug message is logged
2424

2525
Here's a usage example:
2626

27-
```c#
27+
```csharp
2828
using SharpHook.Data;
2929
using SharpHook.Logging;
3030

@@ -50,7 +50,7 @@ message format and arguments so you don't have to do it yourself.
5050
SharpHook.Reactive contains the `IReactiveLogSource` and its implementation – `ReactiveLogSourceAdapter`. Here's a
5151
usage example:
5252

53-
```c#
53+
```csharp
5454
using SharpHook.Logging;
5555
using SharpHook.Native;
5656
using SharpHook.Reactive.Logging;
@@ -68,7 +68,7 @@ scheduler can be set for the `MessageLogged` observable.
6868

6969
SharpHook.R3 contains the `IR3LogSource` and its implementation – `R3LogSourceAdapter`. Here's a usage example:
7070

71-
```c#
71+
```csharp
7272
using SharpHook.Logging;
7373
using SharpHook.Native;
7474
using SharpHook.R3.Logging;
@@ -97,21 +97,21 @@ usually shouldn't use it.
9797
When calling `SetLoggerProc`, the function must be wrapped into a delegate reference and the reference must be stored
9898
to prevent garbage collection. This is because the following code:
9999

100-
```c#
100+
```csharp
101101
provider.SetLoggerProc(someObj.SomeMethod, IntPtr.Zero);
102102
```
103103

104104
is actually transformed into this code by the C# compiler:
105105

106-
```c#
106+
```csharp
107107
provider.SetLoggerProc(new LoggerProc(someObj.SomeMethod), IntPtr.Zero);
108108
```
109109

110110
The CLR protects the `LoggerProc` reference from being garbage-collected only until the `SetLoggerProc` methods exits
111111
(which happens almost instantly). The CLR does not and cannot know that the reference will be used later and so it will
112112
happily collect this reference thinking it's not needed anymore. Instead, the following should be done:
113113

114-
```c#
114+
```csharp
115115
LoggerProc loggerProc = someObj.SomeMethod; // This reference should be stored, e.g., as a field of the object
116116
provider.SetLoggerProc(loggerProc, IntPtr.Zero);
117117
```
@@ -134,7 +134,7 @@ arguments. It then parses the log message and the log format and extracts the ar
134134

135135
If you want to use your own callback, then its form should be the following:
136136

137-
```c#
137+
```csharp
138138
private void OnLog(LogLevel level, IntPtr userData, IntPtr format, IntPtr args)
139139
{
140140
// Filter by log level if needed

docs/articles/os-constraints.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ other than the main one then you should take care of it yourself. You can do tha
7878
`CFRunLoopRun` function on the main thread:
7979

8080

81-
```c#
81+
```csharp
8282
internal static partial class CoreFoundation
8383
{
8484
private const string CoreFoundationLib = "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation";

docs/articles/reactive.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ SharpHook with Rx.NET.
88
SharpHook.Reactive provides the `SharpHook.Reactive.IReactiveGlobalHook` interface along with a default implementation
99
which you can use to use to control the hook and subscribe to its observables. Here's a basic example:
1010

11-
```c#
11+
```csharp
1212
using SharpHook.Reactive;
1313

1414
// ...
@@ -79,7 +79,7 @@ R3.
7979
SharpHook.R3 provides the `SharpHook.R3.IR3GlobalHook` interface along with a default implementation which you can use
8080
to use to control the hook and subscribe to its observables. Here's a basic example:
8181

82-
```c#
82+
```csharp
8383
using SharpHook.R3;
8484

8585
// ...

docs/articles/simulation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ property.
1212

1313
Input event simulation is quite straightforward. Here's a quick example:
1414

15-
```c#
15+
```csharp
1616
using SharpHook;
1717
using SharpHook.Data;
1818

0 commit comments

Comments
 (0)