Class MathMatrix
Represents a matrix element — a grid of rows and columns of math elements.
Maps to the OMML m:m element, with each row mapping to
m:mr and each cell to m:e.
Implements
Inherited Members
Namespace: DRIT.Presentation.Drawing.Mathematics
Assembly: DRIT.Presentation.dll
Syntax
public sealed class MathMatrix : MathElementBase, IMathElement, IList<MathMatrixRow>, ICollection<MathMatrixRow>, IEnumerable<MathMatrixRow>, IEnumerable
Constructors
MathMatrix()
Initializes a new instance of the math matrix class.
Declaration
public MathMatrix()
MathMatrix(int, int)
Initializes a new instance of the math matrix class.
Declaration
public MathMatrix(int rows, int columns)
Parameters
| Type | Name | Description |
|---|---|---|
| int | rows | The rows supplied to this operation. |
| int | columns | The columns supplied to this operation. |
Properties
ColumnCount
Gets the number of columns (the maximum cell count across all rows).
Declaration
public int ColumnCount { get; }
Property Value
| Type | Description |
|---|---|
| int |
Count
Gets the number of rows in the matrix.
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| int |
IsReadOnly
Gets or sets whether is read only is enabled.
Declaration
public bool IsReadOnly { get; }
Property Value
| Type | Description |
|---|---|
| bool |
this[int]
Gets or sets the row at the specified index.
Declaration
public MathMatrixRow this[int index] { get; set; }
Parameters
| Type | Name | Description |
|---|---|---|
| int | index |
Property Value
| Type | Description |
|---|---|
| MathMatrixRow |
RowCount
Gets the number of rows in the matrix.
Declaration
public int RowCount { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
Add(MathMatrixRow)
Adds the specified row to the matrix.
Declaration
public void Add(MathMatrixRow item)
Parameters
| Type | Name | Description |
|---|---|---|
| MathMatrixRow | item |
AddRow()
Creates and adds a new empty row to the matrix.
Declaration
public MathMatrixRow AddRow()
Returns
| Type | Description |
|---|---|
| MathMatrixRow | The newly created row. |
AddRow(IEnumerable<IMathElement>)
Creates and adds a new row with the specified cell elements.
Declaration
public MathMatrixRow AddRow(IEnumerable<IMathElement> elements)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<IMathElement> | elements |
Returns
| Type | Description |
|---|---|
| MathMatrixRow |
Clear()
Removes all entries from this math matrix.
Declaration
public void Clear()
Contains(MathMatrixRow)
Determines whether this math matrix contains the specified item.
Declaration
public bool Contains(MathMatrixRow item)
Parameters
| Type | Name | Description |
|---|---|---|
| MathMatrixRow | item | The item to add, remove, or inspect. |
Returns
| Type | Description |
|---|---|
| bool | true if the operation succeeds; otherwise, false. |
CopyTo(MathMatrixRow[], int)
Copies the collection items to the supplied destination array.
Declaration
public void CopyTo(MathMatrixRow[] array, int arrayIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| MathMatrixRow[] | array | The destination array that receives the copied items. |
| int | arrayIndex |
GetEnumerator()
Returns an enumerator that iterates through this collection.
Declaration
public IEnumerator<MathMatrixRow> GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator<MathMatrixRow> | An enumerator that iterates through this collection. |
IndexOf(MathMatrixRow)
Returns the zero-based index of the specified item.
Declaration
public int IndexOf(MathMatrixRow item)
Parameters
| Type | Name | Description |
|---|---|---|
| MathMatrixRow | item | The item to add, remove, or inspect. |
Returns
| Type | Description |
|---|---|
| int | The index of value produced by the operation. |
Insert(int, MathMatrixRow)
Inserts a row at the specified index.
Declaration
public void Insert(int index, MathMatrixRow item)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | |
| MathMatrixRow | item |
Remove(MathMatrixRow)
Removes the value from this math matrix.
Declaration
public bool Remove(MathMatrixRow item)
Parameters
| Type | Name | Description |
|---|---|---|
| MathMatrixRow | item | The item to add, remove, or inspect. |
Returns
| Type | Description |
|---|---|
| bool | true if the operation succeeds; otherwise, false. |
RemoveAt(int)
Removes the item at the specified zero-based index.
Declaration
public void RemoveAt(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | The zero-based index of the item. |