コード例 #1
0
ファイル: MainForm.cs プロジェクト: hakanaku2009/svn-dump
        private void btnChangeUpgrade_Click(object sender, EventArgs e)
        {
            int index = lbxUpgrades.SelectedIndex;

            if (index < 0)
            {
                return;
            }
            var upgradeForm = new AddUpgradeForm();

            foreach (var upgrade in Upgrades)
            {
                upgradeForm.Upgrades.Add(upgrade.Key);
            }
            var selectedUpgrade = Upgrades[index];

            upgradeForm.UpgradeType         = selectedUpgrade.Type;
            upgradeForm.UpgradeName         = selectedUpgrade.Name;
            upgradeForm.UpgradeKey          = selectedUpgrade.Key;
            upgradeForm.UpgradeValue        = selectedUpgrade.Value;
            upgradeForm.UpgradePrice        = selectedUpgrade.Price;
            upgradeForm.UpgradeRequirements = selectedUpgrade.Requirements;
            upgradeForm.UpgradeDescription  = selectedUpgrade.Description;
            if (upgradeForm.ShowDialog() == DialogResult.OK)
            {
                Upgrades[index] = new Upgrade {
                    Type         = upgradeForm.UpgradeType,
                    Name         = upgradeForm.UpgradeName,
                    Key          = upgradeForm.UpgradeKey,
                    Price        = upgradeForm.UpgradePrice,
                    Value        = upgradeForm.UpgradeValue,
                    Requirements = upgradeForm.UpgradeRequirements,
                    Description  = upgradeForm.UpgradeDescription
                };
            }
            UpdateUpgradeList();
            lbxUpgrades.SelectedIndex = index;
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: hakanaku2009/svn-dump
        private void btnAddUpgrade_Click(object sender, EventArgs e)
        {
            var upgradeForm = new AddUpgradeForm();

            foreach (var upgrade in Upgrades)
            {
                upgradeForm.Upgrades.Add(upgrade.Key);
            }
            if (upgradeForm.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            Upgrades.Add(new Upgrade {
                Type         = upgradeForm.UpgradeType,
                Name         = upgradeForm.UpgradeName,
                Key          = upgradeForm.UpgradeKey,
                Price        = upgradeForm.UpgradePrice,
                Value        = upgradeForm.UpgradeValue,
                Requirements = upgradeForm.UpgradeRequirements,
                Description  = upgradeForm.UpgradeDescription
            });

            UpdateUpgradeList();
        }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: GodLesZ/svn-dump
		private void btnChangeUpgrade_Click(object sender, EventArgs e) {
			int index = lbxUpgrades.SelectedIndex;
			if (index < 0)
				return;
			var upgradeForm = new AddUpgradeForm();
			foreach (var upgrade in Upgrades) {
				upgradeForm.Upgrades.Add(upgrade.Key);
			}
			var selectedUpgrade = Upgrades[index];
			upgradeForm.UpgradeType = selectedUpgrade.Type;
			upgradeForm.UpgradeName = selectedUpgrade.Name;
			upgradeForm.UpgradeKey = selectedUpgrade.Key;
			upgradeForm.UpgradeValue = selectedUpgrade.Value;
			upgradeForm.UpgradePrice = selectedUpgrade.Price;
			upgradeForm.UpgradeRequirements = selectedUpgrade.Requirements;
			upgradeForm.UpgradeDescription = selectedUpgrade.Description;
			if (upgradeForm.ShowDialog() == DialogResult.OK) {
				Upgrades[index] = new Upgrade {
					Type = upgradeForm.UpgradeType,
					Name = upgradeForm.UpgradeName,
					Key = upgradeForm.UpgradeKey,
					Price = upgradeForm.UpgradePrice,
					Value = upgradeForm.UpgradeValue,
					Requirements = upgradeForm.UpgradeRequirements,
					Description = upgradeForm.UpgradeDescription
				};
			}
			UpdateUpgradeList();
			lbxUpgrades.SelectedIndex = index;
		}
コード例 #4
0
ファイル: MainForm.cs プロジェクト: GodLesZ/svn-dump
		private void btnAddUpgrade_Click(object sender, EventArgs e) {
			var upgradeForm = new AddUpgradeForm();
			foreach (var upgrade in Upgrades) {
				upgradeForm.Upgrades.Add(upgrade.Key);
			}
			if (upgradeForm.ShowDialog() != DialogResult.OK)
				return;
			Upgrades.Add(new Upgrade {
				Type = upgradeForm.UpgradeType,
				Name = upgradeForm.UpgradeName,
				Key = upgradeForm.UpgradeKey,
				Price = upgradeForm.UpgradePrice,
				Value = upgradeForm.UpgradeValue,
				Requirements = upgradeForm.UpgradeRequirements,
				Description = upgradeForm.UpgradeDescription
			});

			UpdateUpgradeList();
		}