diff options
author | emkael <emkael@tlen.pl> | 2016-11-26 17:33:24 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2016-11-26 17:33:24 +0100 |
commit | 9651a1a48d6343787e608b2c9daa70eb541fffdb (patch) | |
tree | 59123979014a007617534f5b239aa22b92efed47 | |
parent | fa0dcd71f06467f474864e96740dfce4197e3137 (diff) |
* selected sections list initialization and value getter
-rw-r--r-- | Aktywator/Bws.cs | 21 |
1 files changed, 20 insertions, 1 deletions
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<string> sections = new List<string>(); + foreach (string section in main.cblSections.CheckedItems) + { + sections.Add(this.sectorLetterToNumber(section).ToString()); + } + return sections.ToArray(); + } + public void initSettings() { settings = new List<Setting>(); |