public SubsetListScreen(AlgSet set) { StartPosition = FormStartPosition.CenterScreen; InitializeComponent(); Set = set; int startX = 50; int startY = 80; int currY = startY; File = new CustomSubsetFile("customSubsets.xml"); var subsets = File.GetSubsets(Set); var originalFile = SubsetTools.GetXmlSubsetFile(); var nameMap = originalFile.GetNameMap(Set); for (int k = 0; k < subsets.Count; k++) { var control = new SubsetListEntry(subsets[k], File, nameMap) { Location = new Point(startX, currY) }; currY += HeightPerRow; this.Controls.Add(control); } this.AutoScroll = true; }
private void SaveButton_Click(object sender, EventArgs e) { try { var nameMap = SubsetTools.GetXmlSubsetFile().GetNameMap(CustomSubset.AlgSet); var rangesWithSubsets = RangeListBox.Text; SubsetTools.ValidateAlgListInput(rangesWithSubsets, nameMap, Info.GetNumPositionsInSet(CustomSubset.AlgSet)); CustomSubset.RangeStr = rangesWithSubsets; File.SaveSubset(CustomSubset); MessageBox.Show("subset saved", "success", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (ArgumentException ex) { MessageBox.Show("An error occurred: " + ex.Message, "error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void ViewButton_Click(object sender, EventArgs e) { var screen = new SetInfoScreen(CustomSubset.AlgSet, CustomSubset.RangeStr, SubsetTools.GetXmlSubsetFile().GetNameMap(CustomSubset.AlgSet), setName: CustomSubset.Name); screen.Show(); this.ParentForm.Close(); }