private void SetGroupOptions() { string list = cc.GetChecked(groupoptions.Count()); // using All or None.. on items beyond reserved entries // System.Diagnostics.Debug.WriteLine("Checked" + list); int p = 0; foreach (var eo in groupoptions) { if (eo.Tag == "All") { cc.SetChecked(p, list.Equals("All")); } else if (eo.Tag == "None") { cc.SetChecked(p, list.Equals("None")); } else if (list.MatchesAllItemsInList(eo.Tag, ';')) // exactly, tick { //System.Diagnostics.Debug.WriteLine("Checking T " + eo.Tag + " vs " + list); cc.SetChecked(p); } else if (list.ContainsAllItemsInList(eo.Tag, ';')) // contains, intermediate { //System.Diagnostics.Debug.WriteLine("Checking I " + eo.Tag + " vs " + list + list.Equals(eo.Tag)); cc.SetChecked(p, CheckState.Indeterminate); } else { //System.Diagnostics.Debug.WriteLine("Checking F " + eo.Tag + " vs " + list); cc.SetChecked(p, false); } p++; } }
public void Show(string settings, Point p, Size s, Form parent, Object tag = null, bool applytheme = true) { if (cc == null) { cc = new ExtendedControls.CheckedIconListBoxForm(); foreach (var x in groupoptions) { cc.AddItem(x.Tag, x.Text, x.Image); } foreach (var x in standardoptions) { cc.AddItem(x.Tag, x.Text, x.Image); } string[] slist = settings.SplitNoEmptyStartFinish(';'); if (slist.Length == 1 && slist[0].Equals("All")) { cc.SetCheckedFromToEnd(groupoptions.Count()); } else { cc.SetChecked(settings); } SetGroupOptions(); cc.FormClosed += FormClosed; cc.CheckedChanged += checkboxchanged; if (s.Height < 1) { s.Height = cc.HeightNeeded(); } cc.PositionSize(p, s); cc.LargeChange = cc.ItemCount * Properties.Resources.All.Height / 40; // 40 ish scroll movements cc.CloseOnDeactivate = CloseOnDeactivate; if (applytheme) { ThemeableFormsInstance.Instance?.ApplyToControls(cc, applytothis: true); } tagback = tag; cc.Show(parent); } else { cc.Close(); } }