ServiceManager ServiceManager ServiceManager ServiceManager Class

Definition

Implements IServiceProvider and provides access to services offered by the editing context.

public ref class ServiceManager abstract : IServiceProvider, System::Collections::Generic::IEnumerable<Type ^>
public abstract class ServiceManager : IServiceProvider, System.Collections.Generic.IEnumerable<Type>
type ServiceManager = class
    interface IServiceProvider
    interface seq<Type>
    interface IEnumerable
Public MustInherit Class ServiceManager
Implements IEnumerable(Of Type), IServiceProvider
Inheritance
ServiceManagerServiceManagerServiceManagerServiceManager
Implements

Remarks

Services represent functionality that is either provided by the host for the designer to use or that is used by the designer to make functionality available to all designers within the editor. It is obtained from the EditingContext by the Services property.

Constructors

ServiceManager() ServiceManager() ServiceManager() ServiceManager()

Initializes a new instance of the ServiceManager class.

Methods

Contains(Type) Contains(Type) Contains(Type) Contains(Type)

Returns a Boolean value that indicates whether the service manager contains a service of the given type.

Contains<TServiceType>() Contains<TServiceType>() Contains<TServiceType>() Contains<TServiceType>()

Returns a Boolean value that indicates whether the service manager contains a service of the given type.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

Retrieves an enumerator that can be used to enumerate all of the services that this service manager publishes.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetRequiredService<TServiceType>() GetRequiredService<TServiceType>() GetRequiredService<TServiceType>() GetRequiredService<TServiceType>()

Retrieves the requested service.

GetService(Type) GetService(Type) GetService(Type) GetService(Type)

Retrieves the requested service. This method returns null if the service could not be located.

GetService<TServiceType>() GetService<TServiceType>() GetService<TServiceType>() GetService<TServiceType>()

Retrieves the requested service. This method returns null if the service could not be located.

GetTarget(Delegate) GetTarget(Delegate) GetTarget(Delegate) GetTarget(Delegate)

A helper method that returns the target object for a delegate. If the delegate was created to proxy a generic delegate, this will correctly return the original object, not the proxy.

GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
Publish(Type, Object) Publish(Type, Object) Publish(Type, Object) Publish(Type, Object)

Publishes the given service. After it is published, the service instance remains in the service manager until the editing context is disposed of.

Publish(Type, PublishServiceCallback) Publish(Type, PublishServiceCallback) Publish(Type, PublishServiceCallback) Publish(Type, PublishServiceCallback)

Publishes the specified service type, but does not declare an instance. When the service is requested, the Publish service callback will be invoked to create the instance. The callback is invoked only once. After that, the instance it returned is cached.

Publish<TServiceType>(PublishServiceCallback<TServiceType>) Publish<TServiceType>(PublishServiceCallback<TServiceType>) Publish<TServiceType>(PublishServiceCallback<TServiceType>) Publish<TServiceType>(PublishServiceCallback<TServiceType>)

Publishes the given service type, but does not declare an instance yet. When the service is requested, the PublishServiceCallback will be invoked to create the instance. The callback is invoked only once. After that, the instance it returned is cached.

Publish<TServiceType>(TServiceType) Publish<TServiceType>(TServiceType) Publish<TServiceType>(TServiceType) Publish<TServiceType>(TServiceType)

Publishes the given service. After it is published, the service instance remains in the service manager until the editing context is disposed of.

RemoveCallback(Delegate, Delegate) RemoveCallback(Delegate, Delegate) RemoveCallback(Delegate, Delegate) RemoveCallback(Delegate, Delegate)

A helper method that performs a Delegate.Remove operation, and unwraps delegates that are proxies to generic callbacks. You should use this method in your Unsubscribe implementations.

Subscribe(Type, SubscribeServiceCallback) Subscribe(Type, SubscribeServiceCallback) Subscribe(Type, SubscribeServiceCallback) Subscribe(Type, SubscribeServiceCallback)

Invokes the provided callback when someone has published the requested service. If the service was already available, this method invokes the callback immediately.

Subscribe<TServiceType>(SubscribeServiceCallback<TServiceType>) Subscribe<TServiceType>(SubscribeServiceCallback<TServiceType>) Subscribe<TServiceType>(SubscribeServiceCallback<TServiceType>) Subscribe<TServiceType>(SubscribeServiceCallback<TServiceType>)

