ServiceManager Class
Represents the behavior associated with an EditingContext.
Inheritance Hierarchy
System.Object
Microsoft.Windows.Design.ServiceManager
Namespace: Microsoft.Windows.Design
Assembly: Microsoft.Windows.Design.Extensibility (in Microsoft.Windows.Design.Extensibility.dll)
Syntax
'Declaration
Public MustInherit Class ServiceManager _
Implements IServiceProvider, IEnumerable(Of Type), _
IEnumerable
public abstract class ServiceManager : IServiceProvider,
IEnumerable<Type>, IEnumerable
public ref class ServiceManager abstract : IServiceProvider,
IEnumerable<Type^>, IEnumerable
[<AbstractClass>]
type ServiceManager =
class
interface IServiceProvider
interface IEnumerable<Type>
interface IEnumerable
end
public abstract class ServiceManager implements IServiceProvider, IEnumerable<Type>, IEnumerable
The ServiceManager type exposes the following members.
Constructors
Name | Description | |
---|---|---|
ServiceManager | Initializes a new instance of the ServiceManager class. |
Top
Methods
Name | Description | |
---|---|---|
Contains(Type) | When overridden in a derived class, determines whether the ServiceManager contains a service of the specified type. | |
Contains<TServiceType>() | Determines if the ServiceManager contains a service of the specified type. | |
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetEnumerator | When overridden in a derived class, retrieves an enumerator of the published services of this ServiceManager. | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetRequiredService<TServiceType> | Retrieves an instance of a service of the specified type. | |
GetService(Type) | When overridden in a derived class, retrieves an instance of a service of the specified type. | |
GetService<TServiceType>() | Retrieves an instance of a service of the specified generic type. | |
GetTarget | A helper method that gets the target object for a delegate. | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Publish(Type, PublishServiceCallback) | When overridden in a derived class, publishes a service of the specified type, represented by the specified method. | |
Publish(Type, Object) | When overridden in a derived class, publishes the specified service instance of the specified type. | |
Publish<TServiceType>(TServiceType) | Publishes the specified service instance of the specified type. | |
Publish<TServiceType>(PublishServiceCallback<TServiceType>) | Publishes a service of the specified type, represented by the specified method. | |
RemoveCallback | Removes a callback method from a delegate. | |
Subscribe(Type, SubscribeServiceCallback) | When overridden in a derived class, requests that the specified method is called when a service of the specified type is available. | |
Subscribe<TServiceType>(SubscribeServiceCallback<TServiceType>) | Requests that the specified method is called when a service of the specified type is available. | |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
Unsubscribe(Type, SubscribeServiceCallback) | When overridden in a derived class, requests that the specified method is no longer called when a service of the specified type is available. | |
Unsubscribe<TServiceType>(SubscribeServiceCallback<TServiceType>) | Requests that the specified method is no longer called when a service of the specified type is available. |
Top
Explicit Interface Implementations
Name | Description | |
---|---|---|
IEnumerable.GetEnumerator | Infrastructure. For a description of this member, see GetEnumerator. |
Top
Remarks
The EditingContext class provides access to two pieces of state:
Data (ContextItem)
Behavior Services (ServiceManager)
Behavior services are accessed through the Services property which returns an instance of a ServiceManager.
ServiceManager is an abstract class. You can provide your own implementation by deriving from EditingContext and overriding CreateServiceManager.
Once a service is created in an EditingContext it is always present. A service cannot be removed from the EditingContext.
Services have consistent instance values, so it is always acceptable to cache them.
Code can use the ServiceManager to publish new services, and subscribe to a callback when a particular service is available.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also
Reference
Microsoft.Windows.Design Namespace