public void FilterButton(string db, Control ctr, Color back, Color fore, Form parent, List <string> list) { cc = new ExtendedControls.CheckedIconListBoxFormGroup(); cc.AddAllNone(); foreach (var s in list) { cc.AddStandardOption(s, s); } cc.SaveSettings += (s, o) => { EliteDangerousCore.DB.UserDatabase.Instance.PutSettingString(db, s); Changed?.Invoke(); }; cc.Show(EliteDangerousCore.DB.UserDatabase.Instance.GetSettingString(db, "All"), ctr, parent); }
private void EditTags(DataGridViewRow rw) { List <string> Dickeys = new List <string>(EDDConfig.Instance.CaptainsLogTagImage.Keys); Dickeys.Sort(); List <Tuple <string, string, Image> > options = (from x in Dickeys select new Tuple <string, string, Image>(x.ToString(), x.ToString(), EDDConfig.Instance.CaptainsLogTagImage[x])).ToList(); ExtendedControls.CheckedIconListBoxFormGroup cfs = new ExtendedControls.CheckedIconListBoxFormGroup(); cfs.AllOrNoneBack = false; // we want the whole list, makes it easier. cfs.SaveSettings += TagsChanged; cfs.AddAllNone(); cfs.AddStandardOption(options); List <string> curtags = rw.Cells[4].Tag as List <string>; // may be null string taglist = curtags != null?string.Join(";", curtags) : ""; System.Diagnostics.Debug.WriteLine("Cur keys" + curtags); Point loc = dataGridView.PointToScreen(dataGridView.GetCellDisplayRectangle(4, rw.Index, false).Location); cfs.Show(taglist, loc, this.FindForm(), tag: rw); }