예제 #1
0
        private void useProvider_CheckStateChanged(object sender, EventArgs e)
        {
            GenericConfig config = pages[page].ProviderConfig;

            config.Enabled       = useProvider.Checked;
            controlPanel.Enabled = config.Enabled;
        }
예제 #2
0
        private void useProvider_CheckStateChanged(object sender, EventArgs e)
        {
            GenericConfig config = pages[page].ProviderConfig;

            if (IsEntityFrameworkPage)
            {
                config.Enabled = useProvider.Checked;
                entityFrameworkPanel.Enabled = config.Enabled;
                entityFrameworkPanel.Visible = true;
                controlPanel.Visible         = false;
                pnlSimpleMembership.Visible  = false;
            }
            else
            {
                if (!IsSimpleMembershipPage)
                {
                    config.Enabled               = useProvider.Checked;
                    controlPanel.Enabled         = config.Enabled;
                    controlPanel.Visible         = true;
                    pnlSimpleMembership.Visible  = false;
                    entityFrameworkPanel.Visible = false;
                }
                else
                {
                    config.Enabled = useProvider.Checked;
                    pnlSimpleMembership.Enabled  = config.Enabled;
                    pnlSimpleMembership.Visible  = true;
                    controlPanel.Visible         = false;
                    entityFrameworkPanel.Visible = false;
                }
            }
        }
예제 #3
0
        private bool SavePageData()
        {
            if (useProvider.Checked && connectionString.Text.Trim().Length == 0)
            {
                MessageBox.Show(this, Resources.WebConfigConnStrNoEmpty, Resources.ErrorTitle,
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }

            GenericConfig config = pages[page].ProviderConfig;
            Options       o      = config.GenericOptions;

            o.AppName             = appName.Text;
            o.AppDescription      = appDescription.Text.Trim();
            o.WriteExceptionToLog = writeExToLog.Checked;
            o.AutoGenSchema       = autogenSchema.Checked;
            o.ConnectionString    = connectionString.Text.Trim();
            config.GenericOptions = o;
            return(true);
        }
예제 #4
0
        private bool SavePageData()
        {
            if (!IsValidData())
            {
                return(false);
            }

            GenericConfig config = pages[page].ProviderConfig;

            if (IsSimpleMembershipPage && useProvider.Checked)
            {
                SimpleMembershipOptions options = new SimpleMembershipOptions();
                options.AutoGenerateTables = chbAutoGenTbl.Checked;
                options.UserTableName      = txtUserTable.Text;
                options.UserIdColumn       = txtUserIdCol.Text;
                options.UserNameColumn     = txtUserNameCol.Text;
                ((SimpleMembershipConfig)pages[SimpleMembershipIndex].ProviderConfig).SimpleMemberOptions = options;
                config.Enabled = useProvider.Checked;
            }

            if (IsEntityFrameworkPage && useProvider.Checked)
            {
                EntityFrameworkOptions options = new EntityFrameworkOptions();
                options.EF5 = radioBtnEF5.Checked;
                options.EF6 = radioBtnEF6.Checked;
                ((EntityFrameworkConfig)pages[ENTITYFRAMEWORK_INDEX].ProviderConfig).EntityFrameworkOptions = options;
                config.Enabled = useProvider.Checked;
            }

            Options o = config.GenericOptions;

            o.AppName              = appName.Text;
            o.AppDescription       = appDescription.Text.Trim();
            o.WriteExceptionToLog  = writeExToLog.Checked;
            o.AutoGenSchema        = autogenSchema.Checked;
            o.EnableExpireCallback = enableExpCallback.Checked;
            o.ConnectionString     = (IsSimpleMembershipPage && useProvider.Checked) ? txtConnStringSM.Text.Trim() : connectionString.Text.Trim();
            o.ConnectionStringName = (IsSimpleMembershipPage && useProvider.Checked) ? txtConnStringName.Text.Trim() : o.ConnectionStringName;
            config.GenericOptions  = o;
            return(true);
        }
예제 #5
0
        private void PageChanged()
        {
            pageLabel.Text   = pages[page].Title;
            pageDesc.Text    = pages[page].Description;
            useProvider.Text = pages[page].EnabledString;

            GenericConfig config = pages[page].ProviderConfig;

            useProvider.Checked = config.Enabled;
            Options o = config.GenericOptions;

            appName.Text          = o.AppName;
            appDescription.Text   = o.AppDescription;
            writeExToLog.Checked  = o.WriteExceptionToLog;
            autogenSchema.Checked = o.AutoGenSchema;
            controlPanel.Enabled  = config.Enabled;
            connectionString.Text = o.ConnectionString;

            advancedBtn.Visible  = page == 0;
            writeExToLog.Visible = page != 2;
            nextButton.Text      = (page == pages.Length - 1) ? "Finish" : "Next";
            backButton.Enabled   = page > 0;
        }
예제 #6
0
        private void PageChanged()
        {
            pageLabel.Text   = pages[page].Title;
            pageDesc.Text    = pages[page].Description;
            useProvider.Text = pages[page].EnabledString;
            GenericConfig config = pages[page].ProviderConfig;
            Options       o      = config.GenericOptions;

            appName.Text              = o.AppName;
            useProvider.Checked       = config.Enabled;
            appDescription.Text       = o.AppDescription;
            writeExToLog.Checked      = o.WriteExceptionToLog;
            autogenSchema.Checked     = o.AutoGenSchema;
            enableExpCallback.Checked = o.EnableExpireCallback;
            controlPanel.Enabled      = config.Enabled;

            if (IsEntityFrameworkPage)
            {
                EntityFrameworkOptions options = ((EntityFrameworkConfig)pages[ENTITYFRAMEWORK_INDEX].ProviderConfig).EntityFrameworkOptions;
                radioBtnEF5.Checked = options.EF5;
                radioBtnEF6.Checked = options.EF6;
            }
            else
            {
                if (IsSimpleMembershipPage)
                {
                    txtConnStringSM.Text = o.ConnectionString;
                }
                else
                {
                    connectionString.Text = o.ConnectionString;
                }
            }

            advancedBtn.Visible       = page == 0;
            writeExToLog.Visible      = page != 3;
            enableExpCallback.Visible = page == 4;
            nextButton.Text           = (page == pages.Length - 1) ? "Finish" : "Next";
            backButton.Enabled        = page > 0;

            if (page == PERSONALIZATION_INDEX)
            {
                useProvider.Enabled = IsMembershipSelected();
            }
            else
            {
                useProvider.Enabled = true;
            }

            if (config.NotInstalled)
            {
                useProvider.Checked = false;
                useProvider.Enabled = false;
            }

            if (IsEntityFrameworkPage)
            {
                pnlSimpleMembership.Visible  = false;
                controlPanel.Visible         = false;
                entityFrameworkPanel.Visible = true;
                entityFrameworkPanel.Enabled = config.Enabled;
            }
            else
            {
                entityFrameworkPanel.Visible = false;
                entityFrameworkPanel.Enabled = false;

                if (IsSimpleMembershipPage)
                {
                    pnlSimpleMembership.Visible = true;
                    controlPanel.Visible        = false;

                    if (config.NotInstalled)
                    {
                        useProvider.Enabled         = false;
                        useProvider.Checked         = false;
                        pnlSimpleMembership.Enabled = false;
                    }
                    else
                    {
                        useProvider.Enabled = !IsMembershipSelected();
                        if (config.Enabled && IsMembershipSelected())
                        {
                            useProvider.Checked = false;
                        }
                    }
                }
                else
                {
                    pnlSimpleMembership.Visible = false;
                    controlPanel.Visible        = true;
                }
            }
        }