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


C# CodeFormattingOptions.ReflowComment方法代码示例

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


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

示例1: AppendCodeStringStmt

 internal override void AppendCodeStringStmt(StringBuilder res, PythonAst ast, CodeFormattingOptions format) {
     format.ReflowComment(res, this.GetProceedingWhiteSpace(ast));
     res.Append("while");
     _test.AppendCodeString(res, ast, format);
     _body.AppendCodeString(res, ast, format);
     if (_else != null) {
         format.ReflowComment(res, this.GetSecondWhiteSpaceDefaultNull(ast));
         res.Append("else");
         _else.AppendCodeString(res, ast, format);
     }
 }
开发者ID:wenh123,项目名称:PTVS,代码行数:11,代码来源:WhileStatement.cs

示例2: AppendCodeStringStmt

        internal override void AppendCodeStringStmt(StringBuilder res, PythonAst ast, CodeFormattingOptions format) {
            format.ReflowComment(res, this.GetProceedingWhiteSpace(ast));
            res.Append("with");
            var itemWhiteSpace = this.GetListWhiteSpace(ast);
            int whiteSpaceIndex = 0;
            for (int i = 0; i < _items.Length; i++) {
                var item = _items[i];
                if (i != 0) {
                    if (itemWhiteSpace != null) {
                        res.Append(itemWhiteSpace[whiteSpaceIndex++]);
                    }
                    res.Append(',');
                }

                item.ContextManager.AppendCodeString(res, ast, format);
                if (item.Variable != null) {
                    if (itemWhiteSpace != null) {
                        res.Append(itemWhiteSpace[whiteSpaceIndex++]);
                    } else {
                        res.Append(' ');
                    }
                    res.Append("as");
                    item.Variable.AppendCodeString(res, ast, format);
                }
            }

            _body.AppendCodeString(res, ast, format);
        }
开发者ID:wenh123,项目名称:PTVS,代码行数:28,代码来源:WithStatement.cs

示例3: AppendCodeString

 internal override void AppendCodeString(StringBuilder res, PythonAst ast, CodeFormattingOptions format) {
     var verbatimPieces = this.GetVerbatimNames(ast);
     var verbatimComments = this.GetListWhiteSpace(ast);
     if (verbatimPieces != null) {
         // string+ / bytes+, such as "abc" "abc", which can spawn multiple lines, and 
         // have comments in between the peices.
         for (int i = 0; i < verbatimPieces.Length; i++) {
             if (verbatimComments != null && i < verbatimComments.Length) {
                 format.ReflowComment(res, verbatimComments[i]);
             }
             res.Append(verbatimPieces[i]);
         }
     } else {
         format.ReflowComment(res, this.GetProceedingWhiteSpaceDefaultNull(ast));
         res.Append(this.GetExtraVerbatimText(ast) ?? GetConstantRepr(ast.LanguageVersion));
     }
 }
开发者ID:RussBaz,项目名称:PTVS,代码行数:17,代码来源:ConstantExpression.cs

示例4: AppendCodeString

 internal override void AppendCodeString(StringBuilder res, PythonAst ast, CodeFormattingOptions format) {
     format.ReflowComment(res, this.GetProceedingWhiteSpaceDefaultNull(ast));
     if (format.UseVerbatimImage) {
         res.Append(this.GetVerbatimImage(ast) ?? _name);
     } else {
         res.Append(_name);
     }
 }
开发者ID:jsschultz,项目名称:PTVS,代码行数:8,代码来源:NameExpression.cs

示例5: AppendCodeString

 internal override void AppendCodeString(StringBuilder res, PythonAst ast, CodeFormattingOptions format) {
     format.ReflowComment(res, this.GetProceedingWhiteSpace(ast));
     res.Append('`');
     _expression.AppendCodeString(res, ast, format);
     if (!this.IsMissingCloseGrouping(ast)) {
         res.Append(this.GetSecondWhiteSpace(ast));
         res.Append('`');
     }
 }
开发者ID:wenh123,项目名称:PTVS,代码行数:9,代码来源:BackQuoteExpression.cs

