Example #1
0
        } //}}}

        // SELECT .. EDIT .. SAVE
        public bool SelectProfile(string profileName) // {{{
        {
            // ..     OUT .. [CurrentProfileName] [D_Profiles.Text]
            // ..   CALLS .. ui.ApplyKeySet() (KEYMAP mode)
            // .. ENABLES .. BUTTONS
            string caller = "SelectProfile(" + profileName + ")";

            if (DX1Utility.Debug)
            {
                log(caller);
            }

            // COMMIT CURRENT PROFILE CHANGES {{{
            if ((CurrentProfileName != "") && (profileName != CurrentProfileName))
            {
                if (DX1Utility.Debug)
                {
                    log("LEAVING [" + CurrentProfileName + "] PROFILE");
                }

                ui.ApplyKeySet(caller);
            }
            //}}}
            // SEARCH AND (RE)LOAD [profileName]
            ProfileSearcher Searcher       = new ProfileSearcher();
            string          newProfileName = Searcher.ProfileSearchByName(ProfileList, profileName);

            if (_LoadProfile(newProfileName))
            {
                CurrentProfileName = newProfileName;

                // BUTTONS .. f(loaded profile)
                ui.set_D_Profiles_Text(CurrentProfileName);
                return(true);
            }
            // OR CLEAR PENDING COMMIT REQUIREMENTS
            else
            {
                keyProgrammer.notify_keyMap_commit_done();
                if (ui.C1_Profile_commit.Checked)
                {
                    ui.set_C1_Profile_commit_Checked(false);
                }

                return(false);
            }
        } //}}}