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)
            + "'s สูตรถูกเปลี่ยนขณะทำการแทรกแถว.");
    }
}

หมายเหตุ

ตัวอย่างเช่น ขณะลบ/แทรกช่วงของเซลล์, สูตรของเซลล์อื่นอาจถูกเปลี่ยนแปลงเนื่องจากการเลื่อนของการอ้างอิง

ตัวสร้าง

AbstractFormulaChangeMonitor()

protected AbstractFormulaChangeMonitor()

วิธีการ

OnCellFormulaChanged(int, int, int)

เหตุการณ์ที่จะเกิดขึ้นเมื่อสูตรในเซลล์ถูกเปลี่ยนแปลง

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

พารามิเตอร์

sheetIndex int

ดัชนีแผ่นงานของเซลล์ที่ถูกเปลี่ยนแปลง

rowIndex int

ดัชนีแถวของเซลล์ที่ถูกเปลี่ยนแปลง

columnIndex int

ดัชนีคอลัมน์ของเซลล์ที่ถูกเปลี่ยนแปลง

 แบบไทย