Inheritance: StateManagedItem
Esempio n. 1
0
        internal void FireAsyncEvent(string eventName, ParameterCollection extraParams)
        {
            ComponentDirectEvents directevents = this.GetDirectEvents();

            if (directevents == null)
            {
                throw new HttpException("The control has no DirectEvents");
            }

            PropertyInfo eventListenerInfo = directevents.GetType().GetProperty(eventName);

            if (eventListenerInfo.PropertyType != typeof(ComponentDirectEvent))
            {
                throw new HttpException("The control '{1}' does not have an DirectEvent with the name '{0}'".FormatWith(eventName, this.ClientID));
            }

            var directevent = eventListenerInfo.GetValue(directevents, null) as ComponentDirectEvent;

            if (directevent == null || directevent.IsDefault)
            {
                throw new HttpException("The control '{1}' does not have an DirectEvent with the name '{0}' or the handler is absent".FormatWith(eventName, this.ClientID));
            }

            var e = new DirectEventArgs(extraParams);

            directevent.Owner = this;
            directevent.OnEvent(e);
        }
Esempio n. 2
0
 public ComponentDirectEvent(ComponentDirectEvents parent) 
 { 
     this.Parent = parent; 
 }
Esempio n. 3
0
 public ComponentDirectEvent(ComponentDirectEvents parent)
 {
     this.Parent = parent;
 }