public DeviceChoice(IModelItemOwner owner) : base(owner) { UIDeviceList instance = SingletonModelItem <UIDeviceList> .Instance; instance.DeviceAddedEvent += new DeviceListEventHandler(this.ListChanged); instance.DeviceRemovedEvent += new DeviceListEventHandler(this.ListChanged); SyncControls.Instance.PropertyChanged += new PropertyChangedEventHandler(this.OnSyncPropertyChanged); this.BuildOptions(); }
protected override void OnDispose(bool disposing) { if (disposing) { SyncControls.Instance.PropertyChanged -= new PropertyChangedEventHandler(this.OnSyncPropertyChanged); UIDeviceList instance = SingletonModelItem <UIDeviceList> .Instance; instance.DeviceAddedEvent -= new DeviceListEventHandler(this.ListChanged); instance.DeviceRemovedEvent -= new DeviceListEventHandler(this.ListChanged); } base.OnDispose(disposing); }
private void BuildOptions() { UIDeviceList instance = SingletonModelItem <UIDeviceList> .Instance; this.Options = new ArrayListDataSet(this); foreach (UIDevice uiDevice in instance) { this.Options.Add(uiDevice); if (uiDevice == SyncControls.Instance.CurrentDevice) { this.ChosenValue = uiDevice; } } }
private SyncControls(IModelItemOwner owner) : base(owner) { this._deviceList = SingletonModelItem <UIDeviceList> .Instance; this._deviceList.DeviceAddedEvent += new DeviceListEventHandler(this.OnDeviceAdded); this._deviceList.DeviceRemovedEvent += new DeviceListEventHandler(this.OnDeviceRemoved); this._deviceList.DeviceConnectedEvent += new DeviceListEventHandler(this.OnDeviceConnected); this._deviceList.DeviceDisconnectedEvent += new DeviceListEventHandler(this.OnDeviceDisconnected); this._currentDevice = UIDeviceList.NullDevice; SignIn.Instance.PropertyChanged += new PropertyChangedEventHandler(this.SignInPropertyChanged); AccountCreationWizard.CreationCompleted += new EventHandler(this.AccountCreationFinished); DeviceManagement.DeviceConnectionHandled += new DeviceConnectionHandledEventHandler(this.OnDeviceConnectionHandled); this.UpdateWirelessSyncBannerDisplay(); }
protected override void OnDispose(bool fDisposing) { if (fDisposing) { if (this._deviceList != null) { this._deviceList.DeviceAddedEvent -= new DeviceListEventHandler(this.OnDeviceAdded); this._deviceList.DeviceRemovedEvent -= new DeviceListEventHandler(this.OnDeviceRemoved); this._deviceList.DeviceConnectedEvent -= new DeviceListEventHandler(this.OnDeviceConnected); this._deviceList.DeviceDisconnectedEvent -= new DeviceListEventHandler(this.OnDeviceDisconnected); this._deviceList = null; } if (this._downloadTasks != null) { this._downloadTasks.ActiveDownloads.PropertyChanged -= new PropertyChangedEventHandler(this.OnDownloadPropertyChanged); this._downloadTasks = null; } SignIn.Instance.PropertyChanged -= new PropertyChangedEventHandler(this.SignInPropertyChanged); AccountCreationWizard.CreationCompleted -= new EventHandler(this.AccountCreationFinished); DeviceManagement.DeviceConnectionHandled -= new DeviceConnectionHandledEventHandler(this.OnDeviceConnectionHandled); } base.OnDispose(fDisposing); }