• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# NextAction类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中NextAction的典型用法代码示例。如果您正苦于以下问题:C# NextAction类的具体用法?C# NextAction怎么用?C# NextAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



NextAction类属于命名空间,在下文中一共展示了NextAction类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: AddIndentBlockOperations

        public override void AddIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode node, OptionSet optionSet, NextAction<IndentBlockOperation> nextOperation)
        {
            nextOperation.Invoke(list);

            var queryExpression = node as QueryExpressionSyntax;
            if (queryExpression != null)
            {
                var firstToken = queryExpression.FromClause.Expression.GetFirstToken(includeZeroWidth: true);
                var lastToken = queryExpression.FromClause.Expression.GetLastToken(includeZeroWidth: true);
                AddIndentBlockOperation(list, queryExpression.FromClause.FromKeyword, firstToken, lastToken);

                for (int i = 0; i < queryExpression.Body.Clauses.Count; i++)
                {
                    // if it is nested query expression
                    var fromClause = queryExpression.Body.Clauses[i] as FromClauseSyntax;
                    if (fromClause != null)
                    {
                        firstToken = fromClause.Expression.GetFirstToken(includeZeroWidth: true);
                        lastToken = fromClause.Expression.GetLastToken(includeZeroWidth: true);
                        AddIndentBlockOperation(list, fromClause.FromKeyword, firstToken, lastToken);
                    }
                }

                // set alignment line for query expression
                var baseToken = queryExpression.GetFirstToken(includeZeroWidth: true);
                var endToken = queryExpression.GetLastToken(includeZeroWidth: true);
                if (!baseToken.IsMissing && !baseToken.Equals(endToken))
                {
                    var startToken = baseToken.GetNextToken(includeZeroWidth: true);
                    SetAlignmentBlockOperation(list, baseToken, startToken, endToken);
                }
            }
        }
开发者ID:noahstein,项目名称:roslyn,代码行数:33,代码来源:QueryExpressionFormattingRule.cs


示例2: AddIndentBlockOperations

        public override void AddIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode node, OptionSet optionSet, NextAction<IndentBlockOperation> nextOperation)
        {
            nextOperation.Invoke(list);

            if (s_allowableKinds.Contains(node.Kind()))
            {
                AddChangeSignatureIndentOperation(list, node);
            }
        }
开发者ID:Rickinio,项目名称:roslyn,代码行数:9,代码来源:ChangeSignatureFormattingRule.cs


示例3: AddAnchorIndentationOperations

            public override void AddAnchorIndentationOperations(List<AnchorIndentationOperation> list, SyntaxNode node, OptionSet optionSet, NextAction<AnchorIndentationOperation> nextOperation)
            {
                if (node.IsKind(SyntaxKind.SimpleLambdaExpression) || node.IsKind(SyntaxKind.ParenthesizedLambdaExpression) || node.IsKind(SyntaxKind.AnonymousMethodExpression))
                {
                    return;
                }

                nextOperation.Invoke(list);
            }
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:9,代码来源:CSharpMethodExtractor.FormattingProvider.cs


示例4: AddNextIndentBlockOperations

        private void AddNextIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode node, OptionSet optionSet, NextAction<IndentBlockOperation> nextOperation)
        {
            if (_vbHelperFormattingRule == null)
            {
                base.AddIndentBlockOperations(list, node, optionSet, nextOperation);
                return;
            }

            _vbHelperFormattingRule.AddIndentBlockOperations(list, node, optionSet, nextOperation);
        }
开发者ID:Rickinio,项目名称:roslyn,代码行数:10,代码来源:BaseIndentationFormattingRule.cs


示例5: AddSuppressOperations

        public override void AddSuppressOperations(List<SuppressOperation> list, SyntaxNode node, SyntaxToken lastToken, OptionSet optionSet, NextAction<SuppressOperation> nextOperation)
        {
            nextOperation.Invoke(list);

            var queryExpression = node as QueryExpressionSyntax;
            if (queryExpression != null)
            {
                AddSuppressWrappingIfOnSingleLineOperation(list, queryExpression.GetFirstToken(includeZeroWidth: true), queryExpression.GetLastToken(includeZeroWidth: true));
            }
        }
开发者ID:noahstein,项目名称:roslyn,代码行数:10,代码来源:QueryExpressionFormattingRule.cs


示例6: AddSuppressOperations

        public override void AddSuppressOperations(List<SuppressOperation> list, SyntaxNode node, SyntaxToken lastToken, OptionSet optionSet, NextAction<SuppressOperation> nextOperation)
        {
            nextOperation.Invoke(list);

            AddInitializerSuppressOperations(list, node);

            AddBraceSuppressOperations(list, node, lastToken);

            AddStatementExceptBlockSuppressOperations(list, node);

            AddSpecificNodesSuppressOperations(list, node);
        }
开发者ID:Rickinio,项目名称:roslyn,代码行数:12,代码来源:SuppressFormattingRule.cs


