Base class for commands that snapshot a set of cells (value, formula, format) for undo support.
Object
Spreadsheet.DeleteRangeCommandBase
Namespace: Radzen.Blazor.Spreadsheet
Assembly: Radzen.Blazor.dll
public abstract class RangeSnapshotCommandBase : Spreadsheet.ICommand, Spreadsheet.IProtectedCommandInitializes a new instance of the RangeSnapshotCommandBase class.
protected RangeSnapshotCommandBase(Documents.Spreadsheet.Worksheet sheet)
| Type | Name | Description |
|---|---|---|
| Documents.Spreadsheet.Worksheet | sheet |
The sheet being operated on.
protected readonly Documents.Spreadsheet.Worksheet sheetThe captured cell snapshots keyed by cell reference.
protected readonly Dictionary<Documents.Spreadsheet.CellRef, ValueTuple<object, string, Documents.Spreadsheet.Format>> snapshotpublic Spreadsheet.SpreadsheetFeature? Feature { get; }
| Type | Description |
|---|---|
| Spreadsheet.SpreadsheetFeature? |
public Documents.Spreadsheet.SheetAction RequiredAction { get; }
| Type | Description |
|---|---|
| Documents.Spreadsheet.SheetAction |
Captures the current value, formula and format of the cell at cellRef into the snapshot.
protected void Capture(Documents.Spreadsheet.CellRef cellRef)
| Type | Name | Description |
|---|---|---|
| Documents.Spreadsheet.CellRef | cellRef |
Captures every cell in cells into the snapshot.
protected void CaptureRange(IEnumerable<Documents.Spreadsheet.CellRef> cells)
| Type | Name | Description |
|---|---|---|
| IEnumerable<Documents.Spreadsheet.CellRef> | cells |
Performs the command-specific execution. The base class clears the snapshot before this is called.
protected abstract bool DoExecute()
| Type | Description |
|---|---|
| bool |
Restores the captured cells back into the sheet using the formula-or-value convention.
protected void Restore(IReadOnlyDictionary<Documents.Spreadsheet.CellRef, ValueTuple<object, string, Documents.Spreadsheet.Format>> cells)
| Type | Name | Description |
|---|---|---|
| IReadOnlyDictionary<Documents.Spreadsheet.CellRef, ValueTuple<object, string, Documents.Spreadsheet.Format>> | cells |
Restores the captured cells back into the sheet using the formula-or-value convention.
protected void RestoreSnapshot()