Sdílet prostřednictvím


SingletonEventSource<TDerived> Class

Definition

Base class for singleton event sources. Classes deriving from SingletonEventSource should expose static events rather than instance events.

generic <typename TDerived>
 where TDerived : gcnew()public ref class SingletonEventSource abstract : Microsoft::VisualStudio::Shell::Events::EventSource
public abstract class SingletonEventSource<TDerived> : Microsoft.VisualStudio.Shell.Events.EventSource where TDerived : new()
type SingletonEventSource<'Derived (requires 'Derived : (new : unit -> 'Derived))> = class
    inherit EventSource
Public MustInherit Class SingletonEventSource(Of TDerived)
Inherits EventSource

Type Parameters

TDerived
Inheritance
SingletonEventSource<TDerived>
Derived

Constructors

SingletonEventSource<TDerived>()

Instantiates a new instance of SingletonEventSource.

Properties

Instance

The singleton instance of the event source. We have to create an instance to act as the event sink for VS, but since the derived class's events are exposed as statics, we don't need to expose the Instance property to users of the derived class.

IsAdvised

Indicates whether this EventSource is advised on its VS event source

(Inherited from EventSource)
IsInstanceCreated

Indicates whether the singleton instance of TDerived has been created yet.

Methods

AddHandler(Delegate, String)

Adds an event handler for the specified key

(Inherited from EventSource)
Advise()

Called when the first event sink is added to the event source. The derived class should advise the VS events it is wrapping at this point. This method will always be called on the UI thread.

(Inherited from EventSource)
GetHandler(String)

Returns the handler for the given key, or null if none exists.

(Inherited from EventSource)
HasHandler(String)

Indicates whether the event identified by the given key has at least one handler

(Inherited from EventSource)
RaiseEvent<TEventArgs>(Object, TEventArgs, String)

Raises the event identified by key. All event handlers are called, regardless of whether an individual handler throws an exception.

(Inherited from EventSource)
RemoveHandler(Delegate, String)

Removes an event handler for the specified key.

(Inherited from EventSource)
Unadvise()

Called when the last event sink is removed from the event source. The derived class should unadvise the VS events it is wrapping at this point. This method will always be called on the UI thread.

(Inherited from EventSource)

Applies to