Example #1
0
        public CNamedEvent FindNamedEventTemplate(ListView <CMethodBase> methods, string eventName)
        {
            CStringID b = new CStringID(eventName);
            int       i = methods.get_Count() - 1;

            while (i >= 0)
            {
                CMethodBase cMethodBase = methods.get_Item(i);
                string      name        = cMethodBase.GetName();
                CStringID   a           = new CStringID(name);
                if (a == b && cMethodBase.IsNamedEvent())
                {
                    CNamedEvent cNamedEvent = (CNamedEvent)cMethodBase;
                    if (cNamedEvent.IsStatic())
                    {
                        this.InsertEventGlobal(cNamedEvent.GetClassNameString(), cNamedEvent);
                        return(cNamedEvent);
                    }
                    return(cNamedEvent);
                }
                else
                {
                    i--;
                }
            }
            return(null);
        }
Example #2
0
        public CNamedEvent FindNamedEventTemplate(List <CMethodBase> methods, string eventName)
        {
            CStringID eventID = new CStringID(eventName);

            //reverse, so the event in the derived class can override the one in the base class
            for (int i = methods.Count - 1; i >= 0; --i)
            {
                CMethodBase pMethod    = methods[i];
                string      methodName = pMethod.GetName();
                CStringID   methodID   = new CStringID(methodName);
                if (methodID == eventID && pMethod.IsNamedEvent())
                {
                    Debug.Check(pMethod is CNamedEvent);
                    CNamedEvent pNamedMethod = (CNamedEvent)pMethod;

                    if (pNamedMethod.IsStatic())
                    {
                        InsertEventGlobal(pNamedMethod.GetClassNameString(), pNamedMethod);
                        return(pNamedMethod);
                    }

                    return(pNamedMethod);
                }
            }

            return(null);
        }
Example #3
0
        public CNamedEvent FindNamedEventTemplate(ListView <CMethodBase> methods, string eventName)
        {
            CStringID gid = new CStringID(eventName);

            for (int i = methods.Count - 1; i >= 0; i--)
            {
                CMethodBase base2 = methods[i];
                string      name  = base2.GetName();
                CStringID   gid2  = new CStringID(name);
                if ((gid2 == gid) && base2.IsNamedEvent())
                {
                    CNamedEvent pEvent = (CNamedEvent)base2;
                    if (pEvent.IsStatic())
                    {
                        this.InsertEventGlobal(pEvent.GetClassNameString(), pEvent);
                        return(pEvent);
                    }
                    return(pEvent);
                }
            }
            return(null);
        }