ChangeBatchBase.AddChanges Method

Adds a specified set of item changes to the group that currently open

Namespace:  Microsoft.Synchronization
Assembly:  Microsoft.Synchronization (in Microsoft.Synchronization.dll)

Syntax

'Declaration
Public Sub AddChanges ( _
    changes As IEnumerable(Of ItemChange) _
)
'Usage
Dim instance As ChangeBatchBase
Dim changes As IEnumerable(Of ItemChange)

instance.AddChanges(changes)
public void AddChanges(
    IEnumerable<ItemChange> changes
)
public:
void AddChanges(
    IEnumerable<ItemChange^>^ changes
)
member AddChanges : 
        changes:IEnumerable<ItemChange> -> unit 
public function AddChanges(
    changes : IEnumerable<ItemChange>
)

Parameters

Exceptions

Exception Condition
ChangeBatchIsReadOnlyException

The change batch has already been sent to a change applier or synchronization session. Changes cannot be added to the batch after it has been sent.

ArgumentNullException

changes is a null reference (Nothing in Visual Basic).

ObjectDisposedException

This ChangeBatchBase has been disposed.

InvalidOperationException
  • One of the changes in changes contains a CreationVersion that is a null reference (Nothing in Visual Basic)

  • One of the changes in changes contains a ChangeVersion that is a null reference (Nothing in Visual Basic) and its ChangeUnitChanges is empty.

—or—

  • There is no current change group.

Remarks

Before item changes can be added to a ChangeBatchBase object, a group must be opened by calling BeginOrderedGroup or the BeginUnorderedGroup method of the ChangeBatch object. Otherwise, this method throws InvalidOperationException.

See Also

Reference

ChangeBatchBase Class

Microsoft.Synchronization Namespace