Exemple #1
0
        public void ShowOptionForm(bool showSubscription = false, bool showAboutFormOnly = false)
        {
            this.panelProgress.Visible = false;
            this.panelActionButtons.Hide();
            buttonTools.BackColor    = ApplicationSettings.NormalButtonColor;
            buttonCleaner.BackColor  = ApplicationSettings.NormalButtonColor;
            buttonRegistry.BackColor = ApplicationSettings.NormalButtonColor;
            buttonOptions.BackColor  = ApplicationSettings.SelectedButtonColor;


            if (panelCleanerComponents.Controls.Find("Registry", false).Count() > 0)
            {
                UCRegistry registry = panelCleanerComponents.Controls.Find("Registry", false)[0] as UCRegistry;
                registry.Hide();
            }


            if (panelCleanerComponents.Controls.Find("ucCleaner1", false).Count() > 0)
            {
                UCCleaner registry = panelCleanerComponents.Controls.Find("ucCleaner1", false)[0] as UCCleaner;
                registry.Hide();
            }

            if (gboxResult.Controls.Find("Tools", false).Count() > 0)
            {
                foreach (Control ctrl in this.gboxResult.Controls)
                {
                    ctrl.Hide();
                }
                UCTools registry = gboxResult.Controls.Find("Tools", false)[0] as UCTools;
                registry.Hide();
            }

            if (gboxResult.Controls.Find("Options", false).Count() > 0)
            {
                foreach (Control ctrl in this.gboxResult.Controls)
                {
                    ctrl.Hide();
                }
                UCOptions options = gboxResult.Controls.Find("Options", false)[0] as UCOptions;
                options.Show();
            }
            else
            {
                UCOptions tools = new UCOptions();
                tools.Name = "Options";
                tools.Dock = DockStyle.Fill;
                foreach (Control ctrl in this.gboxResult.Controls)
                {
                    ctrl.Visible = false;
                }
                this.gboxResult.Controls.Add(tools);

                if (showSubscription)
                {
                    tools.ShowSubscriptionForm(showSubscription);
                }

                if (showAboutFormOnly)
                {
                    tools.ShowAboutUs(true);
                }
            }

            ShowHideControls(ApplicationItem.Options);

            SelectedItem = ApplicationItem.Options;

            this.panelActionButtons.Hide();

            if (showSubscription || showAboutFormOnly)
            {
                if (this.OwnedForms.Count() > 0)
                {
                    this.OwnedForms[0].Hide();
                }

                buttonCleaner.Enabled  = false;
                buttonRegistry.Enabled = false;
                buttonTools.Enabled    = false;
            }
        }