IndexOf

MathBlock.IndexOf method

Détermine l’index d’un élément mathématique spécifique dans la collection.

public int IndexOf(IMathElement item)
ParamètreTaperLa description
itemIMathElementL’élément à localiser dans la collection.

Return_Value

L’indice deitem s’il se trouve dans la collection ; sinon, -1.

Exemples

Exemple :

[C#]
MathBlock mathBlock = new MathBlock(new MathematicalText("x"));
MathematicalText plusElement = new MathematicalText("+");
mathBlock.Add(plusElement);
mathBlock.Add(new MathRadical(new MathematicalText("x"), new MathematicalText("3")));
int index = mathBlock.IndexOf(plusElement);

Voir également