public override void VisitConditionalAccessInstance(IConditionalAccessInstanceOperation operation)
            {
                var semanticModel = operation.SemanticModel;
                var syntax        = operation.Syntax;
                var symbol        = semanticModel.GetSymbolInfo(syntax).Symbol;

                if (symbol != null)
                {
                    if (symbol is IEventSymbol eventSymbol)
                    {
                        EventSymbol = eventSymbol;
                        return;
                    }
                    else if (symbol is ILocalSymbol localSymbol)
                    {
                        FindFromLocalSymbol(semanticModel, localSymbol);
                    }
                }

                base.VisitConditionalAccessInstance(operation);
            }
コード例 #2
0
 public override void VisitConditionalAccessInstance(IConditionalAccessInstanceOperation operation)
 {
     Assert.Equal(OperationKind.ConditionalAccessInstance, operation.Kind);
     Assert.Empty(operation.Children);
 }
コード例 #3
0
 public override IOperation VisitConditionalAccessInstance(IConditionalAccessInstanceOperation operation, object argument)
 {
     return(new ConditionalAccessInstanceExpression(((Operation)operation).SemanticModel, operation.Syntax, operation.Type, operation.ConstantValue, operation.IsImplicit));
 }
コード例 #4
0
ファイル: OperationVisitor.cs プロジェクト: zyonet/roslyn
 public virtual void VisitConditionalAccessInstance(IConditionalAccessInstanceOperation operation)
 {
     DefaultVisit(operation);
 }
コード例 #5
0
        public static IConditionalAccessOperation GetConditionalAccess(this IConditionalAccessInstanceOperation operation)
        {
            Func <IConditionalAccessOperation, bool> predicate = c => c.Operation.Syntax == operation.Syntax;

            return(operation.GetAncestor(OperationKind.ConditionalAccess, predicate));
        }
コード例 #6
0
 public override void VisitConditionalAccessInstance([NotNull] IConditionalAccessInstanceOperation operation)
 {
     base.VisitConditionalAccessInstance(operation);
 }
コード例 #7
0
        public override TAbstractAnalysisValue VisitConditionalAccessInstance(IConditionalAccessInstanceOperation operation, object argument)
        {
            IConditionalAccessOperation conditionalAccess = operation.GetConditionalAccess();

            return(GetCachedAbstractValue(conditionalAccess.Operation));
        }
コード例 #8
0
 public override bool VisitConditionalAccessInstance([NotNull] IConditionalAccessInstanceOperation operation1,
                                                     [CanBeNull] IOperation argument)
 {
     return(argument is IConditionalAccessInstanceOperation operation2 &&
            AreBaseOperationsEqual(operation1, operation2));
 }