GoDigram for .NET Framework and .NET Core
Northwoods.Go Namespace / GoUndoManager Class / EndTransaction Method
true to terminate the transaction normally; false to abort it
the internal locale-neutral name for the transaction
a string describing the transaction, used for the IGoUndoableEdit.PresentationName
In This Topic
    EndTransaction Method
    In This Topic
    Stop the current transaction, either aborting it or committing it.
    Syntax
    public virtual bool EndTransaction( 
       bool commit,
       string tname,
       string pname
    )

    Parameters

    commit
    true to terminate the transaction normally; false to abort it
    tname
    the internal locale-neutral name for the transaction
    pname
    a string describing the transaction, used for the IGoUndoableEdit.PresentationName

    Return Value

    true for a committed top-level transaction
    Remarks

    If this call stops a top-level transaction, a value of false for commit just clears the information in the CurrentEdit. If commit is true for a top-level transaction, we mark the CurrentEdit complete, call CommitCompoundEdit, and add the resulting GoUndoManagerCompoundEdit to the list of compound edits that this undo manager is recording.

    Committing a transaction when there have been some undos without corresponding redos will throw away the compound edits holding changes that happened after the current state, before adding this new compound edit to the undo manager's list of edits.

    This method raises a GoDocument.Changed event for each of this undo manager's Documents, with a hint of GoDocument.FinishedTransaction, and with a GoChangedEventArgs.GoChangedEventArgs.Object that is the GoUndoManagerCompoundEdit that has been added to the list of AllEdits. Furthermore the GoChangedEventArgs.GoChangedEventArgs.OldValue will be the tname, and the GoChangedEventArgs.NewValue will be the pname. Similarly, if the transaction is aborted, either because commit is false or because there is no CurrentEdit to commit, all of the Documents get a GoDocument.AbortedTransaction Changed event. The values passed in the GoChangedEventArgs may all be null, however.

    See Also