From 9651a1a48d6343787e608b2c9daa70eb541fffdb Mon Sep 17 00:00:00 2001 From: emkael Date: Sat, 26 Nov 2016 17:33:24 +0100 Subject: * selected sections list initialization and value getter --- Aktywator/Bws.cs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'Aktywator/Bws.cs') diff --git a/Aktywator/Bws.cs b/Aktywator/Bws.cs index 381e10f..3331ae0 100644 --- a/Aktywator/Bws.cs +++ b/Aktywator/Bws.cs @@ -27,7 +27,16 @@ namespace Aktywator this._filename = filename; sql = new Sql(filename); this.main = main; - main.lWczytywane.Text = this.getBoardRangeText(this.getSections().Split(',')); + string[] sections = this.getSections().Split(','); + main.lWczytywane.Text = this.getBoardRangeText(sections); + foreach (string section in sections) + { + main.cblSections.Items.Add(this.sectorNumberToLetter(Int16.Parse(section))); + } + for (int i = 0; i < main.cblSections.Items.Count; i++) + { + main.cblSections.SetItemChecked(i, true); + } } private int sectorLetterToNumber(string sector) @@ -58,6 +67,16 @@ namespace Aktywator return sb.ToString(); } + public string[] getSelectedSections() + { + List sections = new List(); + foreach (string section in main.cblSections.CheckedItems) + { + sections.Add(this.sectorLetterToNumber(section).ToString()); + } + return sections.ToArray(); + } + public void initSettings() { settings = new List(); -- cgit v1.2.3