protected override void OnDispose(bool fDisposing) { base.OnDispose(fDisposing); if (fDisposing) { if (this._cdDeviceList != null) { this._cdDeviceList.MediaChangedHandler -= new OnMediaChangedHandler(this.OnMediaChanged); int num = (int)this._cdDeviceList.Release(); this._cdDeviceList = null; } if (this._recorder != null) { this._recorder.RecordStopHandler -= new OnRecordStopHandler(this.OnRecordStop); this._recorder.RecordProgressHandler -= new OnRecordProgressHandler(this.OnRecordProgress); this._recorder = null; } foreach (CDAlbumCommand cd in _CDs) { cd?.Dispose(); } this._CDs.Clear(); } if (this._drmQuery == null) { return; } this._drmQuery.Dispose(); }
private void Initialize() { this._cdDeviceList = ZuneApplication.ZuneLibrary.GetCDDeviceList(); DiscExperience disc = Shell.MainFrame.Disc; if (this._cdDeviceList != null) { this._cdDeviceList.MediaChangedHandler += new OnMediaChangedHandler(this.OnMediaChanged); for (int index = 0; index < this._cdDeviceList.Count; ++index) { this._CDs.Add(null); } } disc.RecalculateAvailableNodes(); this._recorder = ZuneApplication.ZuneLibrary.GetRecorder(); if (this._recorder == null) { return; } this._recorder.RecordStopHandler += new OnRecordStopHandler(this.OnRecordStop); this._recorder.RecordProgressHandler += new OnRecordProgressHandler(this.OnRecordProgress); }