private void HostConfigurationWindow(IProviderConfigurationEditor initSettings, ActiveProviderInfo api) { //dialog window which will house the user control ProviderSettingsWindow psw = new ProviderSettingsWindow(); Bitmap img = (Bitmap)ProviderManager.GetProviderIcon(api.Instance.GetType()); if (img != null) { psw.Icon = System.Drawing.Icon.FromHandle(img.GetHicon()); img.Dispose(); } //load the usercontrol into the window psw.LoadSettings(initSettings, api.ProviderName); //get current config string //load the configuration info into the user control initSettings.LoadConfiguration(api.ProviderConfig); //show the dialog box psw.ShowDialog(); //if user clicked OK then call save to keep a copy of settings in memory if (initSettings.IsOK) { api.ProviderConfig = initSettings.SaveConfiguration(); //activate apply option ApplyButton.Enabled = true; } }
private void dgvOutputProviders_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0 && e.ColumnIndex == 0) { var obj = dgvOutputProviders.CurrentRow.DataBoundItem; if (obj == null) { return; } ActiveProviderInfo api = obj as ActiveProviderInfo; Type t = ProviderManager.Instance.HasConfigurationWindow(api.ProviderName); //check for null if (t != null) { IProviderConfigurationEditor cw = ProviderManager.InitializeConfigurationWindow(t); HostConfigurationWindow(cw, api); } else { MessageBox.Show(string.Format("Sorry! No settings available for {0}.", api.ProviderName)); } } //fix for the Active checkbox not causing the apply button to activate for options else if (e.RowIndex >= 0 && e.ColumnIndex > 0) { ApplyButton.Enabled = true; } }
public void LoadSettings(IProviderConfigurationEditor uc, string providerName) { _uc = uc; this.Text = "Provider Settings for " + providerName; _uc.HostMe(scHost.Panel1); }
public void LoadSettings(IProviderConfigurationEditor uc, string providerName) { _uc = uc; this.Text = "Provider Settings for " + providerName; _uc.HostMe(scHost.Panel1); }
private void HostConfigurationWindow(IProviderConfigurationEditor initSettings) { panel1.Controls.Clear(); _current = initSettings; //load empty settings _current.LoadConfiguration(""); initSettings.HostMe(panel1); }
private void HostConfigurationWindow(IProviderConfigurationEditor initSettings) { panel1.Controls.Clear(); _current = initSettings; //load empty settings _current.LoadConfiguration(""); initSettings.HostMe(panel1); }
private void HostConfigurationWindow(IProviderConfigurationEditor initSettings, ActiveProviderInfo api) { //dialog window which will house the user control ProviderSettingsWindow psw = new ProviderSettingsWindow(); Bitmap img = (Bitmap)ProviderManager.GetProviderIcon(api.Instance.GetType()); if (img != null) { psw.Icon = System.Drawing.Icon.FromHandle(img.GetHicon()); img.Dispose(); } //load the usercontrol into the window psw.LoadSettings(initSettings, api.ProviderName); //get current config string //load the configuration info into the user control initSettings.LoadConfiguration(api.ProviderConfig); //show the dialog box psw.ShowDialog(); //if user clicked OK then call save to keep a copy of settings in memory if (initSettings.IsOK) { api.ProviderConfig = initSettings.SaveConfiguration(); //activate apply option ApplyButton.Enabled = true; } }