Example #1
0
 /// <summary>
 /// Creates a new instance of <c>RemoteDeviceManager</c>.
 /// </summary>
 public RemoteDeviceManager()
 {
     if (IRapiDesktopInstance == null)
     {
         throw new InvalidOperationException(Properties.Resources.ErrorNoActiveSync);
     }
     iSink = new RAPISink();
     iSink.DeviceConnected    += ISink_DeviceConnected;
     iSink.DeviceDisconnected += ISink_DeviceDisconnected;
     IRapiDesktopInstance.Advise(iSink, out adviceContext);
     Devices = new RAPIDeviceList();
 }
Example #2
0
 /// <summary>
 /// Cleans up all internal references.
 /// </summary>
 public void Dispose()
 {
     if (adviceContext > 0 && IRapiDesktopInstance != null)
     {
         IRapiDesktopInstance.UnAdvise(adviceContext);
     }
     iSink.DeviceConnected    -= ISink_DeviceConnected;
     iSink.DeviceDisconnected -= ISink_DeviceDisconnected;
     iSink   = null;
     Devices = null;
     if (invokeThread != null && invokeThread.IsAlive)
     {
         invokeThread.Abort();
     }
     GC.SuppressFinalize(this);
 }
Example #3
0
 internal RAPIDeviceEnum()
 {
     iEnum = IRapiDesktopInstance.EnumDevices();
 }