public void Dispose() { if (!isDisposed) { if (window != null) { window.StateChanged -= new UsbStateChangedEventHandler(DoStateChanged); window.Dispose(); window = null; } isDisposed = true; GC.SuppressFinalize(this); } }
public UsbManager() { this.window = null; this.handler = null; this.isDisposed = false; }