private void EditPlayer() { if (mTool != null) { if (mTextBox.Text.Length > 22) { try { PlayerEditForm form = new PlayerEditForm(); form.Colleges = mTool.GetColleges(); form.PBPs = DataMap.PBPMap; form.Photos = DataMap.PhotoMap; form.ReversePBPs = DataMap.ReversePBPMap; form.ReversePhotos = DataMap.ReversePhotoMap; form.Data = mTextBox.Text; form.SelectionStart = mTextBox.SelectionStart; if (form.ShowDialog(this) == DialogResult.OK) { SetText(form.Data); mTextBox.SelectionStart = form.SelectionStart; mTextBox.ScrollToCaret(); } form.Dispose(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } else { MessageBox.Show("List contents first.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("Please open a gamesave file first", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void EditPlayer() { try { PlayerEditForm form = new PlayerEditForm(); form.Colleges = mTool.GetColleges(); form.ReversePBPs = DataMap.ReversePBPMap; form.ReversePhotos = DataMap.ReversePhotoMap; form.PBPs = DataMap.PBPMap; form.Photos = DataMap.PhotoMap; form.Data = mTextBox.Text; form.SelectionStart = mTextBox.SelectionStart; if (form.ShowDialog(this) == DialogResult.OK) { SetText(form.Data); mTextBox.SelectionStart = form.SelectionStart; mTextBox.ScrollToCaret(); } } catch (InvalidOperationException e) { MessageBox.Show(e.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); } }