Beispiel #1
0
        List <Tuple <MethodInfo, object> > SlurpAllNullEventHandlers(bool forceNoNull)
        {
            List <Tuple <MethodInfo, object> > retVal = new List <Tuple <MethodInfo, object> >();

            if (forceNoNull)
            {
                return(retVal);
            }

            // Adding NULL static methods (if any)
            if (_staticEvents.ContainsKey(""))
            {
                foreach (Tuple <MethodInfo, object> idx in _staticEvents[""])
                {
                    retVal.Add(idx);
                }
            }

            // Adding NULL instance methods (if any)
            if (InstanceMethod.ContainsKey(""))
            {
                foreach (Tuple <MethodInfo, object> idx in InstanceMethod[""])
                {
                    retVal.Add(idx);
                }
            }
            return(retVal);
        }
Beispiel #2
0
        // TODO: WTF ...?

        /**
         * Returns true if Active Event is an override of an existing active event
         */
        public bool IsOverrideSystem(string key)
        {
            bool retVal = _eventMappers.ContainsKey(key);

            if (retVal)
            {
                retVal = InstanceMethod.ContainsKey(key);
                if (!retVal)
                {
                    retVal = _staticEvents.ContainsKey(key);
                }
            }
            return(retVal);
        }
Beispiel #3
0
 internal void AddListener(object context, MethodInfo method, string name)
 {
     if (context == null)
     {
         // Static event handler, will *NEVER* be cleared until application
         // itself is restarted
         if (!_staticEvents.ContainsKey(name))
         {
             _staticEvents[name] = new List <Tuple <MethodInfo, object> >();
         }
         _staticEvents[name].Add(new Tuple <MethodInfo, object>(method, context));
     }
     else
     {
         // Request "instance" event handler, will be tossed away when
         // request is over if Viewport is correctly wired
         if (!InstanceMethod.ContainsKey(name))
         {
             InstanceMethod[name] = new List <Tuple <MethodInfo, object> >();
         }
         InstanceMethod[name].Add(new Tuple <MethodInfo, object>(method, context));
     }
 }
Beispiel #4
0
        private List <Tuple <MethodInfo, object> > SlurpAllEventHandlers(string eventName, bool forceNoNull)
        {
            List <Tuple <MethodInfo, object> > retVal = new List <Tuple <MethodInfo, object> >();

            // Adding static methods (if any)
            if (_staticEvents.ContainsKey(eventName))
            {
                foreach (Tuple <MethodInfo, object> idx in _staticEvents[eventName])
                {
                    retVal.Add(idx);
                }
            }

            // Adding instance methods (if any)
            if (InstanceMethod.ContainsKey(eventName))
            {
                foreach (Tuple <MethodInfo, object> idx in InstanceMethod[eventName])
                {
                    retVal.Add(idx);
                }
            }
            return(retVal);
        }