DataObjectChangeEvents Class
Provides a set of events which a DDEX provider can raise when changes to data objects are made, and provides the means by which a provider can connect to them.
Inheritance Hierarchy
System.Object
Microsoft.VisualStudio.Data.DataObjectChangeEvents
Namespace: Microsoft.VisualStudio.Data
Assembly: Microsoft.VisualStudio.Data (in Microsoft.VisualStudio.Data.dll)
Syntax
'Declaración
<GuidAttribute("5619B0F3-93CD-4af1-8FFC-458B86B45778")> _
Public MustInherit Class DataObjectChangeEvents
[GuidAttribute("5619B0F3-93CD-4af1-8FFC-458B86B45778")]
public abstract class DataObjectChangeEvents
[GuidAttribute(L"5619B0F3-93CD-4af1-8FFC-458B86B45778")]
public ref class DataObjectChangeEvents abstract
[<AbstractClass>]
[<GuidAttribute("5619B0F3-93CD-4af1-8FFC-458B86B45778")>]
type DataObjectChangeEvents = class end
public abstract class DataObjectChangeEvents
The DataObjectChangeEvents type exposes the following members.
Constructors
Name | Description | |
---|---|---|
DataObjectChangeEvents | Class constructor. Instantiates a new instance of the DataObjectChangeEvents class. |
Top
Methods
Name | Description | |
---|---|---|
EndEventGroup | Terminates an event group that was initiated by calling the StartEventGroup method. | |
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.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
OnEventGroupEnded | Handler for the EventGroupEnded event. | |
OnEventGroupStarted | Handler for the EventGroupStarted event. | |
OnObjectAdded | Handler for the ObjectAdded event. | |
OnObjectChanged | Handler for the ObjectChanged event. | |
OnObjectRemoved | Handler for the ObjectRemoved event. | |
RaiseObjectAdded(String, array<Object[]) | Raises a standalone ObjectAdded event, specifying the object type and identifier. | |
RaiseObjectAdded(Int32, String, array<Object[]) | Raises the ObjectAdded event within a specific event group. | |
RaiseObjectChanged(String, array<Object[]) | Raises a standalone ObjectChanged event, specifying the type name and identifier. | |
RaiseObjectChanged(Int32, String, array<Object[]) | Raises the ObjectChanged event within a specified event group. | |
RaiseObjectChanged(String, array<Object[], array<Object[]) | Raises a standalone ObjectChanged event for an object whose identifier was modified during the change. | |
RaiseObjectChanged(Int32, String, array<Object[], array<Object[]) | Raises an ObjectChanged event within a specific event group for an object whose identifier was modified during the change. | |
RaiseObjectRemoved(String, array<Object[]) | Raises a standalone ObjectRemoved event, specifying type name and object identifier. | |
RaiseObjectRemoved(Int32, String, array<Object[]) | Raises the ObjectRemoved event within a specified event group. | |
RollbackEventGroup | Ends an event group by removing the queued event set from the group. | |
StartEventGroup | Starts a group of events initiated by a call to the StartEventGroup method. | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Top
Events
Name | Description | |
---|---|---|
EventGroupEnded | Event raised when an event group has completed. | |
EventGroupStarted | Event raised when an event group has started. | |
ObjectAdded | Event raised when a data object has been added. | |
ObjectChanged | Event raised when a data object has been changed. | |
ObjectRemoved | Event raised when a data object has been removed. |
Top
Remarks
In addition to singular events, this class allows you to structure event groups.
Under some circumstances, multiple change events need to be grouped together and be treated as an atomic transaction.
Normally, an event listener reacts to event-group notifications by assembling a queue of events raised inside an event group; then, only after notification that the event group has ended, are the events processed in a transactional manner (that is, all events apply, or none of the events apply).
On the notification side, event grouping is implemented by enabling the specification of a hierarchy of event groups, each of them identified with a group ID. A notifier begins by calling StartEventGroup, which returns an ID for the group. Then the notifier calls the [M:Microsoft.VisualStudio.Data.DataObjectChangeEvents.RaiseObjectAdded(System.String,System.Object[]],RaiseObjectChanged, and RaiseObjectRemoved methods, passing in the group ID. (Optionally, a notifier can start an embedded event group by calling StartEventGroup again, with the current group ID.)
Finally the notifier calls EndEventGroup using the group ID. Once the top-most group (the group created by calling StartEventGroup with a parameter of zero) has ended, all the events raised for that group are dispatched to listeners in a single event group.
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.