Class SignalBus
Provides a unified way to send and receive events.
Implements
Namespace: Unity.DigitalTwins.Live.Sdk.Implementations
Assembly: solution.dll
Syntax
public class SignalBus : ISignalBus
Constructors
SignalBus()
Creates an instance of SignalBus.
Declaration
public SignalBus()
Methods
Fire<T>(T)
Fires an event of type
T
.Declaration
public void Fire<T>(T signal)
Parameters
Type | Name | Description |
---|---|---|
T | signal |
|
Type Parameters
Name | Description |
---|---|
T | The class defining the contents of the event. |
Subscribe<T>(Action)
Subscribes to an event of type
T
.Declaration
public void Subscribe<T>(Action signalAction)
where T : class
Parameters
Type | Name | Description |
---|---|---|
Action | signalAction | The method to receive the event. |
Type Parameters
Name | Description |
---|---|
T | The class defining contents of the event. |
Subscribe<T>(Action<T>)
Subscribes to an event of type
T
.Declaration
public void Subscribe<T>(Action<T> signalAction)
where T : class
Parameters
Type | Name | Description |
---|---|---|
Action<T> | signalAction | The method to receive the event, accepting a parameter of type T . |
Type Parameters
Name | Description |
---|---|
T | The class defining contents of the event. |
Unsubscribe<T>(Action)
Unsubscribes from an event of type
T
.Declaration
public void Unsubscribe<T>(Action signalAction)
where T : class
Parameters
Type | Name | Description |
---|---|---|
Action | signalAction | The method to unsubscribe from the event. |
Type Parameters
Name | Description |
---|---|
T | The class defining contents of the event. |
Unsubscribe<T>(Action<T>)
Unsubscribes from an event of type
T
.Declaration
public void Unsubscribe<T>(Action<T> signalAction)
where T : class
Parameters
Type | Name | Description |
---|---|---|
Action<T> | signalAction | The method to receive the event, accepting a parameter of type T . |
Type Parameters
Name | Description |
---|---|
T | The class defining contents of the event. |