public virtual void Visit(EventDeclaration eventDecl)
        {
            Visit(eventDecl.EventType);

            if (eventDecl.AddMethod != null)
            {
                Visit(eventDecl.AddMethod);
            }

            if (eventDecl.RemoveMethod != null)
            {
                Visit(eventDecl.RemoveMethod);
            }

            if (eventDecl.InvokeMethod != null)
            {
                Visit(eventDecl.InvokeMethod);
            }

            Visit(eventDecl.CustomAttributes);
        }
Ejemplo n.º 2
0
        public virtual void Build(EventDeclaration eventDecl)
        {
            var eventType = eventDecl.EventType;

            if (Build(ref eventType))
            {
                eventDecl.EventType = eventType;
            }

            if (eventDecl.AddMethod != null)
            {
                var methodRef = eventDecl.AddMethod;
                if (Build(ref methodRef))
                {
                    eventDecl.AddMethod = methodRef;
                }
            }

            if (eventDecl.RemoveMethod != null)
            {
                var methodRef = eventDecl.RemoveMethod;
                if (Build(ref methodRef))
                {
                    eventDecl.RemoveMethod = methodRef;
                }
            }

            if (eventDecl.InvokeMethod != null)
            {
                var methodRef = eventDecl.InvokeMethod;
                if (Build(ref methodRef))
                {
                    eventDecl.InvokeMethod = methodRef;
                }
            }

            Build(eventDecl.CustomAttributes);
        }
 protected void AddEvent(EventDeclaration e)
 {
     Events.Add(e);
 }