/// <summary> /// Appends the symbol to formula /// </summary> /// <param name="formula">Formula the formula to append</param> /// <returns>Next inserted object</returns> public MathFormula Append(MathFormula formula) { try { MathSymbol symbol = (MathSymbol)Clone(); symbol.SetToFormula(formula); formula.Add(symbol); symbol.parent = formula; } finally { } return(formula); }
/// <summary> /// Inserts symbol /// </summary> /// <param name="formula">The formula to insert</param> /// <param name="previosSymbol">The previos symbol</param> /// <returns>Inserted object</returns> public object InsertBefore(MathFormula formula, MathSymbol previosSymbol) { try { MathSymbol symbol = (MathSymbol)Clone(); symbol.SetToFormula(formula); int n = formula.IndexOf(previosSymbol); formula.Insert(n, symbol); symbol.parent = formula; if (symbol is BracketsSymbol) { return(symbol[0]); } return(symbol.NextObject); } finally { } }