private void btnNext_Click(object sender, EventArgs e)
        {
            InstallationData.DefaultProviders = rdDefaultProvider.Checked;
            if (!rdDefaultProvider.Checked)
            {
                bool selected = false;
                foreach (CheckBox chkBox in pnlProviders.Controls.OfType<CheckBox>())
                {
                    bool providerExists = InstallationData.Providers.Exists(o => o.WrapperName == Provider.GetWrapperFromString(chkBox.Tag.ToString()));
                    if (chkBox.Checked)
                    {
                        if (!providerExists)
                            InstallationData.Providers.Add(new Provider() { WrapperName = Provider.GetWrapperFromString(chkBox.Tag.ToString()) });
                        selected = true;
                    }
                    else
                    {
                        if (providerExists)
                            InstallationData.Providers.RemoveAll(o => o.WrapperName == Provider.GetWrapperFromString(chkBox.Tag.ToString()));
                    }
                }

                if (!selected)
                {
                    MessageBox.Show("Please select at least one provider.");
                    return;
                }

                InstallationData.CurrentIndex = 0;
                InstallationData.BrowseBackMode = false;
                ProviderDetails provDetails = new ProviderDetails();
                provDetails.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
                this.TopMost = false;
                provDetails.TopMost = true;
                provDetails.ShowDialog();

                if (!InstallationData.BrowseBackMode)
                {
                    _cancelInstallation = false;
                    this.Close();
                }
                else
                {
                    this.TopMost = true;
                }
            }
            else
            {
                //Default Provider selected
                InstallationData.PopulateDefaultProviders();

                _cancelInstallation = false;
                this.Close();
            }
        }
Esempio n. 2
0
        private void btnNext_Click(object sender, EventArgs e)
        {
            InstallationData.DefaultProviders = rdDefaultProvider.Checked;
            if (!rdDefaultProvider.Checked)
            {
                bool selected = false;
                foreach (CheckBox chkBox in pnlProviders.Controls.OfType <CheckBox>())
                {
                    bool providerExists = InstallationData.Providers.Exists(o => o.WrapperName == Provider.GetWrapperFromString(chkBox.Tag.ToString()));
                    if (chkBox.Checked)
                    {
                        if (!providerExists)
                        {
                            InstallationData.Providers.Add(new Provider()
                            {
                                WrapperName = Provider.GetWrapperFromString(chkBox.Tag.ToString())
                            });
                        }
                        selected = true;
                    }
                    else
                    {
                        if (providerExists)
                        {
                            InstallationData.Providers.RemoveAll(o => o.WrapperName == Provider.GetWrapperFromString(chkBox.Tag.ToString()));
                        }
                    }
                }

                if (!selected)
                {
                    MessageBox.Show("Please select at least one provider.");
                    return;
                }

                InstallationData.CurrentIndex   = 0;
                InstallationData.BrowseBackMode = false;
                ProviderDetails provDetails = new ProviderDetails();
                provDetails.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
                this.TopMost        = false;
                provDetails.TopMost = true;
                provDetails.ShowDialog();

                if (!InstallationData.BrowseBackMode)
                {
                    _cancelInstallation = false;
                    this.Close();
                }
                else
                {
                    this.TopMost = true;
                }
            }
            else
            {
                //Default Provider selected
                InstallationData.PopulateDefaultProviders();

                _cancelInstallation = false;
                this.Close();
            }
        }