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)

하나의 셀 계산 후 비즈니스를 수행하기 위해 이 메서드를 구현합니다.

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

매개변수

sheetIndex int

셀에 속한 시트의 인덱스입니다.

rowIndex int

셀의 행 인덱스입니다.

colIndex int

셀의 열 인덱스입니다.

BeforeCalculate(int, int, int)

하나의 셀을 계산하기 전에 비즈니스를 수행하기 위해 이 메서드를 구현합니다.

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로 설정합니다.

비고

구현 시 사용자는 계산 결과로 예상 값을 부분/전체적으로 설정할 수 있으므로 수식 엔진이 재귀적으로 계산하지 않도록 할 수 있습니다.

 한국어