Example #1
0
        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
        }
Example #2
0
 static public List <HistoryEntry> CheckFilterTrue(List <HistoryEntry> he, Conditions.ConditionLists cond, Conditions.ConditionVariables othervars) // conditions match for item to stay
 {
     if (cond.Count == 0)                                                                                                                           // no filters, all in
     {
         return(he);
     }
     else
     {
         string er;
         List <HistoryEntry> ret = (from s in he where cond.CheckFilterTrue(s.journalEntry, new Conditions.ConditionVariables[] { othervars, new Conditions.ConditionVariables("Note", s.snc?.Note ?? "") }, out er, null) select s).ToList();
         return(ret);
     }
 }
Example #3
0
 private void buttonField_Click(object sender, EventArgs e)
 {
     Conditions.ConditionFilterForm frm = new Conditions.ConditionFilterForm();
     frm.InitFilter("Journal: Filter out fields", EDDiscovery.EliteDangerous.JournalEntry.GetListOfEventsWithOptMethod(false),
                    (s) => { return(BaseUtils.FieldNames.GetPropertyFieldNames(EDDiscovery.EliteDangerous.JournalEntry.TypeOfJournalEntry(s))); },
                    discoveryform.Globals.NameList, fieldfilter);
     frm.TopMost = this.FindForm().TopMost;
     if (frm.ShowDialog(this.FindForm()) == DialogResult.OK)
     {
         fieldfilter = frm.result;
         SQLiteDBClass.PutSettingString(DbFieldFilter, fieldfilter.GetJSON());
         Display(current_historylist);
     }
 }
Example #4
0
 private void buttonField_Click(object sender, EventArgs e)
 {
     Conditions.ConditionFilterForm frm = new Conditions.ConditionFilterForm();
     frm.InitFilter("History: Filter out fields",
                    System.Drawing.Icon.ExtractAssociatedIcon(System.Reflection.Assembly.GetExecutingAssembly().Location),
                    JournalEntry.GetListOfEventsWithOptMethod(false),
                    (s) => { return(BaseUtils.FieldNames.GetPropertyFieldNames(JournalEntry.TypeOfJournalEntry(s))); },
                    discoveryform.Globals.NameList, fieldfilter);
     if (frm.ShowDialog(this.FindForm()) == DialogResult.OK)
     {
         fieldfilter = frm.result;
         SQLiteDBClass.PutSettingString(DbFieldFilter, fieldfilter.GetJSON());
         HistoryChanged(current_historylist);
     }
 }
Example #5
0
        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);
            }
        }
Example #6
0
        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.GetListOfEventsWithOptMethod(false),
                           (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);
            }
        }
Example #7
0
        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);
            }
        }