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.CheckedIconListBoxFilterForm cfs = new ExtendedControls.CheckedIconListBoxFilterForm(); cfs.AllOrNoneBack = false; // we want the whole list, makes it easier. cfs.Closing += TagsChanged; 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.Filter(taglist, loc, new Size(250, 600), this.FindForm(), tag: rw); }
public override void Init() { searchtimer = new Timer() { Interval = 500 }; searchtimer.Tick += Searchtimer_Tick; GlobalCaptainsLogList.Instance.OnLogEntryChanged += LogChanged; BaseUtils.Translator.Instance.Translate(this, new Control[] { }); BaseUtils.Translator.Instance.Translate(contextMenuStrip, this); BaseUtils.Translator.Instance.Translate(toolTip, this); ColNote.DefaultCellStyle.WrapMode = DataGridViewTriState.True; dataGridView.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells; dataGridView.DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopLeft; LoadTags(); dateTimePickerStartDate.Value = SQLiteConnectionUser.GetSettingDate(DbStartDate, new DateTime(2014, 12, 14)); dateTimePickerStartDate.Checked = SQLiteConnectionUser.GetSettingBool(DbStartDateOn, false); dateTimePickerEndDate.Value = SQLiteConnectionUser.GetSettingDate(DbEndDate, new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day)); dateTimePickerEndDate.Checked = SQLiteConnectionUser.GetSettingBool(DbEndDateOn, false); dateTimePickerStartDate.ValueChanged += (s, e) => { if (!updateprogramatically) { Display(); } }; dateTimePickerEndDate.ValueChanged += (s, e) => { if (!updateprogramatically) { Display(); } }; discoveryform.OnRefreshCommanders += Discoveryform_OnRefreshCommanders; cfs = new ExtendedControls.CheckedIconListBoxFilterForm(); cfs.AllOrNoneBack = false; // we want the whole list, makes it easier. cfs.SaveBack += TagsChanged; }