private void buttonField_Click(object sender, EventArgs e) { ExtendedConditionsForms.ConditionFilterForm frm = new ExtendedConditionsForms.ConditionFilterForm(); List <string> namelist = new List <string>() { "Note" }; namelist.AddRange(discoveryform.Globals.NameList); frm.InitFilter("Journal: Filter out fields", Icon.ExtractAssociatedIcon(System.Reflection.Assembly.GetExecutingAssembly().Location), JournalEntry.GetNameOfEvents(), (s) => { return(BaseUtils.TypeHelpers.GetPropertyFieldNames(JournalEntry.TypeOfJournalEntry(s))); }, namelist, fieldfilter); if (frm.ShowDialog(this.FindForm()) == DialogResult.OK) { fieldfilter = frm.Result; SQLiteDBClass.PutSettingString(DbFieldFilter, fieldfilter.GetJSON()); Display(current_historylist); } }
static public BaseUtils.ConditionLists ShowDialog(System.Windows.Forms.Form parent, BaseUtils.ConditionLists fieldfilter, EDDiscoveryForm discoveryform, string title) { ExtendedConditionsForms.ConditionFilterForm frm = new ExtendedConditionsForms.ConditionFilterForm(); frm.VariableNamesEvents += (s) => { return(BaseUtils.TypeHelpers.GetPropertyFieldNames(JournalEntry.TypeOfJournalEntry(s))); }; frm.VariableNames = (from x in discoveryform.Globals.NameList select new BaseUtils.TypeHelpers.PropertyNameInfo(x, "Global Variable String or Number" + Environment.NewLine + "Not part of the event, set up by either EDD or one of the action packs")).ToList(); frm.VariableNames.Add(new BaseUtils.TypeHelpers.PropertyNameInfo("Note", "String")); frm.InitFilter(title, parent.Icon, JournalEntry.GetNameOfEvents(), fieldfilter); if (frm.ShowDialog(parent) == System.Windows.Forms.DialogResult.OK) { return(frm.Result); } else { return(null); } }