/// <summary> /// A sinmple consturctor that initializes teh object with the given values. /// </summary> /// <param name="p_dsgSettings">The settings group whose settings will be editable with this view.</param> public DownloadSettingsPage(DownloadSettingsGroup p_dsgSettings) { SettingsGroup = p_dsgSettings; p_dsgSettings.UpdatedSettings += new EventHandler(dsgSettings_UpdatedSettings); InitializeComponent(); butChromeFix.Image = new Bitmap(Properties.Resources.uac_icon, 20, 20); SetBindings(p_dsgSettings); }
private void SetBindings(DownloadSettingsGroup p_dsgSettings) { BindingSource bsFileServerZones = new BindingSource(); if (m_fszFileServerZone != null) m_fszFileServerZone.Clear(); m_fszFileServerZone = p_dsgSettings.FileServerZones; bsFileServerZones.DataSource = p_dsgSettings.FileServerZones; cbxServerLocation.DataSource = bsFileServerZones.DataSource; cbxServerLocation.DisplayMember = "FileServerName"; cbxServerLocation.ValueMember = "FileServerID"; if (cbxServerLocation.DataBindings != null) cbxServerLocation.DataBindings.Clear(); BindingHelper.CreateFullBinding(cbxServerLocation, () => cbxServerLocation.SelectedValue, p_dsgSettings, () => p_dsgSettings.UserLocation); if (ckbPremiumOnly.DataBindings != null) ckbPremiumOnly.DataBindings.Clear(); BindingHelper.CreateFullBinding(ckbPremiumOnly, () => ckbPremiumOnly.Checked, p_dsgSettings, () => p_dsgSettings.UseMultithreadedDownloads); ckbPremiumOnly.Enabled = p_dsgSettings.PremiumEnabled; }