Class TypedMessageCallback<T>
Event callback for received messages and events.
Namespace: TehGM.Wolfringo.Utilities.Internal
Assembly: Wolfringo.Core.dll
Syntax
public class TypedMessageCallback<T> : IMessageCallback, IEquatable<TypedMessageCallback<T>> where T : IWolfMessage
Type Parameters
| Name | Description |
|---|---|
| T |
Remarks
This interface is designed to allow invoking callback conditionally. If TryInvoke(IWolfMessage) returns false, it doesn't meant invoking failed - it means that callback determined it should not invoke for the provided message.
This callback will only invoke if message is of type T.
Constructors
| Improve this Doc View SourceTypedMessageCallback(Action<T>)
Creates callback instance.
Declaration
public TypedMessageCallback(Action<T> callback)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Action<T> | callback | Method to invoke when this callback invokes. |
Remarks
This interface is designed to allow invoking callback conditionally. If TryInvoke(IWolfMessage) returns false, it doesn't meant invoking failed - it means that callback determined it should not invoke for the provided message.
This callback will only invoke if message is of type T.
Properties
| Improve this Doc View SourceCallbackInfo
Method to invoke.
Declaration
public MethodInfo CallbackInfo { get; }
Property Value
| Type | Description |
|---|---|
| System.Reflection.MethodInfo |
Remarks
This interface is designed to allow invoking callback conditionally. If TryInvoke(IWolfMessage) returns false, it doesn't meant invoking failed - it means that callback determined it should not invoke for the provided message.
This callback will only invoke if message is of type T.
Methods
| Improve this Doc View SourceEquals(Object)
Event callback for received messages and events.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | obj |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Overrides
Remarks
This interface is designed to allow invoking callback conditionally. If TryInvoke(IWolfMessage) returns false, it doesn't meant invoking failed - it means that callback determined it should not invoke for the provided message.
This callback will only invoke if message is of type T.
Equals(TypedMessageCallback<T>)
Event callback for received messages and events.
Declaration
public bool Equals(TypedMessageCallback<T> other)
Parameters
| Type | Name | Description |
|---|---|---|
| TypedMessageCallback<T> | other |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Remarks
This interface is designed to allow invoking callback conditionally. If TryInvoke(IWolfMessage) returns false, it doesn't meant invoking failed - it means that callback determined it should not invoke for the provided message.
This callback will only invoke if message is of type T.
GetHashCode()
Event callback for received messages and events.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| System.Int32 |
Overrides
Remarks
This interface is designed to allow invoking callback conditionally. If TryInvoke(IWolfMessage) returns false, it doesn't meant invoking failed - it means that callback determined it should not invoke for the provided message.
This callback will only invoke if message is of type T.
TryInvoke(IWolfMessage)
Attempts to invoke the callback.
Declaration
public virtual bool TryInvoke(IWolfMessage message)
Parameters
| Type | Name | Description |
|---|---|---|
| IWolfMessage | message | Message to attempt invoking the callback for. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if callback was invoked; otherwise false. |
Remarks
Callback will only invoke if message is of type T.