Contains

MathParagraph.Contains 方法

确定集合是否包含特定值。

public bool Contains(IMathBlock mathBlock)
参数类型描述
mathBlockIMathBlock要在集合中定位的对象。

返回值

如果 mathBlock 在集合中找到,则为 true;否则为 false。

示例

示例:

[C#]
IAutoShape shape = slide.Shapes.AddMathShape(x, y, width, height);
IMathParagraph mathParagraph = (shape.TextFrame.Paragraphs[0].Portions[0] as MathPortion).MathParagraph;
IMathBlock block = new MathBlock(new MathematicalText("y"));
mathParagraph.Add(block);
bool contains = mathParagraph.Contains(block);

另见