Contains

MathParagraph.Contains method

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

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

返回值

如果在集合中找到mathBlock则为真;否则为假。

例子

示例:

[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);

也可以看看