Remove
IMathElementCollection.Remove 方法
从集合中移除特定对象的第一次出现。
public bool Remove(IMathElement item)
参数 | 类型 | 描述 |
---|---|---|
item | IMathElement | 要从集合中移除的对象。 |
返回值
如果 item 成功从集合中移除,则返回 true;否则返回 false。如果 item 在原始集合中未找到,则此方法也会返回 false。
示例
示例:
[C#]
IMathElementCollection collection = new MathBlock(new MathematicalText("x"));
MathematicalText plusElement = new MathematicalText("+");
collection.Add(plusElement);
collection.Add(new MathRadical(new MathematicalText("x"), new MathematicalText("3")));
collection.Remove(plusElement);