Class OdfMathBuilder
Composes MathML token trees with nested delegates. 提供以巢狀委派組合 MathML token 樹狀結構的 Fluent API。
public sealed class OdfMathBuilder
- Inheritance
-
OdfMathBuilder
- Inherited Members
Constructors
OdfMathBuilder()
public OdfMathBuilder()
Methods
Accent(Action<OdfMathBuilder>, Action<OdfMathBuilder>)
Appends an accent marker, modeled as an overscript marker with accent="true".
附加重音標記(語意上的上方標記,序列化為 mover 並設定 accent="true",
用於向量符號、變音符號等裝飾性記號,與一般 Over(Action<OdfMathBuilder>, Action<OdfMathBuilder>) 的極限記號語意有別)。
public OdfMathBuilder Accent(Action<OdfMathBuilder> baseExpr, Action<OdfMathBuilder> accentMark)
Parameters
baseExprAction<OdfMathBuilder>The base-expression composition delegate. / 底數組合委派。
accentMarkAction<OdfMathBuilder>The accent-marker composition delegate. / 重音標記組合委派。
Returns
- OdfMathBuilder
The current builder instance. / 目前 builder 執行個體。
Apply(string, params Action<OdfMathBuilder>[])
Appends a Content MathML apply semantic token (basic support).
附加 Content MathML apply 語意標記(基礎支援)。
public OdfMathBuilder Apply(string operatorName, params Action<OdfMathBuilder>[] operands)
Parameters
operatorNamestringThe operator name, such as
plus,times, oreq. / 運算子名稱(例如plus、times、eq)。operandsAction<OdfMathBuilder>[]The operand composition delegates. / 運算元組合委派清單。
Returns
- OdfMathBuilder
The current builder instance. / 目前 builder 執行個體。
Exceptions
- ArgumentException
When no operands are provided. / 當未提供任何運算元時擲出。
Build()
Builds the accumulated tokens as a single token, wrapping multiple tokens in mrow.
將目前累積的 token 建立為單一 token(多個 token 會包裝為 mrow)。
public OdfMathToken Build()
Returns
- OdfMathToken
The built OdfMathToken. / 建立完成的 OdfMathToken。
Exceptions
- InvalidOperationException
When no token has been appended. / 當尚未附加任何 token 時擲出。
Fenced(Action<OdfMathBuilder>)
Short overload of Fenced that accepts inner; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 inner;其餘可選參數使用預設值並轉呼叫最長 Fenced 多載。
public OdfMathBuilder Fenced(Action<OdfMathBuilder> inner)
Parameters
innerAction<OdfMathBuilder>
Returns
Fenced(Action<OdfMathBuilder>, string)
Short overload of Fenced that accepts inner and open; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 inner 與 open;其餘可選參數使用預設值並轉呼叫最長 Fenced 多載。
public OdfMathBuilder Fenced(Action<OdfMathBuilder> inner, string open)
Parameters
innerAction<OdfMathBuilder>openstring
Returns
Fenced(Action<OdfMathBuilder>, string, string)
Appends a fenced group. 附加以括號包圍的群組。
public OdfMathBuilder Fenced(Action<OdfMathBuilder> inner, string open, string close)
Parameters
innerAction<OdfMathBuilder>The fenced-content composition delegate. / 括號內容組合委派。
openstringThe opening delimiter text; defaults to
(. / 開括號文字,預設為(。closestringThe closing delimiter text; defaults to
). / 閉括號文字,預設為)。
Returns
- OdfMathBuilder
The current builder instance. / 目前 builder 執行個體。
Fraction(Action<OdfMathBuilder>, Action<OdfMathBuilder>)
Appends a fraction (mfrac).
附加分數(mfrac)。
public OdfMathBuilder Fraction(Action<OdfMathBuilder> numerator, Action<OdfMathBuilder> denominator)
Parameters
numeratorAction<OdfMathBuilder>The numerator composition delegate. / 分子組合委派。
denominatorAction<OdfMathBuilder>The denominator composition delegate. / 分母組合委派。
Returns
- OdfMathBuilder
The current builder instance. / 目前 builder 執行個體。
Identifier(string)
Appends a MathML mi identifier.
附加 MathML mi 識別名稱。
public OdfMathBuilder Identifier(string text)
Parameters
textstringThe identifier text. / 識別名稱文字。
Returns
- OdfMathBuilder
The current builder instance. / 目前 builder 執行個體。
Matrix(params Action<OdfMathBuilder>[])
Appends a matrix (mtable).
附加矩陣(mtable)。
public OdfMathBuilder Matrix(params Action<OdfMathBuilder>[] rows)
Parameters
rowsAction<OdfMathBuilder>[]The cell composition delegates for each row. / 每一列的儲存格組合委派。
Returns
- OdfMathBuilder
The current builder instance. / 目前 builder 執行個體。
Exceptions
- ArgumentException
When no rows are provided. / 當未提供任何列時擲出。
Number(string)
Appends a MathML mn number.
附加 MathML mn 數值。
public OdfMathBuilder Number(string text)
Parameters
textstringThe number text. / 數值文字。
Returns
- OdfMathBuilder
The current builder instance. / 目前 builder 執行個體。
Operator(string)
Appends a MathML mo operator.
附加 MathML mo 運算子。
public OdfMathBuilder Operator(string text)
Parameters
textstringThe operator text. / 運算子文字。
Returns
- OdfMathBuilder
The current builder instance. / 目前 builder 執行個體。
Over(Action<OdfMathBuilder>, Action<OdfMathBuilder>)
Appends an overscript marker (mover).
附加上方標記(mover)。
public OdfMathBuilder Over(Action<OdfMathBuilder> baseExpr, Action<OdfMathBuilder> over)
Parameters
baseExprAction<OdfMathBuilder>The base-expression composition delegate. / 底數組合委派。
overAction<OdfMathBuilder>The overscript-marker composition delegate. / 上方標記組合委派。
Returns
- OdfMathBuilder
The current builder instance. / 目前 builder 執行個體。
Root(Action<OdfMathBuilder>, Action<OdfMathBuilder>)
Appends a root with an index (mroot).
附加具根指數的根號(mroot)。
public OdfMathBuilder Root(Action<OdfMathBuilder> radicand, Action<OdfMathBuilder> index)
Parameters
radicandAction<OdfMathBuilder>The radicand composition delegate. / 被開方數組合委派。
indexAction<OdfMathBuilder>The root-index composition delegate. / 根指數組合委派。
Returns
- OdfMathBuilder
The current builder instance. / 目前 builder 執行個體。
Row(Action<OdfMathBuilder>)
Appends a grouped row (mrow).
附加群組列(mrow)。
public OdfMathBuilder Row(Action<OdfMathBuilder> content)
Parameters
contentAction<OdfMathBuilder>The grouped-content composition delegate. / 群組內容組合委派。
Returns
- OdfMathBuilder
The current builder instance. / 目前 builder 執行個體。
Sqrt(Action<OdfMathBuilder>)
Appends a square root (msqrt).
附加平方根(msqrt)。
public OdfMathBuilder Sqrt(Action<OdfMathBuilder> radicand)
Parameters
radicandAction<OdfMathBuilder>The radicand composition delegate. / 被開方數組合委派。
Returns
- OdfMathBuilder
The current builder instance. / 目前 builder 執行個體。
Subscript(Action<OdfMathBuilder>, Action<OdfMathBuilder>)
Appends a subscript (msub).
附加下標(msub)。
public OdfMathBuilder Subscript(Action<OdfMathBuilder> baseExpr, Action<OdfMathBuilder> script)
Parameters
baseExprAction<OdfMathBuilder>The base-expression composition delegate. / 底數組合委派。
scriptAction<OdfMathBuilder>The subscript composition delegate. / 下標組合委派。
Returns
- OdfMathBuilder
The current builder instance. / 目前 builder 執行個體。
Superscript(Action<OdfMathBuilder>, Action<OdfMathBuilder>)
Appends a superscript (msup).
附加上標(msup)。
public OdfMathBuilder Superscript(Action<OdfMathBuilder> baseExpr, Action<OdfMathBuilder> script)
Parameters
baseExprAction<OdfMathBuilder>The base-expression composition delegate. / 底數組合委派。
scriptAction<OdfMathBuilder>The superscript composition delegate. / 上標組合委派。
Returns
- OdfMathBuilder
The current builder instance. / 目前 builder 執行個體。
Text(string)
Appends MathML mtext text.
附加 MathML mtext 文字。
public OdfMathBuilder Text(string text)
Parameters
textstringThe text content. / 文字內容。
Returns
- OdfMathBuilder
The current builder instance. / 目前 builder 執行個體。
Under(Action<OdfMathBuilder>, Action<OdfMathBuilder>)
Appends an underscript marker (munder).
附加下方標記(munder)。
public OdfMathBuilder Under(Action<OdfMathBuilder> baseExpr, Action<OdfMathBuilder> under)
Parameters
baseExprAction<OdfMathBuilder>The base-expression composition delegate. / 底數組合委派。
underAction<OdfMathBuilder>The underscript-marker composition delegate. / 下方標記組合委派。
Returns
- OdfMathBuilder
The current builder instance. / 目前 builder 執行個體。
UnderOver(Action<OdfMathBuilder>, Action<OdfMathBuilder>, Action<OdfMathBuilder>)
Appends combined under and over markers (munderover).
附加上下方標記(munderover)。
public OdfMathBuilder UnderOver(Action<OdfMathBuilder> baseExpr, Action<OdfMathBuilder> under, Action<OdfMathBuilder> over)
Parameters
baseExprAction<OdfMathBuilder>The base-expression composition delegate. / 底數組合委派。
underAction<OdfMathBuilder>The underscript-marker composition delegate. / 下方標記組合委派。
overAction<OdfMathBuilder>The overscript-marker composition delegate. / 上方標記組合委派。
Returns
- OdfMathBuilder
The current builder instance. / 目前 builder 執行個體。