コード例 #1
0
ファイル: frmCreate.cs プロジェクト: janhelke/chummer2
        private void cmdAddImprovement_Click(object sender, EventArgs e)
        {
            frmCreateImprovement frmPickImprovement = new frmCreateImprovement(_objCharacter);
            frmPickImprovement.ShowDialog(this);

            if (frmPickImprovement.DialogResult == DialogResult.Cancel)
                return;

            UpdateCharacterInfo();

            _blnIsDirty = true;
            UpdateWindowTitle();
        }
コード例 #2
0
ファイル: frmCreate.cs プロジェクト: janhelke/chummer2
        private void treImprovements_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                if (treImprovements.SelectedNode.Level > 0)
                {
                    Improvement objImprovement = new Improvement();
                    foreach (Improvement objCharacterImprovement in _objCharacter.Improvements)
                    {
                        if (objCharacterImprovement.SourceName == treImprovements.SelectedNode.Tag.ToString())
                        {
                            objImprovement = objCharacterImprovement;
                            break;
                        }
                    }

                    // Edit the selected Improvement.
                    frmCreateImprovement frmPickImprovement = new frmCreateImprovement(_objCharacter);
                    frmPickImprovement.EditImprovementObject = objImprovement;
                    frmPickImprovement.ShowDialog(this);

                    if (frmPickImprovement.DialogResult != DialogResult.Cancel)
                    {
                        UpdateCharacterInfo();

                        _blnIsDirty = true;
                        UpdateWindowTitle();
                    }
                }
            }
            catch
            {
            }
        }