Esempio n. 1
0
        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;
            }
        }
Esempio n. 2
0
        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;
            }
        }
Esempio n. 3
0
        public void LoadSettings(IProviderConfigurationEditor uc, string providerName)
        {
            _uc = uc;

            this.Text = "Provider Settings for " + providerName;
            _uc.HostMe(scHost.Panel1);
        }
Esempio n. 4
0
        public void LoadSettings(IProviderConfigurationEditor uc, string providerName)
        {
            _uc = uc;

            this.Text = "Provider Settings for " + providerName;
            _uc.HostMe(scHost.Panel1);
        }
Esempio n. 5
0
        private void HostConfigurationWindow(IProviderConfigurationEditor initSettings)
        {
            panel1.Controls.Clear();
            _current = initSettings;

            //load empty settings
            _current.LoadConfiguration("");

            initSettings.HostMe(panel1);
        }
Esempio n. 6
0
        private void HostConfigurationWindow(IProviderConfigurationEditor initSettings)
        {
            panel1.Controls.Clear();
            _current = initSettings;

            //load empty settings
            _current.LoadConfiguration("");

            initSettings.HostMe(panel1);
        }
Esempio n. 7
0
        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;
            }
        }