Inheritance: System.Windows.Forms.Form
示例#1
0
        /// <summary>
        /// Prompts user to create a new profile.
        /// </summary>
        void CreateProfile()
        {
            DlgProfile dlg = new DlgProfile();
            DialogResult res = dlg.ShowDialog();
            if( res == System.Windows.Forms.DialogResult.OK ) {
                Cursor = Cursors.WaitCursor;
                currentProfile = dlg.Profile;
                gameData = currentProfile.GameData;
                AddStatus( GlobalStrings.MainForm_ProfileCreated );
                if( dlg.DownloadNow ) {
                    UpdateProfileDownload( false );
                }

                if( dlg.ImportNow ) {
                    UpdateProfileImport( false );
                }
                if( dlg.SetStartup ) {
                    settings.StartupAction = StartupAction.Load;
                    settings.ProfileToLoad = currentProfile.FilePath;
                    settings.Save();
                }

                FullListRefresh();

                Cursor = Cursors.Default;
            }
            OnProfileChange();
        }
示例#2
0
 /// <summary>
 /// Prompts the user to modify the currently loaded profile.
 /// </summary>
 void EditProfile()
 {
     if( ProfileLoaded ) {
         DlgProfile dlg = new DlgProfile( currentProfile );
         if( dlg.ShowDialog() == DialogResult.OK ) {
             AddStatus( GlobalStrings.MainForm_ProfileEdited );
             MakeChange( true );
             Cursor = Cursors.WaitCursor;
             bool refresh = false;
             if( dlg.DownloadNow ) {
                 UpdateProfileDownload( false );
                 refresh = true;
             }
             if( dlg.ImportNow ) {
                 UpdateProfileImport( false );
                 refresh = true;
             }
             if( dlg.SetStartup ) {
                 settings.StartupAction = StartupAction.Load;
                 settings.ProfileToLoad = currentProfile.FilePath;
                 settings.Save();
             }
             Cursor = Cursors.Default;
             if( refresh ) {
                 FullListRefresh();
             }
         }
     } else {
         if( MessageBox.Show( GlobalStrings.MainForm_NoProfileLoaded, GlobalStrings.DBEditDlg_Error, MessageBoxButtons.YesNo, MessageBoxIcon.Warning ) == DialogResult.Yes ) {
             CreateProfile();
         }
     }
 }
示例#3
0
        /// <summary>
        /// Prompts user to create a new profile.
        /// </summary>
        void CreateProfile() {
            DlgProfile dlg = new DlgProfile();
            DialogResult res = dlg.ShowDialog();
            if( res == System.Windows.Forms.DialogResult.OK ) {
                Cursor = Cursors.WaitCursor;
                currentProfile = dlg.Profile;
                AddStatus( GlobalStrings.MainForm_ProfileCreated );
                if( dlg.DownloadNow ) {
                    UpdateLibrary();
                }

                if( dlg.ImportNow ) {
                    ImportConfig();
                }
                if( dlg.SetStartup ) {
                    Settings.Instance.StartupAction = StartupAction.Load;
                    Settings.Instance.ProfileToLoad = currentProfile.FilePath;
                    Settings.Instance.Save();
                }

                FullListRefresh();

                Cursor = Cursors.Default;
            }
            OnProfileChange();
        }