Invokes the provided callback when someone has published the requested service. If the service was already available, this method invokes the callback immediately.

ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)
Unsubscribe(Type, SubscribeServiceCallback) Unsubscribe(Type, SubscribeServiceCallback) Unsubscribe(Type, SubscribeServiceCallback) Unsubscribe(Type, SubscribeServiceCallback)

Removes a subscription for a service type.

Unsubscribe<TServiceType>(SubscribeServiceCallback<TServiceType>) Unsubscribe<TServiceType>(SubscribeServiceCallback<TServiceType>) Unsubscribe<TServiceType>(SubscribeServiceCallback<TServiceType>) Unsubscribe<TServiceType>(SubscribeServiceCallback<TServiceType>)

Removes a subscription for a service type.

Explicit Interface Implementations

IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator()

Retrieves an enumerator that can be used to enumerate all of the services that this service manager publishes.

Extension Methods

CopyToDataTable<T>(IEnumerable<T>) CopyToDataTable<T>(IEnumerable<T>) CopyToDataTable<T>(IEnumerable<T>) CopyToDataTable<T>(IEnumerable<T>)

Returns a DataTable that contains copies of the DataRow objects, given an input IEnumerable<T> object where the generic parameter T is DataRow.

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption)

Copies DataRow objects to the specified DataTable, given an input IEnumerable<T> object where the generic parameter T is DataRow.

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler)

Copies DataRow objects to the specified DataTable, given an input IEnumerable<T> object where the generic parameter T is DataRow.

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

Converts an IEnumerable to an IQueryable.

Ancestors<T>(IEnumerable<T>) Ancestors<T>(IEnumerable<T>) Ancestors<T>(IEnumerable<T>) Ancestors<T>(IEnumerable<T>)

Returns a collection of elements that contains the ancestors of every node in the source collection.

Ancestors<T>(IEnumerable<T>, XName) Ancestors<T>(IEnumerable<T>, XName) Ancestors<T>(IEnumerable<T>, XName) Ancestors<T>(IEnumerable<T>, XName)

Returns a filtered collection of elements that contains the ancestors of every node in the source collection. Only elements that have a matching XName are included in the collection.

DescendantNodes<T>(IEnumerable<T>) DescendantNodes<T>(IEnumerable<T>) DescendantNodes<T>(IEnumerable<T>) DescendantNodes<T>(IEnumerable<T>)

Returns a collection of the descendant nodes of every document and element in the source collection.

Descendants<T>(IEnumerable<T>) Descendants<T>(IEnumerable<T>) Descendants<T>(IEnumerable<T>) Descendants<T>(IEnumerable<T>)

Returns a collection of elements that contains the descendant elements of every element and document in the source collection.

Descendants<T>(IEnumerable<T>, XName) Descendants<T>(IEnumerable<T>, XName) Descendants<T>(IEnumerable<T>, XName) Descendants<T>(IEnumerable<T>, XName)

Returns a filtered collection of elements that contains the descendant elements of every element and document in the source collection. Only elements that have a matching XName are included in the collection.

Elements<T>(IEnumerable<T>) Elements<T>(IEnumerable<T>) Elements<T>(IEnumerable<T>) Elements<T>(IEnumerable<T>)

Returns a collection of the child elements of every element and document in the source collection.

Elements<T>(IEnumerable<T>, XName) Elements<T>(IEnumerable<T>, XName) Elements<T>(IEnumerable<T>, XName) Elements<T>(IEnumerable<T>, XName)

Returns a filtered collection of the child elements of every element and document in the source collection. Only elements that have a matching XName are included in the collection.

InDocumentOrder<T>(IEnumerable<T>) InDocumentOrder<T>(IEnumerable<T>) InDocumentOrder<T>(IEnumerable<T>) InDocumentOrder<T>(IEnumerable<T>)

Returns a collection of nodes that contains all nodes in the source collection, sorted in document order.

Nodes<T>(IEnumerable<T>) Nodes<T>(IEnumerable<T>) Nodes<T>(IEnumerable<T>) Nodes<T>(IEnumerable<T>)

Returns a collection of the child nodes of every document and element in the source collection.

Remove<T>(IEnumerable<T>) Remove<T>(IEnumerable<T>) Remove<T>(IEnumerable<T>) Remove<T>(IEnumerable<T>)

Removes every node in the source collection from its parent node.

Applies to