Provides wrapper for an IUndoable
- Inheritance:
-
object
Disposable
Object object
- Implements:
-
IDisposable
IUndoable
Text Change Stack
Remarks
Since the IUndoable
Constructors
ObservableUndoableTextChangeStack(IUndoableTextChangeStack)
Initializes a new instance of the ObservableUndoableTextChangeStack
class.
Parameter | Type | Description |
---|---|---|
stack | IUndoable |
The IUndoable |
Properties
Capacity
Gets or sets the capacity of the stack.
Property Value
- int:
The capacity of the stack.
Remarks
If a new text change added to the stack causes the stack to exceed its capacity, the text changes at the bottom of the stack are removed until the stack no longer exceeds its capacity.
Count
Gets the count of text changes on the stack.
Property Value
- int:
The count of text changes on the stack.
IsAtSavePoint
Gets whether the last text change on the stack is a save point.
Property Value
- bool:
true
if the last text change on the stack is a save point; otherwise,false
.
Methods
Contains(IUndoableTextChange)
Returns whether the collection contains the specified IUndoable
Parameter | Type | Description |
---|---|---|
textChange | IUndoable |
The IUndoable |
Returns
- bool:
true
if the collection contains the specified IUndoableText ; otherwise,Change false
.
CopyTo(IUndoableTextChange[], int)
Copies the entire collection to a compatible one-dimensional Array
,
starting at the specified index of the target array.
Parameter | Type | Description |
---|---|---|
array | IUndoable |
The one-dimensional IUndoable |
arrayIndex | int | The zero-based index in |
Dispose(bool)
Releases the unmanaged resources used by the object and optionally releases the managed resources.
Parameter | Type | Description |
---|---|---|
disposing | bool |
|
Remarks
This method is called by the public Dispose
method and the Finalize
method.
Dispose
invokes this method with the disposing
parameter set to true
.
Finalize
invokes this method with disposing
set to false
.
GetEnumerator()
Retrieves an IEnumerator
object for the entire collection.
Returns
- IEnumerator<IUndoable
Text >:Change An
IEnumerator
object for the entire collection
Remarks
Enumerators are intended to be used only to read data in the collection. Enumerators cannot be used to modify the underlying collection.
The enumerator does not have exclusive access to the collection.
When an enumerator is instantiated, it takes a snapshot of the current state of the collection.
If changes are made to the collection, such as adding, modifying or deleting elements, the
snapshot gets out of sync and the enumerator throws an InvalidOperationException
.
Two enumerators instantiated from the same collection at the same time can have
different snapshots of the collection.
GetTextChange(int)
Gets the IUndoable
Parameter | Type | Description |
---|---|---|
index | int | The index of the text change to check. |
Returns
- IUndoable
Text :Change The IUndoable
Text that the specified location in the stack.Change
IndexOf(IUndoableTextChange)
Returns the index of the IUndoable
Parameter | Type | Description |
---|---|---|
textChange | IUndoable |
The IUndoable |
Returns
- int:
The index of the IUndoable
Text in the list, orChange -1
if not found.
Events
CapacityChanged
Occurs when the capacity of the stack is changed.
Event Type
CollectionChanged
Occurs when the collection is changed.
Event Type
StackChanged
Occurs when the contents of the stack are changed.