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); } }
private void GotoScreen(ScreenType targetScreenType) { propMenuItem.Visible = false; currentScreenType = targetScreenType; ReleaseCheckedMenu(); switch (targetScreenType) { case ScreenType.Welcome: _ = new WelcomeForm { panel1 = { Parent = panel1 } }; break; case ScreenType.Button: _ = new ButtonForm { panel1 = { Parent = panel1 } }; break; case ScreenType.CheckBox: _ = new CheckBoxForm { panel1 = { Parent = panel1 } }; break; case ScreenType.RadioButton: _ = new RadioButtonForm { panel1 = { Parent = panel1 } }; break; case ScreenType.MessageBox: _ = new MessageBoxForm { panel1 = { Parent = panel1 } }; break; case ScreenType.ProgressBar: _ = new ProgressBarForm(propMenuItem) { panel1 = { Parent = panel1 } }; propMenuItem.Visible = true; break; default: throw new ArgumentOutOfRangeException(nameof(targetScreenType), targetScreenType, null); } var element = controlsMenuItem.Items.Cast <MenuItem>().FirstOrDefault(x => (ScreenType)x.Tag == targetScreenType); if (element != null) { element.Checked = 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); } }