ServiceCollection Class
The service collection implements IServiceProvider and provides access to services offered by the editing context.
Inheritance Hierarchy
System..::..Object
Microsoft.Data.Tools.Design.Core.Context..::..ServiceCollection
Namespace: Microsoft.Data.Tools.Design.Core.Context
Assembly: Microsoft.Data.Tools.Design.Core (in Microsoft.Data.Tools.Design.Core.dll)
Syntax
'Declaration
Public MustInherit Class ServiceCollection _
Implements IServiceProvider, IEnumerable(Of Type), _
IEnumerable
'Usage
Dim instance As ServiceCollection
public abstract class ServiceCollection : IServiceProvider,
IEnumerable<Type>, IEnumerable
public ref class ServiceCollection abstract : IServiceProvider,
IEnumerable<Type^>, IEnumerable
[<AbstractClassAttribute>]
type ServiceCollection =
class
interface IServiceProvider
interface IEnumerable<Type>
interface IEnumerable
end
public abstract class ServiceCollection implements IServiceProvider, IEnumerable<Type>, IEnumerable
The ServiceCollection type exposes the following members.
Constructors
Name | Description | |
---|---|---|
ServiceCollection | Creates a new ServiceCollection. |
Top
Methods
Name | Description | |
---|---|---|
Contains(Type) | Returns true if the service collection contains a service of the given type. | |
Contains< (Of < <' (TServiceType> ) > > )() () () () | Returns true if the service collection contains a service of the given type. | |
Equals | (Inherited from Object.) | |
Finalize | (Inherited from Object.) | |
GetEnumerator | Retrives an enumerator that can be used to enumerate all of the services that this service collection publishes. | |
GetHashCode | (Inherited from Object.) | |
GetRequiredService< (Of < <' (TServiceType> ) > > ) | Retrives the requested service. Unlike GetService, GetRequiredService throws a NotSupportedException if the service isn?t available. The reason we provide this method, and not a normal GetService method is our wish to move services to a more reliable contract. | |
GetService(Type) | Retrives the requested service. This method returns null if the service could not be located. | |
GetService< (Of < <' (TServiceType> ) > > )() () () () | Retrives the requested service. This method returns null if the service could not be located. | |
GetTarget | This is 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 | (Inherited from Object.) | |
MemberwiseClone | (Inherited from Object.) | |
Publish(Type, PublishServiceCallback) | Publishes the given service type, but does not declare an instance yet. When someone requests the service the PublishServiceCallback will be invoked to create the instance. The callback is only invoked once and after that the instance it returned is cached. A generic version of this method is provided for convenience, and calls the non-generic method with appropriate casts. | |
Publish(Type, Object) | Publishes the given service. Once published, the service instance remains in the service collection until the editing context is disposed. | |
Publish< (Of < <' (TServiceType> ) > > )(TServiceType) | Publishes the given service. Once published, the service instance remains in the service collection until the editing context is disposed. | |
Publish< (Of < <' (TServiceType> ) > > )(PublishServiceCallback< (Of < <' (TServiceType> ) > > )) | Publishes the given service type, but does not declare an instance yet. When someone requests the service the PublishServiceCallback will be invoked to create the instance. The callback is only invoked once and after that the instance it returned is cached. | |
RemoveCallback | This is a helper method that performs a Delegate.Remove, but knows how to unwrap delegates that are proxies to generic callbacks. Use this in your Unsubscribe implementations. | |
Subscribe(Type, SubscribeServiceCallback) | 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. | |
Subscribe< (Of < <' (TServiceType> ) > > )(SubscribeServiceCallback< (Of < <' (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. | |
ToString | (Inherited from Object.) | |
Unsubscribe(Type, SubscribeServiceCallback) | Removes a subscription for the serviceType. | |
Unsubscribe< (Of < <' (TServiceType> ) > > )(SubscribeServiceCallback< (Of < <' (TServiceType> ) > > )) | Removes a subscription for the ServiceType. |
Top
Explicit Interface Implementations
Name | Description | |
---|---|---|
IEnumerable..::..GetEnumerator | Implementation of default IEnumerable. |
Top
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.