Class AbstractFormulaChangeMonitor
Class AbstractFormulaChangeMonitor
Namespace: Aspose.Cells
Assembly: Aspose.Cells.dll (25.2.0)
ユーザーが特定の操作中に数式の変更を追跡できるように監視します。
public abstract class AbstractFormulaChangeMonitor
継承
object ← AbstractFormulaChangeMonitor
継承されたメンバー
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
変更されたセルの列インデックス