MathPortion

MathPortion class

Represents a portion with mathematical context inside.

public sealed class MathPortion : Portion, IMathPortion

Constructors

NameDescription
MathPortion()Initializes a new instance of the MathPortion class.

Properties

NameDescription
Field { get; }Returns a field of this portion. Read-only IField.
MathParagraph { get; }Math paragraph
PortionFormat { get; }Returns oformatting bject which contains explicitly set formatting properties of the text portion with no inheritance applied. Read-only IPortionFormat.
Text { get; set; }Gets or sets the plain text of a portion. Read/write String.

Methods

NameDescription
AddField(IFieldType)Converts this portion to the automaticaly updated field.
AddField(string)Converts this portion to the automaticaly updated field.
GetCoordinates()Get coordinates of the beginning of the portion. The X coordinate of point represents the portion beginning from the first character including left side bearing. The Y coordinate includes top side bearing.
GetRect()Get coordinates of rect that bounds portion. The rect includes all the lines of text in portion, including empty ones.
RemoveField()Converts this field portion to the simple portion.

Examples

Example:

[C#]
using (Presentation pres = new Presentation())
{
    IAutoShape shape = pres.Slides[0].Shapes.AddMathShape(0, 0, 300, 50);
    IParagraph paragraph = shape.TextFrame.Paragraphs[0];
    MathPortion mathPortion = new MathPortion();
    paragraph.Portions.Add(mathPortion);
}

See Also