Пример #1
0
        public virtual void remove_OnStdNotify(XboxEvents_OnStdNotifyEventHandler _param1)
        {
            Monitor.Enter((object)this);
            try
            {
                if (this.m_aEventSinkHelpers == null)
                {
                    return;
                }
                int count = this.m_aEventSinkHelpers.Count;
                int index = 0;
                if (0 >= count)
                {
                    return;
                }
                do
                {
                    XboxEvents_SinkHelper aEventSinkHelper = (XboxEvents_SinkHelper)this.m_aEventSinkHelpers[index];
                    if (aEventSinkHelper.m_OnStdNotifyDelegate != null && ((aEventSinkHelper.m_OnStdNotifyDelegate.Equals((object)_param1) ? 1 : 0) & (int)byte.MaxValue) != 0)
                    {
                        this.m_aEventSinkHelpers.RemoveAt(index);
                        this.m_ConnectionPoint.Unadvise(aEventSinkHelper.m_dwCookie);
                        if (count <= 1)
                        {
                            Marshal.ReleaseComObject((object)this.m_ConnectionPoint);
                            this.m_ConnectionPoint   = (IConnectionPoint)null;
                            this.m_aEventSinkHelpers = (ArrayList)null;
                            return;
                        }
                        goto label_10;
                    }
                    else
                    {
                        ++index;
                    }
                }while (index < count);
                goto label_11;
label_10:
                return;

                label_11 :;
            }
            finally
            {
                Monitor.Exit((object)this);
            }
        }
Пример #2
0
 public virtual void add_OnStdNotify(XboxEvents_OnStdNotifyEventHandler _param1)
 {
     Monitor.Enter((object)this);
     try
     {
         if (this.m_ConnectionPoint == null)
         {
             this.Init();
         }
         XboxEvents_SinkHelper eventsSinkHelper = new XboxEvents_SinkHelper();
         int pdwCookie = 0;
         this.m_ConnectionPoint.Advise((object)eventsSinkHelper, out pdwCookie);
         eventsSinkHelper.m_dwCookie            = pdwCookie;
         eventsSinkHelper.m_OnStdNotifyDelegate = _param1;
         this.m_aEventSinkHelpers.Add((object)eventsSinkHelper);
     }
     finally
     {
         Monitor.Exit((object)this);
     }
 }