void HandleKeywordsClick(object sender, EventArgs e) { List <string> allitems = LayoutDetails.Instance.TableLayout.GetListOfStringsFromSystemTable(LayoutDetails.SYSTEM_KEYWORDS, 1); List <string> checkeditems = new List <string> (); string[] temp = GetKeywords(); if (temp != null && temp.Length > 0) { checkeditems = new List <string> (temp); } CheckBoxForm checkers = new CheckBoxForm(allitems, checkeditems, Loc.Instance.GetString("Keywords"), appframe.MainFormBase.MainFormIcon, LayoutDetails.ButtonHeight); checkers.Height = 600; if (checkers.ShowDialog() == DialogResult.OK) { string result = Constants.BLANK; foreach (string s in checkers.GetItems()) { string delim = Constants.BLANK; if (result != Constants.BLANK) { delim = "|"; } result = String.Format("{0}{1}{2}", result, delim, s); } Notes.Keywords = result; // need to redraw the keywords UpdateHeader(); Layout.SetSaveRequired(true); } }
public void TestAddingAndRetrievingValues() { List <string> All = new List <string>(); All.Add("add"); All.Add("snakes"); All.Add("boomers"); All.Add("firefox"); All.Add("alien"); List <string> Selected = new List <string>(); Selected.Add("snakes"); Selected.Add("alien"); CheckBoxForm checkers = new CheckBoxForm(All, Selected, "boo", null, 25); // should not be equal because list comes back sorted Assert.AreNotEqual(checkers.GetItems(), Selected); Selected.Sort(); Assert.AreEqual(checkers.GetItems(), Selected); }
void HandleKeywordsClick(object sender, EventArgs e) { List<string> allitems = LayoutDetails.Instance.TableLayout.GetListOfStringsFromSystemTable(LayoutDetails.SYSTEM_KEYWORDS,1); List<string> checkeditems = new List<string> (); string[] temp = GetKeywords(); if (temp != null && temp.Length > 0) { checkeditems = new List<string> (temp); } CheckBoxForm checkers = new CheckBoxForm (allitems, checkeditems, Loc.Instance.GetString ("Keywords"), appframe.MainFormBase.MainFormIcon, LayoutDetails.ButtonHeight); checkers.Height = 600; if (checkers.ShowDialog () == DialogResult.OK) { string result = Constants.BLANK; foreach (string s in checkers.GetItems()) { string delim = Constants.BLANK; if (result != Constants.BLANK) { delim = "|"; } result = String.Format ("{0}{1}{2}", result, delim, s); } Notes.Keywords = result; // need to redraw the keywords UpdateHeader(); Layout.SetSaveRequired(true); } }