Microsoft.Zing.Checker.VisitAttributeConstructor C# (CSharp) Méthode

VisitAttributeConstructor() public méthode

public VisitAttributeConstructor ( System.Compiler.AttributeNode attribute, System.Compiler.Node target ) : System.Compiler.Expression
attribute System.Compiler.AttributeNode
target System.Compiler.Node
Résultat System.Compiler.Expression
        public override Expression VisitAttributeConstructor(AttributeNode attribute, Node target)
        {
            if (attribute == null) return null;
            MemberBinding mb = attribute.Constructor as MemberBinding;
            if (mb == null) { Debug.Assert(false); return null; }
            InstanceInitializer cons = mb.BoundMember as InstanceInitializer;
            if (cons == null) return null;
            TypeNode t = cons.DeclaringType;
            if (t.IsAssignableTo(SystemTypes.Attribute))
            {
                // NOTE: for Zing, we don't check the attribute target because we're putting
                // attributes on statements, which CCI will never understand.

                //if (!this.CheckAttributeTarget(attribute, target, mb, t)) return null;
                //this.CheckForObsolesence(mb, cons);

                return mb;
            }
            Debug.Assert(false);
            this.HandleError(mb, System.Compiler.Error.NotAnAttribute, this.GetTypeName(t));
            this.HandleRelatedError(t);
            return null;
        }