Exemplo n.º 1
0
        private List <SlotInfo> GetStaticSlots()
        {
            List <SlotInfo> infos = new List <SlotInfo>();

            foreach (MethodInfo m in GetType().GetMethods(
                         BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public))
            {
                SlotMethod slm = m.GetCustomAttribute <SlotMethod>(true);
                if (slm != null)
                {
                    Action <Signal> slot = (signal) => SendMessage(m.Name, signal, SendMessageOptions.RequireReceiver);
                    infos.Add(new SlotInfo(slot, slm.Filter));
                }
            }
            return(infos);
        }
        private List <SlotInfo> GetStaticSlots()
        {
            List <SlotInfo> infos = new List <SlotInfo>();

            foreach (MethodInfo m in GetType().GetMethods(
                         BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public))
            {
                SlotMethod slm = m.GetCustomAttribute <SlotMethod>(true);
                if (slm != null)
                {
                    Action <Signal> slot = (signal) => m.Invoke(this, new object[] { signal });
                    infos.Add(new SlotInfo(slot, slm.Filter));
                }
            }
            return(infos);
        }