EmitterSharp 1.1.1.1
.NET Core 2.0
This package targets .NET Core 2.0. The package is compatible with this framework or higher.
.NET Standard 2.0
This package targets .NET Standard 2.0. The package is compatible with this framework or higher.
.NET Framework 4.0
This package targets .NET Framework 4.0. The package is compatible with this framework or higher.
Requires NuGet 2.12 or higher.
dotnet add package EmitterSharp --version 1.1.1.1
NuGet\Install-Package EmitterSharp -Version 1.1.1.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EmitterSharp" Version="1.1.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EmitterSharp --version 1.1.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EmitterSharp, 1.1.1.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install EmitterSharp as a Cake Addin #addin nuget:?package=EmitterSharp&version=1.1.1.1 // Install EmitterSharp as a Cake Tool #tool nuget:?package=EmitterSharp&version=1.1.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
EmitterSharp
C# implementation of Emitter in JavaScript module.
Installation
Command
Install-Package EmitterSharp
in nuget package manager console.
Usage
Namespace
using EmitterSharp;
Inheritance
class ExampleEmitter : Emitter<ExampleEmitter, string, object>
{
...
}
Emitter<TChildClass, TEvent, TArgument>
public abstract class Emitter<TChildClass, TEvent, TArgument>
- The first generic type is a type of class that inherits Emitter. This is used for chaining.
- The second generic type is a type of event.
- The third generic type is a type of argument in callback.
Listener
void ExampleCallback()
{
Console.WriteLine("This is callback.");
}
void ExampleCallbackWithArgument(object value)
{
if (value != null)
{
Console.WriteLine("This is callback : " + value);
}
else
{
Console.WriteLine("This is callback... Wait, what?");
}
}
ExampleEmitter emitter = new ExampleEmitter();
emitter.On("custom event", () => Console.WriteLine("Hello world!")); // Callback can be lambda without argument.
emitter.On("custom event", (value) => // Callback can be lambda with argument.
{
if (value != null)
{
Console.WriteLine(value);
}
else
{
Console.WriteLine("Excuse me?");
}
});
emitter.On("custom event", ExampleCallback); // Callback can be method without argument.
emitter.On("custom event", ExampleCallbackWithArgument); // Callback can be method with argument.
emitter.Emit("custom event"); // Emit without argument.
// Console will print "Hello world!", "Excuse me?", "This is callback." and "This is callback... Wait, what?"
emitter.Emit("custom event", 30); // Emit with argument.
// Console will print "Hello world!", 30, "This is callback." and "This is callback : 30"
Emit without argument
- When
Emitter.Emit
is called only with event, default value of argument is always0
. - If
TArgument
isbool
, default value of argument isfalse
since it's defined as0
. - If
TArgument
isstring
, default value of argument isnull
since it's a reference to address0
. - If
TArgument
isIntPtr
, default value of argument isIntPtr.Zero
that is defined asnull
reference.
Maintenance
Welcome to report issue or create pull request. I will check it happily.
Dependencies
License
EmitterSharp
is under The MIT License.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 is compatible. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 is compatible. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net40 is compatible. net403 was computed. net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETCoreApp 2.0
- SimpleThreadMonitor (>= 1.0.2.1)
-
.NETCoreApp 3.0
- SimpleThreadMonitor (>= 1.0.2.1)
-
.NETFramework 4.0
- SimpleThreadMonitor (>= 1.0.2.1)
-
.NETFramework 4.5
- SimpleThreadMonitor (>= 1.0.2.1)
-
.NETStandard 2.0
- SimpleThreadMonitor (>= 1.0.2.1)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on EmitterSharp:
Package | Downloads |
---|---|
EngineIOSharp
C# implementation of Engine.IO protocol revision 3 client and server. |
|
EngineIOSharp2
add socket connection pre-processing(by https://www.nuget.org/packages/EngineIOSharp/2.0.0.1) |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on EmitterSharp:
Repository | Stars |
---|---|
uhm0311/SocketIOSharp
C# implementation of Socket.IO protocol revision 4 client and server.
|
Version | Downloads | Last updated |
---|---|---|
1.1.1.1 | 38,998 | 5/11/2020 |
Add .Net core 2.0, 3.0 support.