Insert()

MathBlock::Insert(int32_t, System::SharedPtr<IMathElement>) method

Inserts a MathElement into the collection at the specified index.

void Aspose::Slides::MathText::MathBlock::Insert(int32_t index, System::SharedPtr<IMathElement> item) override

Arguments

ParameterTypeDescription
indexint32_tThe zero-based index at which MathElement should be inserted.
itemSystem::SharedPtr<IMathElement>The MathElement to insert.

Remarks

Example:

auto mathBlock = System::MakeObject<MathBlock>(System::MakeObject<MathematicalText>(u"x"));
auto plusElement = System::MakeObject<MathematicalText>(u"+");
mathBlock->Add(plusElement);
mathBlock->Insert(0, System::MakeObject<MathRadical>(System::MakeObject<MathematicalText>(u"x"), System::MakeObject<MathematicalText>(u"3")));

See Also