示例6: AppendCodeStringStmt

 internal override void AppendCodeStringStmt(StringBuilder res, PythonAst ast, CodeFormattingOptions format) {
     var decorateWhiteSpace = this.GetNamesWhiteSpace(ast);
     if (Decorators != null) {
         for (int i = 0, curWhiteSpace = 0; i < Decorators.Count; i++) {
             if (decorateWhiteSpace != null) {
                 format.ReflowComment(res, decorateWhiteSpace[curWhiteSpace++]);
             }
             res.Append('@');
             if (Decorators[i] != null) {
                 Decorators[i].AppendCodeString(res, ast, format);
                 if (decorateWhiteSpace != null) {
                     format.ReflowComment(res, decorateWhiteSpace[curWhiteSpace++]);
                 } else {
                     res.Append(Environment.NewLine);
                 }
             }
         }
     }
 }
开发者ID:RussBaz,项目名称:PTVS,代码行数:19,代码来源:DecoratorStatement.cs

示例7: AppendCodeStringStmt

 internal override void AppendCodeStringStmt(StringBuilder res, PythonAst ast, CodeFormattingOptions format) {
     format.ReflowComment(res, this.GetProceedingWhiteSpace(ast));
     res.Append("assert");
     _test.AppendCodeString(res, ast, format);
     if (_message != null) {
         res.Append(this.GetSecondWhiteSpace(ast));
         res.Append(',');
         _message.AppendCodeString(res, ast, format);
     }
 }
开发者ID:omnimark,项目名称:PTVS,代码行数:10,代码来源:AssertStatement.cs

示例8: AppendCodeString

 internal override void AppendCodeString(StringBuilder res, PythonAst ast, CodeFormattingOptions format) {
     format.ReflowComment(res, this.GetProceedingWhiteSpace(ast));
     res.Append("await");
     if (!this.IsAltForm(ast)) {
         _expression.AppendCodeString(res, ast, format);
         var itemWhiteSpace = this.GetListWhiteSpace(ast);
         if (itemWhiteSpace != null) {
             res.Append(",");
             res.Append(itemWhiteSpace[0]);
         }
     }
 }
开发者ID:wenh123,项目名称:PTVS,代码行数:12,代码来源:AwaitExpression.cs

示例9: AppendCodeStringStmt

        internal override void AppendCodeStringStmt(StringBuilder res, PythonAst ast, CodeFormattingOptions format) {
            var itemWhiteSpace = this.GetListWhiteSpace(ast);
            for (int i = 0; i < _tests.Length; i++) {
                if (itemWhiteSpace != null) {
                    format.ReflowComment(res, itemWhiteSpace[i]);
                }

                if (i == 0) {
                    res.Append("if");
                } else {
                    res.Append("elif");
                }
                _tests[i].AppendCodeString(res, ast, format);
            }

            if (_else != null) {
                format.ReflowComment(res, this.GetProceedingWhiteSpace(ast));
                res.Append("else");
                _else.AppendCodeString(res, ast, format);
            }
        }
开发者ID:omnimark,项目名称:PTVS,代码行数:21,代码来源:IfStatement.cs

示例10: AppendCodeString

        internal override void AppendCodeString(StringBuilder res, PythonAst ast, CodeFormattingOptions format) {
            if (this.IsAltForm(ast)) {
                ListExpression.AppendItems(res, ast, format, "", "", this, Items);
            } else {
                if (Items.Count == 0 && 
                    format.SpaceWithinEmptyTupleExpression != null) {
                    format.ReflowComment(res, this.GetProceedingWhiteSpace(ast));
                    res.Append('(');
                    if (String.IsNullOrWhiteSpace(this.GetSecondWhiteSpace(ast))) {
                        res.Append(format.SpaceWithinEmptyTupleExpression.Value ? " " : "");
                    } else {
                        format.ReflowComment(res, this.GetSecondWhiteSpace(ast));
                    }
                    res.Append(')');
                } else {
                    string delimWs =
                     format.SpacesWithinParenthesisedTupleExpression != null ?
                     format.SpacesWithinParenthesisedTupleExpression.Value ? " " : "" : null;

                    ListExpression.AppendItems(res, ast, format, "(", this.IsMissingCloseGrouping(ast) ? "" : ")", this, Items, delimWs);
                } 
            }
        }
