Partager via


UndoUnit Class

Wrapper for Modeling transactions so they can be used by the shell's IOleUndoManager interface.

This API is not CLS-compliant. 

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.Modeling.Shell.UndoUnit

Namespace:  Microsoft.VisualStudio.Modeling.Shell
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.Shell.12.0 (in Microsoft.VisualStudio.Modeling.Sdk.Shell.12.0.dll)

Syntax

'Declaration
<CLSCompliantAttribute(False)> _
Public Class UndoUnit _
    Implements IOleUndoUnit
[CLSCompliantAttribute(false)]
public class UndoUnit : IOleUndoUnit
[CLSCompliantAttribute(false)]
public ref class UndoUnit : IOleUndoUnit
[<CLSCompliantAttribute(false)>]
type UndoUnit =  
    class 
        interface IOleUndoUnit 
    end
public class UndoUnit implements IOleUndoUnit

The UndoUnit type exposes the following members.

Constructors

  Name Description
Public method UndoUnit(IServiceProvider, Context, TransactionCommitHandler) Creates an undo unit without a transaction, but with a delegate it can use to obtain the transaction later, when necessary.
Public method UndoUnit(IServiceProvider, Context, TransactionItem) Constructs a new undo unit.
Public method UndoUnit(IServiceProvider, Context, TransactionCommitHandler, DescriptionHandler) Creates an undo unit without a transaction, but with a delegate it can use to obtain the transaction later, when necessary. Also specifies a delegate that can be used to obtain the description of this action, to avoid a commit.

Top

Methods

  Name Description
Public method Do Performs undo/redo based on the internal state of this undo unit. Also, undo unit is responsible for adding itself to the *opposite* stack.
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 GetDescription Gets a text description for this undo unit, which is displayed by the shell
Public method GetHashCode Serves as the default hash function. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method GetUnitType Used by undo manager to provide special handling for certain undo units based on their type -- we don't use this method
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method OnNextAdd Called when a new undo unit is added on top of this one on the undo stack. We don't need to do anything here.
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.Modeling.Shell Namespace