示例7: AddSuppressOperations

        public override void AddSuppressOperations(List<SuppressOperation> list, SyntaxNode node, OptionSet optionSet, NextAction<SuppressOperation> nextOperation)
        {
            nextOperation.Invoke(list);

            if (!node.ContainsAnnotations)
            {
                return;
            }

            AddPropertyDeclarationSuppressOperations(list, node);

            AddInitializerSuppressOperations(list, node);
        }
开发者ID:ehsansajjad465,项目名称:roslyn,代码行数:13,代码来源:ElasticTriviaFormattingRule.cs


示例8: AddIndentBlockOperations

        public override void AddIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode node, OptionSet optionSet, NextAction<IndentBlockOperation> nextOperation)
        {
            nextOperation.Invoke(list);

            AddBlockIndentationOperation(list, node, optionSet);

            AddLabelIndentationOperation(list, node, optionSet);

            AddSwitchIndentationOperation(list, node, optionSet);

            AddEmbeddedStatementsIndentationOperation(list, node);

            AddTypeParameterConstraintClauseOperation(list, node);
        }
开发者ID:riversky,项目名称:roslyn,代码行数:14,代码来源:IndentBlockFormattingRule.cs


示例9: AddAlignTokensOperations

        public override void AddAlignTokensOperations(List<AlignTokensOperation> list, SyntaxNode node, OptionSet optionSet, NextAction<AlignTokensOperation> nextOperation)
        {
            nextOperation.Invoke(list);
            var syntaxNode = node;

            var bracePair = node.GetBracePair();

            if (!bracePair.IsValidBracePair())
            {
                return;
            }

            if (syntaxNode.IsLambdaBodyBlock() ||
                node is InitializerExpressionSyntax)
            {
                AddAlignIndentationOfTokensToFirstTokenOfBaseTokenLineOperation(list, syntaxNode, bracePair.Item1, SpecializedCollections.SingletonEnumerable((SyntaxToken)bracePair.Item2));
            }
        }
开发者ID:riversky,项目名称:roslyn,代码行数:18,代码来源:AlignTokensFormattingRule.cs


示例10: AddIndentBlockOperations

        public override void AddIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode node, OptionSet optionSet, NextAction<IndentBlockOperation> nextOperation)
        {
            nextOperation.Invoke(list);

            var bracePair = node.GetBracePair();

            // don't put block indentation operation if the block only contains lambda expression body block
            if (node.IsLambdaBodyBlock() || !bracePair.IsValidBracePair())
            {
                return;
            }

            if (optionSet.GetOption(CSharpFormattingOptions.OpenCloseBracesIndent))
            {
                AddIndentBlockOperation(list, bracePair.Item1, bracePair.Item1, bracePair.Item1.Span);
                AddIndentBlockOperation(list, bracePair.Item2, bracePair.Item2, bracePair.Item2.Span);
            }
        }
开发者ID:riversky,项目名称:roslyn,代码行数:18,代码来源:IndentUserSettingsFormattingRule.cs


示例11: AddSuppressOperations

        public override void AddSuppressOperations(List<SuppressOperation> list, SyntaxNode node, OptionSet optionSet, NextAction<SuppressOperation> nextOperation)
        {
            nextOperation.Invoke(list);

            AddBraceSuppressOperations(list, node);

            AddStatementExceptBlockSuppressOperations(list, node);

            AddSpecificNodesSuppressOperations(list, node);

            if (!optionSet.GetOption(CSharpFormattingOptions.WrappingPreserveSingleLine))
            {
                RemoveSuppressOperationForBlock(list, node);
            }

            if (!optionSet.GetOption(CSharpFormattingOptions.WrappingKeepStatementsOnSingleLine))
            {
                RemoveSuppressOperationForStatementMethodDeclaration(list, node);
            }
        }
开发者ID:modulexcite,项目名称:pattern-matching-csharp,代码行数:20,代码来源:WrappingFormattingRule.cs


示例12: AddIndentBlockOperations

        public override void AddIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode node, OptionSet optionSet, NextAction<IndentBlockOperation> nextOperation)
        {
            // for the common node itself, return absolute indentation
            if (_commonNode == node)
            {
                // TODO: If the first line of the span includes a node, we want to align with the position of that node 
                // in the primary buffer.  That's what Dev12 does for C#, but it doesn't match Roslyn's current model
                // of each statement being formatted independently with respect to it's parent.
                list.Add(new IndentBlockOperation(_token1, _token2, _span, _baseIndentation, IndentBlockOption.AbsolutePosition));
            }
            else if (node.Span.Contains(_span))
            {
                // any node bigger than our span is ignored.
                return;
            }

            // Add everything to the list.
            AddNextIndentBlockOperations(list, node, optionSet, nextOperation);

            // Filter out everything that encompasses our span.
            AdjustIndentBlockOperation(list);
        }
