/// <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(); }
/// <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); }
internal RAPIDeviceEnum() { iEnum = IRapiDesktopInstance.EnumDevices(); }