ServiceManager.Publish<TServiceType> Method (PublishServiceCallback<TServiceType>)
Publishes a service of the specified type, represented by the specified method.
Namespace: Microsoft.Windows.Design
Assembly: Microsoft.Windows.Design.Extensibility (in Microsoft.Windows.Design.Extensibility.dll)
Syntax
'Declaration
Public Sub Publish(Of TServiceType) ( _
callback As PublishServiceCallback(Of TServiceType) _
)
public void Publish<TServiceType>(
PublishServiceCallback<TServiceType> callback
)
public:
generic<typename TServiceType>
void Publish(
PublishServiceCallback<TServiceType>^ callback
)
member Publish :
callback:PublishServiceCallback<'TServiceType> -> unit
JScript does not support generic types or methods.
Type Parameters
- TServiceType
Parameters
- callback
Type: Microsoft.Windows.Design.PublishServiceCallback<TServiceType>
The method to invoke when the service is requested.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | callback is nulla null reference (Nothing in Visual Basic). |
Remarks
This overload of Publish publishes the service type, but does not declare an instance of the service. When a request is made for the service, callback is invoked to create the instance. The callback is invoked only one time and the instance is cached.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
Microsoft.Windows.Design Namespace