开发者ID:Rickinio,项目名称:roslyn,代码行数:22,代码来源:BaseIndentationFormattingRule.cs


示例13: AddAnchorIndentationOperations

        public override void AddAnchorIndentationOperations(List<AnchorIndentationOperation> list, SyntaxNode node, OptionSet optionSet, NextAction<AnchorIndentationOperation> nextOperation)
        {
            nextOperation.Invoke(list);

            var queryClause = node as QueryClauseSyntax;
            if (queryClause != null)
            {
                var firstToken = queryClause.GetFirstToken(includeZeroWidth: true);
                AddAnchorIndentationOperation(list, firstToken, queryClause.GetLastToken(includeZeroWidth: true));
            }

            var selectOrGroupClause = node as SelectOrGroupClauseSyntax;
            if (selectOrGroupClause != null)
            {
                var firstToken = selectOrGroupClause.GetFirstToken(includeZeroWidth: true);
                AddAnchorIndentationOperation(list, firstToken, selectOrGroupClause.GetLastToken(includeZeroWidth: true));
            }

            var continuation = node as QueryContinuationSyntax;
            if (continuation != null)
            {
                AddAnchorIndentationOperation(list, continuation.IntoKeyword, continuation.GetLastToken(includeZeroWidth: true));
            }
        }
开发者ID:noahstein,项目名称:roslyn,代码行数:24,代码来源:QueryExpressionFormattingRule.cs


示例14: AddSuppressOperations

        public override void AddSuppressOperations(List<SuppressOperation> list, SyntaxNode node, OptionSet optionSet, NextAction<SuppressOperation> nextOperation)
        {
            nextOperation.Invoke(list);

            SuppressVariableDeclaration(list, node, optionSet);
        }
开发者ID:stebet,项目名称:roslyn,代码行数:6,代码来源:SpacingFormattingRule.cs


示例15: AddSuppressOperations

 public void AddSuppressOperations(List<SuppressOperation> list, SyntaxNode node, OptionSet optionSet, NextAction<SuppressOperation> nextOperation)
 {
     nextOperation.Invoke(list);
 }
开发者ID:EkardNT,项目名称:Roslyn,代码行数:4,代码来源:NoOpFormattingRule.cs


示例16: AddAlignTokensOperations

 public void AddAlignTokensOperations(List<AlignTokensOperation> list, SyntaxNode node, OptionSet optionSet, NextAction<AlignTokensOperation> nextOperation)
 {
     nextOperation.Invoke(list);
 }
开发者ID:EkardNT,项目名称:Roslyn,代码行数:4,代码来源:NoOpFormattingRule.cs


示例17: AddIndentBlockOperations

 public void AddIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode node, OptionSet optionSet, NextAction<IndentBlockOperation> nextOperation)
 {
     nextOperation.Invoke(list);
 }
开发者ID:EkardNT,项目名称:Roslyn,代码行数:4,代码来源:NoOpFormattingRule.cs


示例18: AddAnchorIndentationOperations

 public void AddAnchorIndentationOperations(List<AnchorIndentationOperation> list, SyntaxNode node, OptionSet optionSet, NextAction<AnchorIndentationOperation> nextOperation)
 {
     nextOperation.Invoke(list);
 }
开发者ID:EkardNT,项目名称:Roslyn,代码行数:4,代码来源:NoOpFormattingRule.cs


示例19: AddSuppressOperations

            public override void AddSuppressOperations(List<SuppressOperation> list, SyntaxNode node, SyntaxToken lastToken, OptionSet optionSet, NextAction<SuppressOperation> nextOperation)
            {
                base.AddSuppressOperations(list, node, lastToken, optionSet, nextOperation);

                // remove suppression rules for array and collection initializer
                if (node.IsInitializerForArrayOrCollectionCreationExpression())
                {
                    // remove any suppression operation
                    list.RemoveAll(s_predicate);
                }
            }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:11,代码来源:CurlyBraceCompletionSession.cs


示例20: AddAlignTokensOperations

 public override void AddAlignTokensOperations(List<AlignTokensOperation> list, SyntaxNode node, OptionSet optionSet, NextAction<AlignTokensOperation> nextOperation)
 {
     base.AddAlignTokensOperations(list, node, optionSet, nextOperation);
     if (optionSet.GetOption(SmartIndent, node.Language) == IndentStyle.Block)
     {
         var bracePair = node.GetBracePair();
         if (bracePair.IsValidBracePair())
         {
             AddAlignIndentationOfTokensToBaseTokenOperation(list, node, bracePair.Item1, SpecializedCollections.SingletonEnumerable(bracePair.Item2), AlignTokensOption.AlignIndentationOfTokensToFirstTokenOfBaseTokenLine);
         }
     }
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:12,代码来源:CurlyBraceCompletionSession.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Nfs3FileHandle类代码示例发布时间:2022-05-24
下一篇:
C# Newtonsoft类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap