API Help
Eplan.EplApi.DataModel Namespace / UndoStep Class
Members Example

In This Topic
    UndoStep Class
    In This Topic
    Class representing DataModel's Undo.
    Inheritance Hierarchy

    System.Object
       Eplan.EplApi.DataModel.UndoStep

    Syntax
    public sealed class UndoStep 
    public ref class UndoStep sealed 
    Remarks
    The class implements System.IDisposable interface. All the functions that perform only changes to persistent objects of a project has basically Undo protocol capability. All features, that make the changes directly in the file system or registry are not covered by the Undo technology. This concerns for example opening/closing project, restore, creating UserDefinedPropertyDefinition, etc. Using of UndoStep allows to use GUI UndoList. E.q. it is possible to use Edit->Redo after UndoStep::DoUndo() call but not possible when using Transactions. No transaction is needed within UndoStep. It is not possible to call DoUndo() twice to reverse two steps. If a project is changed via API without using an UndoStep, the undo history of EPLAN is cleared. See also "Undoing and Redoing Actions" chapter of Eplan Help.
    Example
    UndoStep usage - only inside "using".
    using (UndoStep undo = new UndoManager().CreateUndoStep())
    {
    	SelectionSet oSS = new SelectionSet();
    	Function f = oSS.Selection[0] as Function;
    	f.Properties.FUNC_CUSTOM_SUPPLEMENTARYFIELD01 = "new value";
    	// ... code ...				//
        // and if needed DoUndo call//
        undo.DoUndo();
    }
    Public Methods
     NameDescription
    Public MethodClose and open Undo protocol. Call this method to mark step in Undo action list.  
    Public MethodClose Undo protocol. After call this method Undo action is not possible.  
    Public MethodVirtual deterministic destructor.  
    Public MethodOverloaded. Make Undo action - reverse all operations up to last CloseOpenUndo call or initalization of UndoStep object.  
    Public MethodSet description of Undo action.  
    Top
    See Also