private void btnSaveNewBuild_Click(object sender, RoutedEventArgs e) { FormBuildName formBuildName = new FormBuildName(); if ((bool)formBuildName.ShowDialog()) { ListViewItem lvi = new ListViewItem { Content = new PoEBuild(formBuildName.getBuildName(), cbCharType.Text + ", " + tbUsedPoints.Text + " points used", tbSkillURL.Text) }; lvi.MouseDoubleClick += lvi_MouseDoubleClick; lvSavedBuilds.Items.Add(lvi); } ; if (lvSavedBuilds.Items.Count > 0) { StringBuilder rawBuilds = new StringBuilder(); foreach (ListViewItem lvi in lvSavedBuilds.Items) { PoEBuild build = (PoEBuild)lvi.Content; rawBuilds.Append(build.name + '|' + build.description + ';' + build.url + '\n'); } File.WriteAllText("savedBuilds", rawBuilds.ToString().Trim()); } else { if (File.Exists("savedBuilds")) { File.Delete("savedBuilds"); } } }
private void btnSaveNewBuild_Click(object sender, RoutedEventArgs e) { FormBuildName formBuildName = new FormBuildName(); if ((bool)formBuildName.ShowDialog()) { ListViewItem lvi = new ListViewItem { Content = new PoEBuild(formBuildName.getBuildName(), cbCharType.Text + ", " + tbUsedPoints.Text + " points used", tbSkillURL.Text) }; lvi.MouseDoubleClick += lvi_MouseDoubleClick; lvSavedBuilds.Items.Add(lvi); } }