Condividi tramite


GraphUndoUnit Class

Definition

Important

This API is not CLS-compliant.

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

public ref class GraphUndoUnit : Microsoft::VisualStudio::Diagnostics::PerformanceProvider::DebugTrace::ITraceableInstance, Microsoft::VisualStudio::GraphModel::IGraphUndoData, Microsoft::VisualStudio::GraphModel::IMergeableUndo, Microsoft::VisualStudio::OLE::Interop::IOleUndoUnit
[System.CLSCompliant(false)]
public class GraphUndoUnit : Microsoft.VisualStudio.Diagnostics.PerformanceProvider.DebugTrace.ITraceableInstance, Microsoft.VisualStudio.GraphModel.IGraphUndoData, Microsoft.VisualStudio.GraphModel.IMergeableUndo, Microsoft.VisualStudio.OLE.Interop.IOleUndoUnit
public class GraphUndoUnit : Microsoft.VisualStudio.Diagnostics.PerformanceProvider.DebugTrace.ITraceableInstance, Microsoft.VisualStudio.GraphModel.IGraphUndoData, Microsoft.VisualStudio.GraphModel.IMergeableUndo, Microsoft.VisualStudio.OLE.Interop.IOleUndoUnit
[<System.CLSCompliant(false)>]
type GraphUndoUnit = class
    interface IMergeableUndo
    interface IOleUndoUnit
    interface IGraphUndoData
    interface ITraceableInstance
type GraphUndoUnit = class
    interface IMergeableUndo
    interface IOleUndoUnit
    interface IGraphUndoData
    interface ITraceableInstance
Public Class GraphUndoUnit
Implements IGraphUndoData, IMergeableUndo, IOleUndoUnit, ITraceableInstance
Inheritance
GraphUndoUnit
Attributes
Implements
Microsoft.VisualStudio.Diagnostics.PerformanceProvider.DebugTrace.ITraceableInstance IGraphUndoData IMergeableUndo IOleUndoUnit

Constructors

GraphUndoUnit(Graph, GraphUpdatedEventArgs)

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 since we have to be able to save the old values before the changes are committed in order to be able to undo those changes.

Properties

Causality

This undo unit's associated Causality.

Description

This undo unit's description.

Disabled

Whether this undo unit should be disabled (as determined by information found in the constructor).

Enlistment

This undo unit's associated GraphTransactionEnlistment.

IsEmpty

Whether this undo unit is empty.

IsRedoUnit

Whether this is a redo unit.

IsUndoUnit

Whether this is an undo unit.

ScopeProperties

The property bag associated with this undo unit.

Methods

AddLink(GraphLink)

Called during Apply if a link needs to be added back to the graph. You can override this but you must call base.AddLInk.

AddNode(GraphNode)

Called during Apply if a node needs to be added back to the graph. You can override this but you must call base.AddNode.

Apply()

Applies the undo unit.

Apply(Action)

Performs this undo or redo operation.

ApplyToGraph(Graph)

Applies the undo unit to a different graph.

ApplyToNode(GraphNode, GraphNode)

Applies any property or category changes on the original node to the input node.

Do(IOleUndoManager)

Performs undo/redo based on the internal state of this undo unit Also, undo unit is responsible for adding itself to the opposite stack

DoApply(IOleUndoManager)
DoGetCalculateDescription()
GetDescription(String)

Gets a text description for this undo unit, which is displayed by the shell.

GetUnitType(Guid, Int32)

Gets the Undo UnitType.

IsRedo(Dictionary<Object,Object>)

Determines whether the specified GraphTransactionScope is currently being used for a redo operation.

IsUndo(Dictionary<Object,Object>)

Determines whether the specified GraphTransactionScope is currently being used for an undo operation.

IsUndoable(GraphObject, GraphProperty)

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, since the UndoStack would not be allowed to change the value. If false is returned then the property is not preserved across undo/redo.
For transient properties returning false can save a lot of memory in the undo stack.

Merge(IMergeableUndo)

Merges the undo unit into this one

OnNextAdd()

Called when a new undo unit is added on top of this one on the undo stack.

RemoveLink(GraphLink)

Called during Apply if a link needs to be added back to the graph. You can override this but you must call base.RemoveLink.

RemoveNode(GraphNode)

Called during Apply if a node needs to be removed from to the graph. You can override this but you must call base.RemoveNode.

Explicit Interface Implementations

IGraphUndoData.AddedCategories
IGraphUndoData.AddedConditions
IGraphUndoData.AddedLinks
IGraphUndoData.AddedNodes
IGraphUndoData.AddedProperties
IGraphUndoData.AddedSetters
IGraphUndoData.AddedStyles
IGraphUndoData.RemovedCategories
IGraphUndoData.RemovedConditions
IGraphUndoData.RemovedLinks
IGraphUndoData.RemovedNodes
IGraphUndoData.RemovedProperties
IGraphUndoData.RemovedSetters
IGraphUndoData.RemovedStyles
ITraceableInstance.InstanceTrace

Applies to