예제 #1
0
        public LPEvent(object[] data)
        {
            if (data.Length == 0)
            {
                return;
            }

            int eType = Convert.ToInt32(data[0]);

            if (data.Length > 1)
            {
                object[] ndata = new object[data.Length - 1];
                for (int i = 1; i < data.Length; i++)
                {
                    ndata[i - 1] = data[i];
                }

                data = ndata;
            }

            this.Data = data;

            if (Enum.IsDefined(typeof(LPEventType), eType))
            {
                this.EventType = (LPEventType)eType;
            }
        }
예제 #2
0
        public static void On(LPEventType type, ExEventDelegate <LPEvent> d)
        {
            if (!Events.ContainsKey(type))
            {
                Events.Add(type, new ExEvent <LPEvent>());
            }

            Events[type] += d;
        }