Class AbstractCalculationMonitor

Class AbstractCalculationMonitor

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

ユーザーが数式計算の進行状況を追跡するためのモニター。

public abstract class AbstractCalculationMonitor

継承

objectAbstractCalculationMonitor

継承されたメンバー

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

Workbook wb = new Workbook("calc.xlsx");
CalculationOptions opts = new CalculationOptions();
opts.CalculationMonitor = new MyCalculationMonitor();
wb.CalculateFormula(opts);

class MyCalculationMonitor : AbstractCalculationMonitor
{
    public override void BeforeCalculate(int sheetIndex, int rowIndex, int colIndex)
    {
        if(sheetIndex!=0 || rowIndex!=0 || colIndex!=0)
        {
            return;
        }
        Console.WriteLine("セル A1 が計算されます。");
    }
}

コンストラクター

AbstractCalculationMonitor()

protected AbstractCalculationMonitor()

プロパティ

CalculatedValue

セルの新しく計算された値を取得します。 Aspose.Cells.AbstractCalculationMonitor.AfterCalculate(System.Int32,System.Int32,System.Int32) のみで使用する必要があります。

public object CalculatedValue { get; }

プロパティ値

object

OriginalValue

計算されたセルの古い値を取得します。 Aspose.Cells.AbstractCalculationMonitor.BeforeCalculate(System.Int32,System.Int32,System.Int32) および Aspose.Cells.AbstractCalculationMonitor.AfterCalculate(System.Int32,System.Int32,System.Int32) のみで使用する必要があります。

public object OriginalValue { get; }

プロパティ値

object

ValueChanged

計算後にセルの値が変更されたかどうかを示します。 Aspose.Cells.AbstractCalculationMonitor.AfterCalculate(System.Int32,System.Int32,System.Int32) のみで使用する必要があります。

public bool ValueChanged { get; }

プロパティ値

bool

メソッド

AfterCalculate(int, int, int)

1つのセルが計算された後にビジネスロジックを実行するためにこのメソッドを実装します。

public virtual void AfterCalculate(int sheetIndex, int rowIndex, int colIndex)

パラメーター

sheetIndex int

セルが属するシートのインデックス。

rowIndex int

セルの行インデックス。

colIndex int

セルの列インデックス。

BeforeCalculate(int, int, int)

1つのセルを計算する前にビジネスロジックを実行するためにこのメソッドを実装します。

public virtual void BeforeCalculate(int sheetIndex, int rowIndex, int colIndex)

パラメーター

sheetIndex int

セルが属するシートのインデックス。

rowIndex int

セルの行インデックス。

colIndex int

セルの列インデックス。

Interrupt(string)

protected void Interrupt(string msg)

パラメーター

msg string

OnCircular(IEnumerator)

循環参照を持つ数式を計算する際にビジネスロジックを実行するためにこのメソッドを実装します。

public virtual bool OnCircular(IEnumerator circularCellsData)

パラメーター

circularCellsData IEnumerator

循環参照に依存するセルを表す Aspose.Cells.CalculationCell アイテムを持つ IEnumerator。

戻り値

bool

この呼び出しの後、数式エンジンが循環しているセルを計算する必要があるかどうか。 計算を続けるためには True を返します。 セルを単に計算済みとしてマークするためには False を返します。

備考

実装内で、ユーザーは期待される値を計算結果として設定することもできるため、数式エンジンはそれらを再帰的に計算しないようにします。

 日本語