Exemplo n.º 1
0
 /// <summary>
 /// Obtém um objecto que resulta da conversão da instância corrente.
 /// </summary>
 /// <param name="mathematicsType">O tipo de objecto no qual se pretende converter.</param>
 /// <returns>
 /// O objecto convertido.
 /// </returns>
 /// <exception cref="ExpressionInterpreterException">Se a conversão não for possível.</exception>
 public override AMathematicsObject ConvertTo(EMathematicsType mathematicsType)
 {
     if (!mathematicsType.Equals(this.mathematicsType))
     {
         throw new ExpressionInterpreterException(string.Format("Can't convert from type {0} to type {1}.", this.mathematicsType, mathematicsType));
     }
     else
     {
         return(this);
     }
 }