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


C# IFormatter.WriteLine方法代码示例

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


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

示例1: WriteQueryContinuation

 private void WriteQueryContinuation(IQueryContinuation value, IFormatter formatter)
 {
     formatter.WriteKeyword("into");
     formatter.Write(" ");
     this.WriteDeclaration(value.Variable.Name, formatter);
     formatter.WriteLine();
     this.WriteQueryBody(value.Body, formatter);
 }
开发者ID:jorik041,项目名称:JavaScriptLanguage,代码行数:8,代码来源:JavaScriptLanguage.cs

示例2: WriteQueryExpression

            private void WriteQueryExpression(IQueryExpression value, IFormatter formatter)
            {
                formatter.Write("(");

                this.WriteFromClause(value.From, formatter);

                if ((value.Body.Clauses.Count > 0) || (value.Body.Continuation != null))
                {
                    formatter.WriteLine();
                    formatter.WriteIndent();
                }
                else
                {
                    formatter.Write(" ");
                }

                this.WriteQueryBody(value.Body, formatter);

                formatter.Write(")");

                if ((value.Body.Clauses.Count > 0) || (value.Body.Continuation != null))
                {
                    formatter.WriteOutdent();
                }
            }
开发者ID:jorik041,项目名称:JavaScriptLanguage,代码行数:25,代码来源:JavaScriptLanguage.cs

示例3: WriteBlockExpression

            private void WriteBlockExpression(IBlockExpression expression, IFormatter formatter)
            {
                formatter.Write("[");

                if (expression.Expressions.Count > 16)
                {
                    formatter.WriteLine();
                    formatter.WriteIndent();
                }

                for (int i = 0; i < expression.Expressions.Count; i++)
                {
                    if (i != 0)
                    {
                        formatter.Write(", ");

                        if ((i % 16) == 0)
                        {
                            formatter.WriteLine();
                        }
                    }

                    this.WriteExpression(expression.Expressions[i], formatter);
                }

                if (expression.Expressions.Count > 16)
                {
                    formatter.WriteOutdent();
                    formatter.WriteLine();
                }

                formatter.Write("]");
            }
开发者ID:jorik041,项目名称:JavaScriptLanguage,代码行数:33,代码来源:JavaScriptLanguage.cs

示例4: WriteQueryBody

            private void WriteQueryBody(IQueryBody value, IFormatter formatter)
            {
                // from | where | let | join | orderby
                for (int i = 0; i < value.Clauses.Count; i++)
                {
                    this.WriteQueryClause(value.Clauses[i], formatter);
                    formatter.WriteLine();
                }

                // select | group
                this.WriteQueryOperation(value.Operation, formatter);

                // into
                if (value.Continuation != null)
                {
                    formatter.Write(" ");
                    this.WriteQueryContinuation(value.Continuation, formatter);
                }
            }
开发者ID:jorik041,项目名称:JavaScriptLanguage,代码行数:19,代码来源:JavaScriptLanguage.cs

示例5: WriteTryCatchFinallyStatement

            private void WriteTryCatchFinallyStatement(ITryCatchFinallyStatement statement, IFormatter formatter)
            {
                this.WriteStatementSeparator(formatter);

                formatter.WriteKeyword("try");
                formatter.Write(" {");
                formatter.WriteLine();
                formatter.WriteIndent();

                if (statement.Try != null)
                {
                    this.WriteStatement(statement.Try, formatter);
                    this.WritePendingOutdent(formatter);
                }
                else
                {
                    formatter.WriteLine();
                }
                formatter.WriteOutdent();
                formatter.Write("}");

                this.firstStmt = true;
                foreach (ICatchClause catchClause in statement.CatchClauses)
                {
                    formatter.WriteLine();
                    formatter.WriteKeyword("catch");
                    formatter.Write(" (");
                    formatter.WriteDeclaration(catchClause.Variable.Name);
                    formatter.Write(")");
                    formatter.Write(" {");
                    formatter.WriteLine();
                    formatter.WriteIndent();

                    if (catchClause.Condition != null)
                    {
                        formatter.Write(" ");
                        formatter.WriteKeyword("if");
                        formatter.Write(" ");
                        this.WriteExpression(catchClause.Condition, formatter);
                        formatter.Write(" ");
                        formatter.WriteKeyword("then");
                    }

                    if (catchClause.Body != null)
                    {
                        this.WriteStatement(catchClause.Body, formatter);
                    }
                    else
                    {
                        formatter.WriteLine();
                    }

                    formatter.WriteOutdent();
                    formatter.Write("}");
                }

                if ((statement.Finally != null) && (statement.Finally.Statements.Count > 0))
                {
                    formatter.WriteLine();
                    formatter.WriteKeyword("finally");
                    formatter.Write(" {");
                    formatter.WriteLine();
                    formatter.WriteIndent();
                    if (statement.Finally != null)
                    {
                        this.WriteStatement(statement.Finally, formatter);
                        this.WritePendingOutdent(formatter);
                    }
                    else
                    {
                        formatter.WriteLine();
                    }
                    formatter.WriteOutdent();
                    formatter.Write("}");
                }
            }
