Esempio n. 1
0
        private void tvwOptions_AfterSelect(object sender, TreeViewEventArgs e)
        {
            //we need to disable screenupdating while processing the configuration.
            UIControl.StopWindowUpdating(this.Handle);
            // Cache profile, if one has been selected
            CacheLoadedProfile();

            tvwOptions.Visible = true;

            TreeNode selNode = e.Node;

            if (selNode.Parent != null && selNode.Parent.Name == "ndeProfiles")
            {
                // This is a profile node. Load the profile
                //
                // Show / hide the controls
                generalOptions.Visible        = false;
                about.Visible                 = false;
                submissionControl.Visible     = true;
                ManageProfilesControl.Visible = false;

                // Populate the settings control
                submissionControl.Profile = UserProfiles.GetProfileByName(selNode.Text);

                // Cache profile
                CacheLoadedProfile();
            }
            else
            {
                switch (selNode.Name)
                {
                case "ndeGlobal":
                    generalOptions.Visible        = true;
                    about.Visible                 = false;
                    submissionControl.Visible     = false;
                    ManageProfilesControl.Visible = false;
                    break;

                case "ndeAbout":
                    generalOptions.Visible        = false;
                    about.Visible                 = true;
                    submissionControl.Visible     = false;
                    ManageProfilesControl.Visible = false;
                    break;

                case "ndeProfiles":
                    generalOptions.Visible        = false;
                    about.Visible                 = false;
                    submissionControl.Visible     = false;
                    ManageProfilesControl.Visible = true;
                    break;

                default:
                    generalOptions.Visible        = false;
                    about.Visible                 = true;
                    submissionControl.Visible     = false;
                    ManageProfilesControl.Visible = false;
                    break;
                }
            }

            UIControl.StartWindowUpdating(this.Handle);
            this.Invalidate(true);
        }