Graph.BeginUpdate Method (Object, String, UndoOption, Boolean)

Starts a batch mode update on the Graph (which is more efficient). You must call the Complete() method on the returned GraphTransactionScope, otherwise your changes will be rolled back. The usual pattern is to use this in a using block so that if an exception is thrown the changes are automatically rolled back.

Namespace:  Microsoft.VisualStudio.GraphModel
Assembly:  Microsoft.VisualStudio.GraphModel (in Microsoft.VisualStudio.GraphModel.dll)

Syntax

'Declaration
Public Function BeginUpdate ( _
    undoUnitId As Object, _
    undoDescription As String, _
    option As UndoOption, _
    forceAdd As Boolean _
) As GraphTransactionScope
public GraphTransactionScope BeginUpdate(
    Object undoUnitId,
    string undoDescription,
    UndoOption option,
    bool forceAdd
)
public:
GraphTransactionScope^ BeginUpdate(
    Object^ undoUnitId, 
    String^ undoDescription, 
    UndoOption option, 
    bool forceAdd
)
member BeginUpdate : 
        undoUnitId:Object * 
        undoDescription:string * 
        option:UndoOption * 
        forceAdd:bool -> GraphTransactionScope
public function BeginUpdate(
    undoUnitId : Object, 
    undoDescription : String, 
    option : UndoOption, 
    forceAdd : boolean
) : GraphTransactionScope

Parameters

  • undoUnitId
    Type: Object

    For identifying and merging.

  • undoDescription
    Type: String

    An application might surface this caption as a label on the undo operations.

  • forceAdd
    Type: Boolean

    This is only valid if the option is UndoOption.Add. This causes a new undo unit even if it is empty. This is useful when you are doing a compound operation that consists of multiple merged undo units where you must be sure the Add operation adds the initial unit even if it is empty.

Return Value

Type: Microsoft.VisualStudio.GraphModel.GraphTransactionScope
A new GraphTransactionScope.

.NET Framework Security

See Also

Reference

Graph Class

BeginUpdate Overload

Microsoft.VisualStudio.GraphModel Namespace