开发者ID:jorik041,项目名称:JavaScriptLanguage,代码行数:76,代码来源:JavaScriptLanguage.cs

示例6: WriteVariableDeclaration

            private void WriteVariableDeclaration(IVariableDeclaration variableDeclaration, IFormatter formatter)
            {
                formatter.WriteKeyword("var ");
                this.WriteDeclaration(variableDeclaration.Name, formatter); // TODO Escape = true

                if (!this.forLoop)
                {
                    formatter.Write(";");
                    formatter.WriteLine();
                }
            }
开发者ID:jorik041,项目名称:JavaScriptLanguage,代码行数:11,代码来源:JavaScriptLanguage.cs

示例7: WriteFixedStatement

            private void WriteFixedStatement(IFixedStatement statement, IFormatter formatter)
            {
                this.WriteStatementSeparator(formatter);

                formatter.WriteKeyword("fixed");
                formatter.Write(" ");
                formatter.Write("(");
                this.WriteVariableDeclaration(statement.Variable, formatter);
                formatter.Write(" ");
                formatter.WriteKeyword("=");
                formatter.Write(" ");
                this.WriteExpression(statement.Expression, formatter);
                formatter.Write(")");

                formatter.WriteLine();
                formatter.WriteKeyword("begin");
                formatter.WriteLine();
                formatter.WriteIndent();

                if (statement.Body != null)
                {
                    this.WriteBlockStatement(statement.Body, formatter);
                }

                formatter.WriteOutdent();
                formatter.WriteKeyword("end ");
            }
开发者ID:jorik041,项目名称:JavaScriptLanguage,代码行数:27,代码来源:JavaScriptLanguage.cs

示例8: WriteSwitchCaseCondition

 private void WriteSwitchCaseCondition(IExpression condition, IFormatter formatter)
 {
     IBinaryExpression binaryExpression = condition as IBinaryExpression;
     if ((binaryExpression != null) && (binaryExpression.Operator == BinaryOperator.BooleanOr))
     {
         this.WriteSwitchCaseCondition(binaryExpression.Left, formatter);
         this.WriteSwitchCaseCondition(binaryExpression.Right, formatter);
     }
     else
     {
         formatter.WriteKeyword("case ");
         this.WriteExpression(condition, formatter);
         formatter.Write(":");
         formatter.WriteLine();
     }
 }
开发者ID:jorik041,项目名称:JavaScriptLanguage,代码行数:16,代码来源:JavaScriptLanguage.cs

示例9: WriteContinueStatement

 private void WriteContinueStatement(IContinueStatement statement, IFormatter formatter)
 {
     this.WriteStatementSeparator(formatter);
     formatter.WriteKeyword("continue");
     formatter.Write(";");
     formatter.WriteLine();
 }
开发者ID:jorik041,项目名称:JavaScriptLanguage,代码行数:7,代码来源:JavaScriptLanguage.cs

示例10: WriteCustomAttributeList

            private void WriteCustomAttributeList(ICustomAttributeProvider provider, IFormatter formatter)
            {
                ArrayList attributes = new ArrayList();
                for (int i = 0; i < provider.Attributes.Count; i++)
                {
                    ICustomAttribute attribute = provider.Attributes[i];
                    if (IsType(attribute.Constructor.DeclaringType, "System.Runtime.InteropServices", "DefaultParameterValueAttribute", "System"))
                    {
                        continue;
                    }

                    attributes.Add(attribute);
                }

                if (attributes.Count > 0)
                {
                    string prefix = null;

                    IAssembly assembly = provider as IAssembly;
                    if (assembly != null)
                    {
                        prefix = "assembly:";
                    }

                    IModule module = provider as IModule;
                    if (module != null)
                    {
                        prefix = "module:";
                    }

                    IMethodReturnType methodReturnType = provider as IMethodReturnType;
                    if (methodReturnType != null)
                    {
                        prefix = "return:";
                    }

                    if ((assembly != null) || (module != null))
                    {
                        for (int i = 0; i < attributes.Count; i++)
                        {
                            ICustomAttribute attribute = (ICustomAttribute)attributes[i];
                            formatter.Write("[");
                            formatter.WriteKeyword(prefix);
                            formatter.Write(" ");
                            this.WriteCustomAttribute(attribute, formatter);
                            formatter.Write("]");

                            if (i != (attributes.Count - 1))
                            {
                                formatter.WriteLine();
                            }
                        }
                    }
                    else
                    {
                        formatter.Write("[");
                        if (prefix != null)
                        {
                            formatter.WriteKeyword(prefix);
                            formatter.Write(" ");
                        }

                        for (int i = 0; i < attributes.Count; i++)
                        {
                            if (i != 0)
                            {
                                formatter.Write(", ");
                            }

                            ICustomAttribute attribute = (ICustomAttribute)attributes[i];
                            this.WriteCustomAttribute(attribute, formatter);
                        }

                        formatter.Write("]");
                    }
                }
            }
