Пример #1
0
 private void lvi_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
 {
     var selectedBuild = (PoEBuild)lvSavedBuilds.SelectedItem;
     var formBuildName = new FormChooseBuildName(selectedBuild);
     formBuildName.Owner = this;
     var show_dialog = formBuildName.ShowDialog();
     if (show_dialog != null && (bool)show_dialog)
     {
         selectedBuild.Name = formBuildName.GetBuildName();
         selectedBuild.Note = formBuildName.GetNote();
         selectedBuild.CharacterName = formBuildName.GetCharacterName();
         selectedBuild.AccountName = formBuildName.GetAccountName();
         selectedBuild.ItemData = formBuildName.GetItemData();
         lvSavedBuilds.Items.Refresh();
     }
     SaveBuildsToFile();
 }
Пример #2
0
        private void SaveNewBuild()
        {
            var formBuildName = new FormChooseBuildName(_persistentData.CurrentBuild.CharacterName, _persistentData.CurrentBuild.AccountName, _persistentData.CurrentBuild.ItemData);
            formBuildName.Owner = this;
            var show_dialog = formBuildName.ShowDialog();
            if (show_dialog != null && (bool)show_dialog)
            {
                var newBuild = new PoEBuild
                {
                    Name = formBuildName.GetBuildName(),
                    Level = tbLevel.Text,
                    Class = cbCharType.Text,
                    PointsUsed = tbUsedPoints.Text,
                    Url = tbSkillURL.Text,
                    Note = formBuildName.GetNote(),
                    CharacterName = formBuildName.GetCharacterName(),
                    AccountName = formBuildName.GetAccountName(),
                    ItemData = formBuildName.GetItemData(),
                    LastUpdated = DateTime.Now
                };
                SetCurrentBuild(newBuild);
                lvSavedBuilds.Items.Add(newBuild);
            }

            if (lvSavedBuilds.Items.Count > 0)
            {
                SaveBuildsToFile();
            }
        }