本文整理汇总了C#中NextAction类的典型用法代码示例。如果您正苦于以下问题:C# NextAction类的具体用法?C# NextAction怎么用?C# NextAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NextAction类属于命名空间,在下文中一共展示了NextAction类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例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));
}
}
示例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);
}
示例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);
}
示例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);
}
示例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));
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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));
}
}
示例14: AddSuppressOperations
public override void AddSuppressOperations(List<SuppressOperation> list, SyntaxNode node, OptionSet optionSet, NextAction<SuppressOperation> nextOperation)
{
nextOperation.Invoke(list);
SuppressVariableDeclaration(list, node, optionSet);
}
示例15: AddSuppressOperations
public void AddSuppressOperations(List<SuppressOperation> list, SyntaxNode node, OptionSet optionSet, NextAction<SuppressOperation> nextOperation)
{
nextOperation.Invoke(list);
}