Class AbstractFormulaChangeMonitor

Class AbstractFormulaChangeMonitor

Namespace: Aspose.Cells
Assembly: Aspose.Cells.dll (25.2.0)

Монитор для отслеживания изменений формул пользователем во время определенных операций.

public abstract class AbstractFormulaChangeMonitor

Наследование

objectAbstractFormulaChangeMonitor

Унаследованные члены

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Примеры

Workbook wb = new Workbook("template.xlsx");
InsertOptions options = new InsertOptions();
options.FormulaChangeMonitor = new MyFormulaChangeMonitor(wb.Worksheets);
wb.Worksheets[0].Cells.InsertRows(0, 2, options);

class MyFormulaChangeMonitor : AbstractFormulaChangeMonitor
{
    private readonly WorksheetCollection mWorksheets;
    public MyFormulaChangeMonitor(WorksheetCollection worksheets)
    {
        mWorksheets = worksheets;
    }
    public override void OnCellFormulaChanged(int sheetIndex, int rowIndex, int columnIndex)
    {
        Console.WriteLine("Формула ячейки " + mWorksheets[sheetIndex].Name + "!"
            + CellsHelper.CellIndexToName(rowIndex, columnIndex)
            + " была изменена во время вставки строк.");
    }
}

Замечания

Например, при удалении/вставке диапазона ячеек, формулы других ячеек могут измениться из-за сдвига ссылок.

Конструкторы

AbstractFormulaChangeMonitor()

protected AbstractFormulaChangeMonitor()

Методы

OnCellFormulaChanged(int, int, int)

Событие, которое будет вызвано, когда формула в ячейке изменяется.

public virtual void OnCellFormulaChanged(int sheetIndex, int rowIndex, int columnIndex)

Параметры

sheetIndex int

Индекс листа измененной ячейки

rowIndex int

Индекс строки измененной ячейки

columnIndex int

Индекс столбца измененной ячейки

 Русский