示例#1
0
 // Disconnect from ActiveX event source
 void Disconnect()
 {
   System.Threading.Monitor.Enter(this);
   try {
     if (EventSinkHelper != null)
       ConnectionPoint.Unadvise(EventSinkHelper.Cookie);
     ConnectionPoint = null;
     EventSinkHelper = null;
   } catch { }
   System.Threading.Monitor.Exit(this);
 }
示例#2
0
 // Connect to ActiveX event source
 void Connect()
 {
   if (ConnectionPoint == null)
   {
     ConnectionCount = 0;
     Guid g = new Guid("95F45AA4-ED0A-11D2-BA67-0000F80855E6");
     ConnectionPointContainer.FindConnectionPoint(ref g, out ConnectionPoint);
     EventSinkHelper = new IWMPCustomSliderCtrlEvents_SinkHelper();
     ConnectionPoint.Advise(EventSinkHelper, out EventSinkHelper.Cookie);
   }
 }