コード例 #1
0
ファイル: Results.cs プロジェクト: takku205/FuncCalc
        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();
            }
        }
コード例 #2
0
ファイル: Array.cs プロジェクト: takku205/FuncCalc
        public override string Output(Runtime.OutputType type)
        {
            if (type == OutputType.String)
            {
                return(this.ToString());
            }

            return(base.Output(type));
        }
コード例 #3
0
ファイル: Pi.cs プロジェクト: takku205/FuncCalc
 public override string Output(Runtime.OutputType type)
 {
     return("π");
 }