public DownloadItemsViewModel(PoEBuild build)
 {
     DisplayName = L10n.Message("Download & Import Items");
     Build = build;
     Build.PropertyChanged += BuildOnPropertyChanged;
     BuildOnPropertyChanged(this, null);
     RequestsClose += _ => Build.PropertyChanged -= BuildOnPropertyChanged;
 }
 public PersistentData()
 {
     Options = new Options();
     CurrentBuild = new PoEBuild
     {
         Url = "http://www.pathofexile.com/passive-skill-tree/AAAAAgMA",
         Level = "1"
     };
     Builds = new List<PoEBuild>();
 }
        public PersistentData()
        {

            Options = new Options();
            CurrentBuild = new PoEBuild
            {
                Url = SkillTree.TreeAddress + SkillTree.GetCharacterURL(3),
                Level = "1"
            };
            Builds = new List<PoEBuild>();
        }
 public FormChooseBuildName(PoEBuild selectedBuild)
 {
     InitializeComponent();
     txtName.Text = selectedBuild.Name;
     txtName2.Text = selectedBuild.Note;
     txtCharacterName.Text = selectedBuild.CharacterName;
     txtAccountName.Text = selectedBuild.AccountName;
     txtItemData.Text = selectedBuild.ItemData;
     string date = selectedBuild.LastUpdated == DateTime.MinValue ? L10n.Message("Not Available") : selectedBuild.LastUpdated.ToString();
     lblLastUpdated.Content = string.Format(L10n.Message("Last updated: {0}"), date);
     txtName.Select(txtName.Text.Length, 0);
 }
Beispiel #5
0
 public static PoEBuild Copy(PoEBuild build)
 {
     return new PoEBuild
     {
         Name = build.Name,
         CharacterName = build.CharacterName,
         AccountName = build.AccountName,
         Level = build.Level,
         Class = build.Class,
         PointsUsed = build.PointsUsed,
         Url = build.Url,
         Note = build.Note,
         ItemData = build.ItemData,
     };
 }
 private BuildViewModel TreeFindBuildViewModel(PoEBuild build)
 {
     return(TreeFind <BuildViewModel>(b => b.Build == build, BuildRoot));
 }
 private void CopyToClipboard(PoEBuild build)
 {
     Clipboard.SetText(PersistentData.ExportBuild(build));
 }
        private void SetCurrentBuild(PoEBuild build)
        {
            _persistentData.CurrentBuild = PoEBuild.Copy(build);

            tbSkillURL.Text = build.Url;
            tbLevel.Text = build.Level;
            LoadItemData(build.ItemData);
        }
        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();
            }
        }
 public EditBuildViewModel(PoEBuild build)
 {
     Build = build.Copy();
 }