开发者ID:jorik041,项目名称:JavaScriptLanguage,代码行数:77,代码来源:JavaScriptLanguage.cs

示例11: WriteConditionStatement

            private void WriteConditionStatement(IConditionStatement statement, IFormatter formatter)
            {
                this.WriteStatementSeparator(formatter);
                formatter.WriteKeyword("if");
                formatter.Write(" ");
                if (statement.Condition is IBinaryExpression)
                    this.WriteExpression(statement.Condition, formatter);
                else
                {
                    formatter.Write("(");
                    this.WriteExpression(statement.Condition, formatter);
                    formatter.Write(")");
                }

                formatter.Write(" {");
                formatter.WriteLine();
                formatter.WriteIndent();

                if (statement.Then != null)
                    this.WriteStatement(statement.Then, formatter);
                else
                    formatter.WriteLine();

                formatter.WriteOutdent();
                formatter.Write("}");

                if ((statement.Else != null) && (statement.Else.Statements.Count > 0))
                {
                    this.WritePendingOutdent(formatter);
                    formatter.WriteLine();
                    formatter.WriteKeyword("else");
                    formatter.Write(" {");
                    formatter.WriteLine();
                    formatter.WriteIndent();
                    if (statement.Else != null)
                    {
                        this.WriteStatement(statement.Else, formatter);
                        this.WritePendingOutdent(formatter);
                    }
                    else
                    {
                        formatter.WriteLine();
                    }
                    formatter.WriteOutdent();
                    formatter.Write("}");
                }
            }
开发者ID:jorik041,项目名称:JavaScriptLanguage,代码行数:47,代码来源:JavaScriptLanguage.cs

示例12: WriteComment

            private void WriteComment(IComment comment, IFormatter formatter)
            {
                string[] parts = comment.Text.Split(new char[] { '\n' });
                if (parts.Length <= 1)
                {
                    foreach (string part in parts)
                    {
                        formatter.WriteComment("// ");
                        formatter.WriteComment(part);
                        formatter.WriteLine();
                    }
                }
                else
                {
                    formatter.WriteComment("/* ");
                    formatter.WriteLine();

                    foreach (string part in parts)
                    {
                        formatter.WriteComment(part);
                        formatter.WriteLine();
                    }

                    formatter.WriteComment("*/");
                    formatter.WriteLine();
                }
            }
开发者ID:jorik041,项目名称:JavaScriptLanguage,代码行数:27,代码来源:JavaScriptLanguage.cs

示例13: WriteBreakStatement

 private void WriteBreakStatement(IBreakStatement statement, IFormatter formatter)
 {
     this.WriteStatementSeparator(formatter);
     formatter.WriteKeyword("break");
     formatter.Write(";");
     formatter.WriteLine();
 }
开发者ID:jorik041,项目名称:JavaScriptLanguage,代码行数:7,代码来源:JavaScriptLanguage.cs

示例14: WriteRemoveEventStatement

 private void WriteRemoveEventStatement(IRemoveEventStatement statement, IFormatter formatter)
 {
     this.WriteStatementSeparator(formatter);
     this.WriteEventReferenceExpression(statement.Event, formatter);
     formatter.Write(" -= ");
     this.WriteExpression(statement.Listener, formatter);
     formatter.Write(";");
     formatter.WriteLine();
 }
开发者ID:jorik041,项目名称:JavaScriptLanguage,代码行数:9,代码来源:JavaScriptLanguage.cs

示例15: WriteForEachStatement

            private void WriteForEachStatement(IForEachStatement value, IFormatter formatter)
            {
                // TODO statement.Variable declaration needs to be rendered some where

                this.WriteStatementSeparator(formatter);

                TextFormatter description = new TextFormatter();
                this.WriteVariableDeclaration(value.Variable, description);

                formatter.WriteLine();
                formatter.WriteKeyword("foreach");
                formatter.Write(" (");
                formatter.WriteReference(value.Variable.Name, description.ToString(), null);
                formatter.WriteKeyword(" in ");
                this.WriteExpression(value.Expression, formatter);
                formatter.Write(") {");
                formatter.WriteLine();
                formatter.WriteIndent();

                if (value.Body != null)
                {
                    this.WriteStatement(value.Body, formatter);
                }

                formatter.WriteLine();
                formatter.WriteOutdent();
                formatter.WriteKeyword("}");
            }
开发者ID:jorik041,项目名称:JavaScriptLanguage,代码行数:28,代码来源:JavaScriptLanguage.cs


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