using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;

namespace FormulaEditor
{
    /// <summary>
    /// Math fraction symbol
    /// </summary>
    [Serializable()]
    public class FractionSymbol : BracketsSymbol
    {

        /// <summary>
        /// Constructor
        /// </summary>
        public FractionSymbol()
        {
            type = (byte)2;
            s = "F";
            symbol = (char)'F';
        }

        public FractionSymbol(FractionSymbol s)
            : this()
        {
        }

        public FractionSymbol(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
        }

        /// <summary>
        /// Sets itself to formula
        /// </summary>
        /// <param name="formula">The formula to set</param>
        public override void SetToFormula(MathFormula formula)
        {
            base.SetToFormula(formula);
            for (int i = 0; i < 2; i++)
            {
                children.Add(new MathFormula((byte)level, sizes));
            }
            //childPositions = new Point[]{new Point(), new Point()};
        }

        /// <summary>
        /// Clones itself
        /// </summary>
        /// <returns>The clone object</returns>
        public override object Clone()
        {
            return new FractionSymbol();
        }

    }
}
