RangeSnapshotCommandBase Class

Base class for commands that snapshot a set of cells as detached clones for undo support.

Namespace: Radzen.Blazor.Spreadsheet

Assembly: Radzen.Blazor.dll

Syntax

public abstract class RangeSnapshotCommandBase : Spreadsheet.ICommand, Spreadsheet.IProtectedCommand

Constructors

RangeSnapshotCommandBaseLink to this section

Initializes a new instance of the RangeSnapshotCommandBase class.

Declaration
protected RangeSnapshotCommandBase(Documents.Spreadsheet.Worksheet sheet)
Parameters
Type Name Description
Documents.Spreadsheet.Worksheet sheet

Fields

sheetLink to this section

The sheet being operated on.

Declaration
protected readonly Documents.Spreadsheet.Worksheet sheet

snapshotLink to this section

The captured cell snapshots keyed by cell reference. A snapshot is a detached clone, or null when the cell did not exist at capture time.

Declaration
protected readonly Dictionary<Documents.Spreadsheet.CellRef, Documents.Spreadsheet.Cell> snapshot

Properties

FeatureLink to this section

Declaration
public Spreadsheet.SpreadsheetFeature? Feature { get; }
Property Value
Type Description
Spreadsheet.SpreadsheetFeature?

RequiredActionLink to this section

Declaration
public Documents.Spreadsheet.SheetAction RequiredAction { get; }
Property Value

Methods

CaptureLink to this section

Captures the cell at cellRef into the snapshot as a detached clone.

Declaration
protected void Capture(Documents.Spreadsheet.CellRef cellRef)
Parameters
Type Name Description
Documents.Spreadsheet.CellRef cellRef

CaptureRangeLink to this section

Captures every cell in cells into the snapshot.

Declaration
protected void CaptureRange(IEnumerable<Documents.Spreadsheet.CellRef> cells)
Parameters
Type Name Description
IEnumerable<Documents.Spreadsheet.CellRef> cells

DoExecuteLink to this section

Performs the command-specific execution. The base class clears the snapshot before this is called.

Declaration
protected abstract bool DoExecute()
Returns
Type Description
bool

ExecuteLink to this section

Declaration
public bool Execute()
Returns
Type Description
bool

RestoreLink to this section

Restores the captured cells back into the sheet.

Declaration
protected void Restore(IReadOnlyDictionary<Documents.Spreadsheet.CellRef, Documents.Spreadsheet.Cell> cells)
Parameters
Type Name Description
IReadOnlyDictionary<Documents.Spreadsheet.CellRef, Documents.Spreadsheet.Cell> cells

RestoreSnapshotLink to this section

Restores the captured cells back into the sheet.

Declaration
protected void RestoreSnapshot()

UnexecuteLink to this section

Declaration
public abstract void Unexecute()
An error has occurred. This app may no longer respond until reloaded. Reload 🗙