Subscribe(TServiceType) Method (SubscribeServiceCallback(TServiceType))
Calls back on the provided callback when someone has published the requested service. If the service was already available, this method invokes the callback immediately. A generic version of this method is provided for convenience, and calls the non-generic method with appropriate casts.
Namespace: Microsoft.Data.Tools.Design.Core.Context
Assembly: Microsoft.Data.Tools.Design.Core (in Microsoft.Data.Tools.Design.Core.dll)
Syntax
'Declaration
Public Sub Subscribe(Of TServiceType) ( _
callback As SubscribeServiceCallback(Of TServiceType) _
)
'Usage
Dim instance As ServiceCollection
Dim callback As SubscribeServiceCallback(Of TServiceType)
instance.Subscribe(callback)
public void Subscribe<TServiceType>(
SubscribeServiceCallback<TServiceType> callback
)
public:
generic<typename TServiceType>
void Subscribe(
SubscribeServiceCallback<TServiceType>^ callback
)
member Subscribe :
callback:SubscribeServiceCallback<'TServiceType> -> unit
JScript does not support generic types and methods.
Type Parameters
- TServiceType
Parameters
- callback
Type: Microsoft.Data.Tools.Design.Core.Context..::..SubscribeServiceCallback< (Of < ( <'TServiceType> ) > ) >
A callback that will be invoked when the service is available.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | If callback is null. |