Esempio n. 1
0
        public override string Output(Runtime.OutputType type)
        {
            switch (type)
            {
            case FuncCalc.Runtime.OutputType.String:
                return(this.ToString());

            case FuncCalc.Runtime.OutputType.Mathjax: {
                StringBuilder sb = new StringBuilder();
                if (this.Variable != null)
                {
                    sb.Append(this.Variable.ToString());
                    sb.Append("=");
                }
                sb.Append("\\{");
                for (int i = 0; i < this.items.Count; i++)
                {
                    if (i != 0)
                    {
                        sb.Append(", ");
                    }
                    sb.Append("{");
                    sb.Append(this.items[i].Output(type));
                    sb.Append("}");
                }
                sb.Append("\\}");
                return(sb.ToString());
            }

            default:
                throw new NotImplementedException();
            }
        }
Esempio n. 2
0
        public override string Output(Runtime.OutputType type)
        {
            if (type == OutputType.String)
            {
                return(this.ToString());
            }

            return(base.Output(type));
        }
Esempio n. 3
0
 public override string Output(Runtime.OutputType type)
 {
     return("π");
 }