protected override void Dispose(bool disposing) { if (!this.disposed) { if (disposing) { this.vdsNotificationSink.Dispose(); } try { if (this.cookie != 0) { IVdsService service = InteropHelpers.QueryInterface <IVdsService>(base.ComUnknown); if (service != null) { service.Unadvise(this.cookie); } this.cookie = 0; } } catch (COMException) { } catch (InvalidComObjectException) { } this.disposed = true; base.Dispose(disposing); } }