Exemple #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);
 }
Exemple #2
0
 // Connect to ActiveX event source
 void Connect()
 {
   if (ConnectionPoint == null)
   {
     ConnectionCount = 0;
     Guid g = new Guid("50FC8D31-67AC-11D3-BD4C-00C04F6EA5AE");
     ConnectionPointContainer.FindConnectionPoint(ref g, out ConnectionPoint);
     EventSinkHelper = new IWMPRegionalButtonEvents_SinkHelper();
     ConnectionPoint.Advise(EventSinkHelper, out EventSinkHelper.Cookie);
   }
 }