当前位置: 首页>>代码示例>>C#>>正文


C# ScriptEngine.Pad方法代码示例

本文整理汇总了C#中ScriptEngine.Pad方法的典型用法代码示例。如果您正苦于以下问题:C# ScriptEngine.Pad方法的具体用法?C# ScriptEngine.Pad怎么用?C# ScriptEngine.Pad使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ScriptEngine的用法示例。


在下文中一共展示了ScriptEngine.Pad方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ToString

 public override string ToString(ScriptEngine engine)
 {
     string msg = engine.Pad() + "Return" + Environment.NewLine;
     engine.IndentationLevel += ScriptEngine.PaddingIncrement;
     msg += engine.Pad() + "LHS:" + Environment.NewLine;
     {
         engine.IndentationLevel += ScriptEngine.PaddingIncrement;
         for (int i = 0; i < _lhs.Count; i++)
         {
             msg += _lhs[i].ToString(engine);
         }
         engine.IndentationLevel -= ScriptEngine.PaddingIncrement;
     }
     msg += engine.Pad() + "RHS:" + Environment.NewLine;
     {
         engine.IndentationLevel += ScriptEngine.PaddingIncrement;
         for (int i = 0; i < _rhs.Count; i++)
         {
             msg += _rhs[i].ToString(engine);
         }
         engine.IndentationLevel -= ScriptEngine.PaddingIncrement;
     }
     engine.IndentationLevel -= ScriptEngine.PaddingIncrement;
     return msg;
 }
开发者ID:iammitch,项目名称:Slimterpreter,代码行数:25,代码来源:EqualsToken.cs

示例2: ToString

        public override string ToString(ScriptEngine engine)
        {
            string msg = engine.Pad() + "MathToken (" + _type.ToString() + ")";
            msg += Environment.NewLine;

            engine.IndentationLevel += ScriptEngine.PaddingIncrement;
            {
                msg += engine.Pad() + "LHS";
                msg += Environment.NewLine;
                engine.IndentationLevel += ScriptEngine.PaddingIncrement;
                {
                    for (int i = 0; i < _lhs.Count; i++)
                    {
                        msg += _lhs[i].ToString(engine);
                    }

                    msg += Environment.NewLine;
                }
                engine.IndentationLevel -= ScriptEngine.PaddingIncrement;

                msg += engine.Pad() + "RHS";
                msg += Environment.NewLine;

                engine.IndentationLevel += ScriptEngine.PaddingIncrement;
                {
                    for (int i = 0; i < _rhs.Count; i++)
                    {
                        msg += _rhs[i].ToString(engine);
                    }
                }
                engine.IndentationLevel -= ScriptEngine.PaddingIncrement;
            }
            engine.IndentationLevel -= ScriptEngine.PaddingIncrement;
            return msg;
        }
开发者ID:iammitch,项目名称:Slimterpreter,代码行数:35,代码来源:MathToken.cs

示例3: ToString

        public override string ToString(ScriptEngine engine)
        {
            string msg = engine.Pad() + "ForLoopToken";
            msg += Environment.NewLine;

            engine.IndentationLevel += ScriptEngine.PaddingIncrement;
            {
                msg += engine.Pad() + "-Init";
                msg += Environment.NewLine;
                engine.IndentationLevel += ScriptEngine.PaddingIncrement;
                {
                    for (int i = 0; i < _loopInit.Count; i++)
                    {
                        msg += engine.Pad() + "Chunk #" + (i + 1).ToString();
                        msg += Environment.NewLine;
                        engine.IndentationLevel += ScriptEngine.PaddingIncrement;
                        for (int j = 0; j < _loopInit[i].Count; j++)
                        {
                            msg += _loopInit[i][j].ToString(engine);
                            msg += Environment.NewLine;
                        }
                        engine.IndentationLevel -= ScriptEngine.PaddingIncrement;
                    }
                }
                engine.IndentationLevel -= ScriptEngine.PaddingIncrement;

                msg += engine.Pad() + "-Condition Check";
                msg += Environment.NewLine;
                engine.IndentationLevel += ScriptEngine.PaddingIncrement;
                {
                    for (int i = 0; i < _exitCondition.Count; i++)
                    {
                        msg += engine.Pad() + "Chunk #" + (i + 1).ToString();
                        msg += Environment.NewLine;
                        engine.IndentationLevel += ScriptEngine.PaddingIncrement;
                        for (int j = 0; j < _exitCondition[i].Count; j++)
                        {
                            msg += _exitCondition[i][j].ToString(engine);
                            msg += Environment.NewLine;
                        }
                        engine.IndentationLevel -= ScriptEngine.PaddingIncrement;
                    }
                }
                engine.IndentationLevel -= ScriptEngine.PaddingIncrement;

                msg += engine.Pad() + "-Increment";
                msg += Environment.NewLine;
                engine.IndentationLevel += ScriptEngine.PaddingIncrement;
                {
                    for (int i = 0; i < _iterator.Count; i++)
                    {
                        msg += engine.Pad() + "Chunk #" + (i + 1).ToString();
                        msg += Environment.NewLine;
                        engine.IndentationLevel += ScriptEngine.PaddingIncrement;
                        for (int j = 0; j < _iterator[i].Count; j++)
                        {
                            msg += _iterator[i][j].ToString(engine);
                            msg += Environment.NewLine;
                        }
                        engine.IndentationLevel -= ScriptEngine.PaddingIncrement;
                    }
                }
                engine.IndentationLevel -= ScriptEngine.PaddingIncrement;

                msg += engine.Pad() + "-Code";
                msg += Environment.NewLine;
                engine.IndentationLevel += ScriptEngine.PaddingIncrement;
                for (int i = 0; i < _code.Count; i++)
                {
                    msg += engine.Pad() + "Line #" + (i + 1).ToString();
                    msg += Environment.NewLine;
                    engine.IndentationLevel += ScriptEngine.PaddingIncrement;
                    for (int j = 0; j < _code[i].Count; j++)
                    {
                        msg += engine.Pad() + "Chunk #" + (j + 1).ToString();
                        msg += Environment.NewLine;
                        engine.IndentationLevel += ScriptEngine.PaddingIncrement;
                        for (int k = 0; k < _code[i][j].Count; k++)
                        {
                            msg += _code[i][j][k].ToString(engine);
                            msg += Environment.NewLine;
                        }
                        engine.IndentationLevel -= ScriptEngine.PaddingIncrement;
                    }
                    engine.IndentationLevel -= ScriptEngine.PaddingIncrement;
                }
                engine.IndentationLevel -= ScriptEngine.PaddingIncrement;
            }
            engine.IndentationLevel -= ScriptEngine.PaddingIncrement;

            return msg;
        }
开发者ID:iammitch,项目名称:Slimterpreter,代码行数:92,代码来源:ForLoopToken.cs


注:本文中的ScriptEngine.Pad方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。