Table of Contents

Struct OdfSpreadsheetFormula

Namespace
OdfKit.Spreadsheet
Assembly
OdfKit.dll

Represents an OpenFormula fragment that can be converted to a table:formula attribute. 表示可轉成 table:formula 屬性的 OpenFormula 公式片段。

public readonly struct OdfSpreadsheetFormula : IEquatable<OdfSpreadsheetFormula>
Implements
Inherited Members

Properties

Body

Gets the formula body without the of:= prefix. 取得不含 of:= 前綴的公式主體。

public string Body { get; }

Property Value

string

Methods

Add(OdfSpreadsheetFormula)

Creates an addition formula. 建立加法公式。

public OdfSpreadsheetFormula Add(OdfSpreadsheetFormula right)

Parameters

right OdfSpreadsheetFormula

The right operand. / 右側運算元。

Returns

OdfSpreadsheetFormula

The formula fragment. / 公式片段。

Add(double)

Creates an addition formula. 建立加法公式。

public OdfSpreadsheetFormula Add(double right)

Parameters

right double

The right numeric value. / 右側數值。

Returns

OdfSpreadsheetFormula

The formula fragment. / 公式片段。

Atom(string)

Creates an atomic formula fragment. 建立原子公式片段。

public static OdfSpreadsheetFormula Atom(string body)

Parameters

body string

The formula body. / 公式主體。

Returns

OdfSpreadsheetFormula

The formula fragment. / 公式片段。

Divide(OdfSpreadsheetFormula)

Creates a division formula. 建立除法公式。

public OdfSpreadsheetFormula Divide(OdfSpreadsheetFormula right)

Parameters

right OdfSpreadsheetFormula

The right operand. / 右側運算元。

Returns

OdfSpreadsheetFormula

The formula fragment. / 公式片段。

Equals(OdfSpreadsheetFormula)

Determines whether the current formula equals another formula. 判斷目前公式是否等於另一個公式。

public bool Equals(OdfSpreadsheetFormula other)

Parameters

other OdfSpreadsheetFormula

The other formula. / 另一個公式。

Returns

bool

true if the formula bodies are the same. / 若公式主體相同則為 true

Equals(object?)

Performs equals. 執行 Equals。

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

Gets hash code. 取得 Hash Code。

public override int GetHashCode()

Returns

int

Multiply(OdfSpreadsheetFormula)

Creates a multiplication formula. 建立乘法公式。

public OdfSpreadsheetFormula Multiply(OdfSpreadsheetFormula right)

Parameters

right OdfSpreadsheetFormula

The right operand. / 右側運算元。

Returns

OdfSpreadsheetFormula

The formula fragment. / 公式片段。

Multiply(double)

Creates a multiplication formula. 建立乘法公式。

public OdfSpreadsheetFormula Multiply(double right)

Parameters

right double

The right numeric value. / 右側數值。

Returns

OdfSpreadsheetFormula

The formula fragment. / 公式片段。

Raw(string)

Creates a raw formula fragment and removes an optional of:= prefix. 建立原始公式片段,會移除選用的 of:= 前綴。

public static OdfSpreadsheetFormula Raw(string body)

Parameters

body string

The formula body. / 公式主體。

Returns

OdfSpreadsheetFormula

The formula fragment. / 公式片段。

Reference(string)

Creates a cell or range reference. 建立儲存格或範圍參照。

public static OdfSpreadsheetFormula Reference(string address)

Parameters

address string

The cell or range address. / 儲存格或範圍位址。

Returns

OdfSpreadsheetFormula

The formula fragment. / 公式片段。

Subtract(OdfSpreadsheetFormula)

Creates a subtraction formula. 建立減法公式。

public OdfSpreadsheetFormula Subtract(OdfSpreadsheetFormula right)

Parameters

right OdfSpreadsheetFormula

The right operand. / 右側運算元。

Returns

OdfSpreadsheetFormula

The formula fragment. / 公式片段。

ToString()

Returns the formula string with the of:= prefix. 傳回包含 of:= 前綴的公式字串。

public override string ToString()

Returns

string

The formula that can be written directly to table:formula. / 可直接寫入 table:formula 的公式。

Operators

operator ==(OdfSpreadsheetFormula, OdfSpreadsheetFormula)

Determines whether two formulas are equal. 判斷兩個公式是否相等。

public static bool operator ==(OdfSpreadsheetFormula left, OdfSpreadsheetFormula right)

Parameters

left OdfSpreadsheetFormula

The left formula. / 左側公式。

right OdfSpreadsheetFormula

The right formula. / 右側公式。

Returns

bool

true if both formulas are equal. / 若兩者相等則為 true

implicit operator string(OdfSpreadsheetFormula)

Implicitly converts a formula fragment to a table:formula string. 將公式片段隱式轉換成 table:formula 字串。

public static implicit operator string(OdfSpreadsheetFormula formula)

Parameters

formula OdfSpreadsheetFormula

The formula fragment. / 公式片段。

Returns

string

operator !=(OdfSpreadsheetFormula, OdfSpreadsheetFormula)

Determines whether two formulas are not equal. 判斷兩個公式是否不相等。

public static bool operator !=(OdfSpreadsheetFormula left, OdfSpreadsheetFormula right)

Parameters

left OdfSpreadsheetFormula

The left formula. / 左側公式。

right OdfSpreadsheetFormula

The right formula. / 右側公式。

Returns

bool

true if both formulas are not equal. / 若兩者不相等則為 true