Share via


XmlEditingScope.UndoScope Property

Returns the original XmlEditingScope that created the undo unit if this XmlEditingScope comes from the UndoRedoCompleted event. Returns null in other cases.

Namespace: Microsoft.VisualStudio.XmlEditor
Assembly: Microsoft.VisualStudio.XmlEditor (in Microsoft.VisualStudio.XmlEditor.dll)

Usage

'Usage
Dim instance As XmlEditingScope
Dim value As XmlEditingScope

value = instance.UndoScope

Syntax

'Declaration
Public MustOverride ReadOnly Property UndoScope As XmlEditingScope
public abstract XmlEditingScope UndoScope { get; }
public:
virtual property XmlEditingScope^ UndoScope {
    XmlEditingScope^ get () abstract;
}
/** @property */
public abstract XmlEditingScope get_UndoScope ()
public abstract function get UndoScope () : XmlEditingScope

Property Value

The XmlEditingScope that created the undo unit.

Remarks

This property is useful if you want to rediscover the original user intention during an undo/redo operation.

The XmlModelChange objects in this XmlEditingScope are not necessarily a mirror image of the XmlModelChange in the UndoScope object. The reason for this that undo/redo is an independent buffer edit which simply triggers the XML editor like any other edit. The incremental parser might re-parse more or less of the buffer than you expect, depending on the error-recovery behavior of the parser.

The XML editor parser might re-parse the entire XML start tag, resulting in several RemoveNodeChange, AddNodeChange, and NodeValueChange operations. Therefore, an XML designer must always be able to handle any set of changes and incrementally update the designer UI state based on these changes. TheUndoScope property is provided so that you can find out if any saved UI states can be shared across these two XmlEditingScope. You can use the UserState property to help make that connection.

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.

Platforms

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003 , Windows Server 2008, and Windows 2000

Target Platforms

See Also

Reference

XmlEditingScope Class
XmlEditingScope Members
Microsoft.VisualStudio.XmlEditor Namespace

Build Date:

2012-11-12