FileSurfer 2.1.2
Cross-platform file manager with support for Git and SFTP
Loading...
Searching...
No Matches
FileSurfer.Core.Models.UndoRedoHandler< T > Class Template Referencesealed

Represents a generic undo/redo history chain that supports navigation, insertion, removal, and enumeration around the current position. More...

Collaboration diagram for FileSurfer.Core.Models.UndoRedoHandler< T >:

Public Member Functions

 UndoRedoHandler (Action? onCollectionChanged=null)
 Initializes a new UndoRedoHandler<T> chain.
void AddNewNode (T data)
 Inserts a new node after the current position and discards any forward history.
bool IsTail ()
 Determines if the current UndoRedoNode is the end of the UndoRedoHandler<T> chain.
bool IsHead ()
 Determines if the current UndoRedoNode is the beginning of the UndoRedoHandler<T> chain.
T? GetPrevious ()
 Gets the data of the previous UndoRedoNode in the UndoRedoHandler<T> chain.
T? GetNext ()
 Gets the data of the next UndoRedoNode in the UndoRedoHandler<T> chain.
void MoveToPrevious ()
 Moves to the previous UndoRedoNode in the UndoRedoHandler<T> chain.
void MoveToNext ()
 Moves to the next UndoRedoNode in the UndoRedoHandler<T> chain.
IEnumerable< T > EnumerateFromCurrentForward ()
 Enumerates items from the current position forward.
IEnumerable< T > EnumerateFromCurrentBack ()
 Enumerates items from the current position backward.
void RemoveCurrent (bool goToPrevious)
 Removes the current UndoRedoNode from the UndoRedoHandler<T> chain.

Package Functions

 UndoRedoNode (T? data, UndoRedoNode? previous=null, UndoRedoNode? next=null)
 Initializes a new node and optionally links it between previous and next nodes.

Package Attributes

readonly? T Data
 Value stored by this node.
UndoRedoNode? Previous
 Previous node in the chain.
UndoRedoNode? Next
 Next node in the chain.

Properties

T? Current [get]
 Returns the data of the current UndoRedoNode.

Detailed Description

Represents a generic undo/redo history chain that supports navigation, insertion, removal, and enumeration around the current position.

Member Function Documentation

◆ AddNewNode()

void FileSurfer.Core.Models.UndoRedoHandler< T >.AddNewNode ( T data)
inline

Inserts a new node after the current position and discards any forward history.

Parameters
dataValue to store in the newly inserted node.
Here is the call graph for this function:

◆ EnumerateFromCurrentBack()

IEnumerable< T > FileSurfer.Core.Models.UndoRedoHandler< T >.EnumerateFromCurrentBack ( )
inline

Enumerates items from the current position backward.

Returns
A backward sequence of non-null values before the current node.
Here is the call graph for this function:

◆ EnumerateFromCurrentForward()

IEnumerable< T > FileSurfer.Core.Models.UndoRedoHandler< T >.EnumerateFromCurrentForward ( )
inline

Enumerates items from the current position forward.

Returns
A forward sequence of non-null values after the current node.
Here is the call graph for this function:

◆ GetNext()

T? FileSurfer.Core.Models.UndoRedoHandler< T >.GetNext ( )
inline

Gets the data of the next UndoRedoNode in the UndoRedoHandler<T> chain.

◆ GetPrevious()

T? FileSurfer.Core.Models.UndoRedoHandler< T >.GetPrevious ( )
inline

Gets the data of the previous UndoRedoNode in the UndoRedoHandler<T> chain.

◆ IsHead()

bool FileSurfer.Core.Models.UndoRedoHandler< T >.IsHead ( )
inline

Determines if the current UndoRedoNode is the beginning of the UndoRedoHandler<T> chain.

◆ IsTail()

bool FileSurfer.Core.Models.UndoRedoHandler< T >.IsTail ( )
inline

Determines if the current UndoRedoNode is the end of the UndoRedoHandler<T> chain.

◆ MoveToNext()

void FileSurfer.Core.Models.UndoRedoHandler< T >.MoveToNext ( )
inline

Moves to the next UndoRedoNode in the UndoRedoHandler<T> chain.

◆ MoveToPrevious()

void FileSurfer.Core.Models.UndoRedoHandler< T >.MoveToPrevious ( )
inline

Moves to the previous UndoRedoNode in the UndoRedoHandler<T> chain.

Here is the caller graph for this function:

◆ RemoveCurrent()

void FileSurfer.Core.Models.UndoRedoHandler< T >.RemoveCurrent ( bool goToPrevious)
inline

Removes the current UndoRedoNode from the UndoRedoHandler<T> chain.

Throws InvalidOperationException if _current is either _head or _tail.

Parameters
goToPreviousWhen true, moves to the previous node after removal; otherwise moves to the next node.
Exceptions
InvalidOperationExceptionThrown when _current is _head or _tail.

◆ UndoRedoHandler()

FileSurfer.Core.Models.UndoRedoHandler< T >.UndoRedoHandler ( Action? onCollectionChanged = null)
inline

Initializes a new UndoRedoHandler<T> chain.

Parameters
onCollectionChangedOptional callback invoked whenever the current position or chain structure changes.
Here is the call graph for this function:

◆ UndoRedoNode()

FileSurfer.Core.Models.UndoRedoHandler< T >.UndoRedoNode ( T? data,
UndoRedoNode? previous = null,
UndoRedoNode? next = null )
inlinepackage

Initializes a new node and optionally links it between previous and next nodes.

Parameters
dataValue to store in the node.
previousPrevious node to link from.
nextNext node to link to.
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ Data

readonly? T FileSurfer.Core.Models.UndoRedoHandler< T >.Data
package

Value stored by this node.

◆ Next

UndoRedoNode? FileSurfer.Core.Models.UndoRedoHandler< T >.Next
package

Next node in the chain.

◆ Previous

UndoRedoNode? FileSurfer.Core.Models.UndoRedoHandler< T >.Previous
package

Previous node in the chain.

Property Documentation

◆ Current

T? FileSurfer.Core.Models.UndoRedoHandler< T >.Current
get

Returns the data of the current UndoRedoNode.


The documentation for this class was generated from the following file:
  • /home/janecea/Documents/CODE/PROJECTS/FileSurfer/src/FileSurfer.Core/Models/UndoRedoHandler.cs