RangeSnapshotCommandBase Class

Base class for commands that snapshot a set of cells (value, formula, format) for undo support.

Namespace: Radzen.Blazor.Spreadsheet

Assembly: Radzen.Blazor.dll

Syntax

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

Constructors

RangeSnapshotCommandBaselink

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

The sheet being operated on.

Declaration
protected readonly Documents.Spreadsheet.Worksheet sheet

snapshotlink

The captured cell snapshots keyed by cell reference.

Declaration
protected readonly Dictionary<Documents.Spreadsheet.CellRef, ValueTuple<object, string, Documents.Spreadsheet.Format>> snapshot

Properties

Featurelink

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

RequiredActionlink

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

Methods

Capturelink

Captures the current value, formula and format of the cell at cellRef into the snapshot.

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

CaptureRangelink

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

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

Declaration
public bool Execute()
Returns
Type Description
bool

Restorelink

Restores the captured cells back into the sheet using the formula-or-value convention.

Declaration
protected void Restore(IReadOnlyDictionary<Documents.Spreadsheet.CellRef, ValueTuple<object, string, Documents.Spreadsheet.Format>> cells)
Parameters
Type Name Description
IReadOnlyDictionary<Documents.Spreadsheet.CellRef, ValueTuple<object, string, Documents.Spreadsheet.Format>> cells

RestoreSnapshotlink

Restores the captured cells back into the sheet using the formula-or-value convention.

Declaration
protected void RestoreSnapshot()

Unexecutelink

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