DataObjectChangeEvents.EndEventGroup Method
Terminates an event group that was initiated by calling the StartEventGroup method.
Namespace: Microsoft.VisualStudio.Data
Assembly: Microsoft.VisualStudio.Data (in Microsoft.VisualStudio.Data.dll)
Syntax
'Declaración
Public MustOverride Sub EndEventGroup ( _
groupId As Integer _
)
public abstract void EndEventGroup(
int groupId
)
public:
virtual void EndEventGroup(
int groupId
) abstract
abstract EndEventGroup :
groupId:int -> unit
public abstract function EndEventGroup(
groupId : int
)
Parameters
- groupId
Type: System.Int32
An ID number for the specified event group.
Exceptions
Exception | Condition |
---|---|
ArgumentOutOfRangeException | The groupId parameter is less than or equal to zero or is greater than the current number of allocated groups. |
ArgumentException | The groupId parameter is invalid. |
Remarks
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 RaiseObjectAdded,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 EndEventGroupusing 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.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.