Esempio n. 1
0
        }  //  static public void CloseMainForm()

        //
        //  static public void OpenProfileEditor
        //
        //  This method is the prefered way of instantiating the Profile editing form, frmProfile.
        //

        static public void OpenProfileEditor(object SelectedMenuItem, EventArgs e)
        {
            ProfileEditor = new frmProfile();

            if (ProfileEditor == null)
            {
                return;
            }

            //  For now, at least, stop listening if the Profile is in danger of being edited.

            StopListening(null, null);

            //  We don't want the user to be able to open two instances of the Profile editing form, so let's
            //  disable the system tray menu item.

            sysTrayMenu.MenuItems[MODIFY_PROFILE_MENU_ITEM].Enabled = false;

            //  And we don't want the user to be able to listen on commands while we're editing the Profile (at
            //  least yet)...

            sysTrayMenu.MenuItems[LISTEN_MENU_ITEM].Enabled = false;

            ProfileEditor.ShowDialog();

            CloseProfileEditor();

            return;
        }  //  static public void OpenProfileEditor
Esempio n. 2
0
        private void modifyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                frmProfile modProfileFrm = new frmProfile();

                //
                //  VI_Profile takes care of tracking changes and the saved/unsaved state of the current Profile.
                //  We can act on this knowledge to update the status in the UI and also inform the user of those
                //  unsaved changes should they choose a potentially destructive act (exiting the program, opening
                //  an existing Profile).
                //

                modProfileFrm.ShowDialog();

                btmStripStatus.Text = "NOT LISTENING: " + (GAVPI.vi_profile.IsEdited() ? "[UNSAVED] " : " ") +
                                      Path.GetFileNameWithoutExtension(GAVPI.vi_profile.ProfileFilename);

                //  Allow the user to start issuing voice commands if we have an actual Profile...

                btnMainListen.Enabled = !GAVPI.vi_profile.IsEmpty();

                modProfileFrm.Dispose();
            }
            catch (Exception profile_exception)
            {
                MessageBox.Show("Profile Editor Crashed.\n" + profile_exception.Message, "Error",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Exclamation,
                                MessageBoxDefaultButton.Button1);
            }
            finally
            {
            }
        }
Esempio n. 3
0
        //
        //  static public void OpenProfileEditor
        //
        //  This method is the prefered way of instantiating the Profile editing form, frmProfile.
        //
        public static void OpenProfileEditor( object SelectedMenuItem, EventArgs e )
        {
            ProfileEditor = new frmProfile();

            if( ProfileEditor == null ) return;

            //  For now, at least, stop listening if the Profile is in danger of being edited.

            StopListening( null, null );

            //  We don't want the user to be able to open two instances of the Profile editing form, so let's
            //  disable the system tray menu item.

            sysTrayMenu.MenuItems[ MODIFY_PROFILE_MENU_ITEM ].Enabled = false;

            //  And we don't want the user to be able to listen on commands while we're editing the Profile (at
            //  least yet)...

            sysTrayMenu.MenuItems[ LISTEN_MENU_ITEM ].Enabled = false;

            ProfileEditor.ShowDialog();

            CloseProfileEditor();

            return;
        }