static public bool FilterHistory(HistoryEntry he, Conditions.ConditionLists cond, Conditions.ConditionVariables othervars) // true if it should be included { string er; return(cond.CheckFilterFalse(he.journalEntry, he.journalEntry.EventTypeStr, new Conditions.ConditionVariables[] { othervars, new Conditions.ConditionVariables("Note", he.snc?.Note ?? "") }, out er, null)); // true it should be included }
static public List <HistoryEntry> FilterHistory(List <HistoryEntry> he, Conditions.ConditionLists cond, Conditions.ConditionVariables othervars, out int count) // filter in all entries { count = 0; if (cond.Count == 0) // no filters, all in { return(he); } else { string er; List <HistoryEntry> ret = (from s in he where cond.CheckFilterFalse(s.journalEntry, s.journalEntry.EventTypeStr, othervars, out er, null) select s).ToList(); count = he.Count - ret.Count; return(ret); } }
static public List <HistoryEntry> MarkHistory(List <HistoryEntry> he, Conditions.ConditionLists cond, Conditions.ConditionVariables othervars, out int count) // Used for debugging it.. { count = 0; if (cond.Count == 0) // no filters, all in { return(he); } else { List <HistoryEntry> ret = new List <HistoryEntry>(); foreach (HistoryEntry s in he) { List <Conditions.Condition> list = new List <Conditions.Condition>(); // don't want it int mrk = s.EventDescription.IndexOf(":::"); if (mrk >= 0) { s.EventDescription = s.EventDescription.Substring(mrk + 3); } string er; if (!cond.CheckFilterFalse(s.journalEntry, s.journalEntry.EventTypeStr, new Conditions.ConditionVariables[] { othervars, new Conditions.ConditionVariables("Note", s.snc?.Note ?? "") }, out er, list)) { //System.Diagnostics.Debug.WriteLine("Filter out " + s.Journalid + " " + s.EntryType + " " + s.EventDescription); s.EventDescription = "!" + list[0].eventname + ":::" + s.EventDescription; count++; } ret.Add(s); } return(ret); } }