Example #1
0
        public ISNEvent CreateSNEvent(string identifiedEventName)
        {
            ISNEvent e = new SNEvent();

            e.AutoRelease    = false;
            e.IdentifiedSign = identifiedEventName;
            Context.Add(e);
            return(e);
        }
Example #2
0
        public ISNEvent CreateSNEvent(Delegate g)
        {
            var atr = g.Method.GetCustomAttributes(false) [0] as SNMethodAttribute;

            for (int i = 0; i < Context.Count; i++)
            {
                if (Context [i].IdentifiedSign == atr.SNEventName)
                {
                    return(Context [i].Register(atr.SNEventName, g));
                }
            }

            ISNEvent e = new SNEvent();

            e.AutoRelease    = atr.AutoRelease;
            e.IdentifiedSign = atr.SNEventName;
            e.Register(atr.SNEventName, g);
            return(UpdateSNEvent(e));
        }