GraphUndoUnit Class

This class represents one undoable graph change which appears on the VS undo stack.

Inheritance Hierarchy

Object
  Microsoft.VisualStudio.GraphModel.GraphUndoUnit

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

Syntax

'Declaration
Public Class GraphUndoUnit
public class GraphUndoUnit
public ref class GraphUndoUnit
type GraphUndoUnit =  class end
public class GraphUndoUnit

The GraphUndoUnit type exposes the following members.

Constructors

  Name Description
Public method GraphUndoUnit Construct an undo unit from the changes that are about to be committed in the given GraphUpdatedEventArgs. This has to be called during the Graph Updating, the Updated event is too late because we must be able to save the old values before the changes are committed in order to be able to undo those changes.

Top

Properties

  Name Description
Public property Causality This undo unit's associated Causality.
Public property Description This undo unit's description.
Protected property Disabled Whether this undo unit should be disabled (as determined by information found in the constructor).
Public property IsEmpty Whether this undo unit is empty.
Public property IsRedoUnit Whether this is a redo unit.
Public property IsUndoUnit Whether this is an undo unit.
Public property ScopeProperties The property bag associated with this undo unit.

Top

Methods

  Name Description
Protected method AddLink Called during Apply if a link has to be added back to the graph. You can override this but you must call base.AddLInk.
Protected method AddNode Called during Apply if a node has to be added back to the graph. You can override this but you must call base.AddNode.
Public method Apply Performs this undo or redo operation.
Public method ApplyToGraph Applies the undo unit to a different graph.
Public method ApplyToNode Applies any property or category changes on the original node to the input node.
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public methodStatic member IsRedo Determines whether the specified GraphTransactionScope is currently being used for a redo operation.
Public methodStatic member IsUndo Determines whether the specified GraphTransactionScope is currently being used for an undo operation.
Public methodStatic member IsUndoable Return true if changes to the given property on the given graphObject are undoable or not. This method returns true if the property metadata has the IsUndoable flag set or it returns false if it does not have the IsSharable or IsSerializable flag. Also if it has IsWriteOnce then it also returns false, because the UndoStack would not be able to change the value. If false is returned then the property is not preserved across undo/redo. For transient properties returning false can save lots of memory in the undo stack.
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Protected method RemoveLink Called during Apply if a link has to be added back to the graph. You can override this but you must call base.RemoveLink.
Protected method RemoveNode Called during Apply if a node has to be removed from to the graph. You can override this but you must call base.RemoveNode.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

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.

See Also

Reference

Microsoft.VisualStudio.GraphModel Namespace