Partager via


OleUndoEngine.UndoUnit Class

Extends support for encapsulating a unit of work that a user can undo.

Inheritance Hierarchy

Object
  UndoUnit
    Microsoft.VisualStudio.Shell.Design.OleUndoEngine.UndoUnit

Namespace:  Microsoft.VisualStudio.Shell.Design
Assembly:  Microsoft.VisualStudio.Shell.Design (in Microsoft.VisualStudio.Shell.Design.dll)

Syntax

'Declaration
Protected Class UndoUnit _
    Inherits UndoUnit _
    Implements IOleUndoUnit, IOleParentUndoUnit
protected class UndoUnit : UndoUnit, 
    IOleUndoUnit, IOleParentUndoUnit
protected ref class UndoUnit : public UndoUnit, 
    IOleUndoUnit, IOleParentUndoUnit
type UndoUnit =  
    class 
        inherit UndoUnit 
        interface IOleUndoUnit 
        interface IOleParentUndoUnit 
    end
protected class UndoUnit extends UndoUnit implements IOleUndoUnit, IOleParentUndoUnit

The OleUndoEngine.UndoUnit type exposes the following members.

Constructors

  Name Description
Public method OleUndoEngine.UndoUnit Initializes a new instance of the OleUndoEngine.UndoUnit class.

Top

Properties

  Name Description
Public property IsEmpty Gets a value indicating whether the UndoUnit contains no events. (Inherited from UndoUnit.)
Public property Name Gets the name of the UndoUnit. (Inherited from UndoUnit.)
Protected property UndoEngine Gets the parent UndoEngine. (Inherited from UndoUnit.)

Top

Methods

  Name Description
Public method Close Receives a call from the undo engine to close this unit. (Inherited from UndoUnit.)
Public method ComponentAdded Receives a call from the UndoEngine in response to a ComponentAdded event. (Inherited from UndoUnit.)
Public method ComponentAdding Receives a call from the UndoEngine in response to a ComponentAdding event. (Inherited from UndoUnit.)
Public method ComponentChanged Receives a call from the UndoEngine in response to a ComponentChanged event. (Inherited from UndoUnit.)
Public method ComponentChanging Receives a call from the UndoEngine in response to a ComponentChanging event. (Inherited from UndoUnit.)
Public method ComponentRemoved Receives a call from the UndoEngine in response to a ComponentRemoved event. (Inherited from UndoUnit.)
Public method ComponentRemoving Receives a call from the UndoEngine in response to a ComponentRemoving event. (Inherited from UndoUnit.)
Public method ComponentRename Receives a call from the UndoEngine in response to a ComponentRename event. (Inherited from UndoUnit.)
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 the default hash function. (Inherited from Object.)
Protected method GetService Gets an instance of the requested service. (Inherited from UndoUnit.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method ToString Returns a String that represents the current name of the unit. (Inherited from UndoUnit.)
Public method Undo Performs an undo or redo action. (Inherited from UndoUnit.)
Protected method UndoCore Called by Undo to perform an undo action. (Inherited from UndoUnit.)

Top

Explicit Interface Implementations

  Name Description
Explicit interface implemetationPrivate method IOleParentUndoUnit.Add Adds an undo unit to the parent collection.
Explicit interface implemetationPrivate method IOleParentUndoUnit.Close Closes the specified parent undo unit.
Explicit interface implemetationPrivate method IOleParentUndoUnit.Do Performs the undo operation.
Explicit interface implemetationPrivate method IOleParentUndoUnit.FindUnit Searches for the specified unit in the child undo unit hierarchy.
Explicit interface implemetationPrivate method IOleParentUndoUnit.GetDescription Gets the description of the undo unit.
Explicit interface implemetationPrivate method IOleParentUndoUnit.GetParentState Gets the state of the top-level parent undo unit.
Explicit interface implemetationPrivate method IOleParentUndoUnit.GetUnitType Gets the type of the undo unit.
Explicit interface implemetationPrivate method IOleParentUndoUnit.OnNextAdd Notifies the last undo unit in the collection that a new unit has been added.
Explicit interface implemetationPrivate method IOleParentUndoUnit.Open Opens an undo unit.
Explicit interface implemetationPrivate method IOleUndoUnit.Do Performs the undo operation.
Explicit interface implemetationPrivate method IOleUndoUnit.GetDescription Gets the description of the undo unit.
Explicit interface implemetationPrivate method IOleUndoUnit.GetUnitType Gets the type of the undo unit.
Explicit interface implemetationPrivate method IOleUndoUnit.OnNextAdd Notifies the last undo unit in the collection that a new unit has been added.

Top

Remarks

The OleUndoEngine.UndoUnit class is a nested class within OleUndoEngine that encapsulates an action that a user can undo by monitoring change notifications and builds up a list of events for each change.

It saves these events using IDesignerSerializationService. An OleUndoEngine.UndoUnit receives event notifications for changes through several methods derived from UndoUnit, IOleParentUndoUnit and

IOleUndoUnit

By implementing UndoUnit, IOleParentUndoUnit, and IOleUndoUnit, OleUndoEngine.UndoUnit is able to better support linked undo by providing explicit connection between parent and child undo units.

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.Shell.Design Namespace

OleUndoEngine

UndoUnit

IOleParentUndoUnit

IOleUndoUnit