Method TryConnectSubscriber
TryConnectSubscriber<TProvider>(TProvider, object)
Use pattern matching cast to try converting a given object to IFunctionalitySubscriber>TProvider< If the cast succeeds, set the object's provider property to this object Make sure to use the same generic argument that is used in IFunctionalitySubscriber, not an extension of that type
Declaration
public static void TryConnectSubscriber<TProvider>(this TProvider provider, object obj) where TProvider : IFunctionalityProvider
Parameters
Type | Name | Description |
---|---|---|
TProvider | provider | Provider to try to connect to the subscriber |
object | obj | An object which should be connected to the provider, if it implements the matching subscriber interface |
Type Parameters
Name | Description |
---|---|
TProvider | The provider type we are connecting |