开发者ID:RussBaz,项目名称:PTVS,代码行数:23,代码来源:TupleExpression.cs

示例11: AppendCodeStringStmt

 internal override void AppendCodeStringStmt(StringBuilder res, PythonAst ast, CodeFormattingOptions format) {
     format.ReflowComment(res, this.GetProceedingWhiteSpace(ast));
     res.Append("print");
     if (_dest != null) {
         res.Append(this.GetSecondWhiteSpace(ast));
         res.Append(">>");
         _dest.AppendCodeString(res, ast, format);
         if (_expressions.Length > 0) {
             res.Append(this.GetThirdWhiteSpace(ast));
             res.Append(',');
         }
     }
     ListExpression.AppendItems(res, ast, format, "", "", this, Expressions);
 }
开发者ID:omnimark,项目名称:PTVS,代码行数:14,代码来源:PrintStatement.cs

示例12: AppendCodeStringStmt

        internal override void AppendCodeStringStmt(StringBuilder res, PythonAst ast, CodeFormattingOptions format) {
            format.ReflowComment(res, this.GetProceedingWhiteSpace(ast));
            res.Append("return");
            if (_expression != null) {
                int len = res.Length;

                _expression.AppendCodeString(res, ast, format);
                if (this.IsAltForm(ast)) {
                    // remove the leading white space and insert a single space
                    res.Remove(len, _expression.GetLeadingWhiteSpace(ast).Length);
                    res.Insert(len, ' ');
                }
            }
        }
开发者ID:omnimark,项目名称:PTVS,代码行数:14,代码来源:ReturnStatement.cs

示例13: AppendCodeStringStmt

 internal override void AppendCodeStringStmt(StringBuilder res, PythonAst ast, CodeFormattingOptions format) {
     format.ReflowComment(res, this.GetProceedingWhiteSpace(ast));
     res.Append("exec");
     _code.AppendCodeString(res, ast, format);
     if (_globals != null) {
         res.Append(this.GetSecondWhiteSpace(ast));
         res.Append("in");
         _globals.AppendCodeString(res, ast, format);
         if (_locals != null) {
             res.Append(this.GetThirdWhiteSpace(ast));
             res.Append(',');
             _locals.AppendCodeString(res, ast, format);
         }
     }
 }
开发者ID:RussBaz,项目名称:PTVS,代码行数:15,代码来源:ExecStatement.cs

示例14: AppendCodeStringStmt

 internal override void AppendCodeStringStmt(StringBuilder res, PythonAst ast, CodeFormattingOptions format) {
     format.ReflowComment(res, this.GetProceedingWhiteSpace(ast));
     res.Append("for");
     _left.AppendCodeString(res, ast, format);
     if (!this.IsIncompleteNode(ast)) {
         res.Append(this.GetSecondWhiteSpace(ast));
         res.Append("in");
         _list.AppendCodeString(res, ast, format);
         _body.AppendCodeString(res, ast, format);   // colon is handled by suite statements...
         if (_else != null) {
             format.ReflowComment(res, this.GetThirdWhiteSpace(ast));
             res.Append("else");
             _else.AppendCodeString(res, ast, format);
         }
     }
 }
开发者ID:wenh123,项目名称:PTVS,代码行数:16,代码来源:ForStatement.cs

示例15: AppendCodeString

        internal void AppendCodeString(StringBuilder res, PythonAst ast, CodeFormattingOptions format, string start, string end, Expression item) {
            if (!String.IsNullOrEmpty(start)) {
                format.ReflowComment(res, this.GetProceedingWhiteSpace(ast));
                res.Append(start);
            }

            item.AppendCodeString(res, ast, format);

            for (int i = 0; i < Iterators.Count; i++) {
                Iterators[i].AppendCodeString(res, ast, format);
            }

            if (!String.IsNullOrEmpty(end)) {
                res.Append(this.GetSecondWhiteSpace(ast));
                res.Append(end);
            }
        }
开发者ID:omnimark,项目名称:PTVS,代码行数:17,代码来源:Comprehension.cs


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