示例#1
0
        public static void AcceptVisitor <TResult> (
            this EventDefinition eventDefinition,
            MetadataVisitor <TResult> visitor)
        {
            if (!visitor.ShouldTraverseInto(visitor.VisitEventDefinition(eventDefinition)))
            {
                return;
            }

            if (eventDefinition.HasCustomAttributes)
            {
                eventDefinition.CustomAttributes.AcceptVisitor(visitor);
            }

            eventDefinition.EventType.AcceptVisitor(visitor);
            eventDefinition.AddMethod?.AcceptVisitor(visitor);
            eventDefinition.RemoveMethod?.AcceptVisitor(visitor);
            eventDefinition.InvokeMethod?.AcceptVisitor(visitor);
        }