コード例 #1
0
ファイル: DlgProfile.cs プロジェクト: ppm6/Depressurizer
        private bool Apply()
        {
            if (radSelUserByURL.Checked)
            {
                CDlgGetSteamID dlg = new CDlgGetSteamID(txtUserUrl.Text);
                dlg.ShowDialog();

                if (dlg.DialogResult == DialogResult.Cancel)
                {
                    return(false);
                }

                if (dlg.Success == false || dlg.SteamID == 0)
                {
                    MessageBox.Show(this, GlobalStrings.DlgProfile_CouldNotFindSteamProfile, GlobalStrings.DBEditDlg_Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return(false);
                }

                txtUserID.Text = dlg.SteamID.ToString();
            }

            if (editMode)
            {
                if (ValidateEntries())
                {
                    SaveModifiables(Profile);
                    return(true);
                }

                return(false);
            }

            return(CreateProfile());
        }
コード例 #2
0
        private bool Apply() {
            if( radSelUserByURL.Checked ) {
                CDlgGetSteamID dlg = new CDlgGetSteamID( txtUserUrl.Text );
                dlg.ShowDialog();

                if( dlg.DialogResult == System.Windows.Forms.DialogResult.Cancel ) {
                    return false;
                }

                if( dlg.Success == false || dlg.SteamID == 0 ) {
                    MessageBox.Show( this, GlobalStrings.DlgProfile_CouldNotFindSteamProfile, GlobalStrings.DBEditDlg_Error, MessageBoxButtons.OK, MessageBoxIcon.Error );
                    return false;
                }

                txtUserID.Text = dlg.SteamID.ToString();
            }
            if( editMode ) {
                if( ValidateEntries() ) {
                    SaveModifiables( Profile );
                    return true;
                }
                return false;
            } else {
                return CreateProfile();
            }
        }