static void ReportEntry(ActionProgramRun ap, List<HistoryEntry> hl, int pos, string prefix) { if (hl != null && pos >= 0 && pos < hl.Count) // if within range.. (1 based) { try { Variables values = new Variables(); ActionVars.HistoryEventVars(values, hl[pos], prefix); ActionVars.ShipBasicInformation(values, hl[pos].ShipInformation, prefix); ActionVars.SystemVars(values, hl[pos].System, prefix); ap.Add(values); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("Exception reporting entry variables in event " + ex.Message); } ap[prefix + "JID"] = hl[pos].Journalid.ToStringInvariant(); ap[prefix + "Count"] = hl.Count.ToString(System.Globalization.CultureInfo.InvariantCulture); // give a count of matches } else { ap[prefix + "JID"] = "0"; ap[prefix + "Count"] = "0"; } }
static void ReportHistoryEntry(ActionProgramRun ap, HistoryEntry he, string prefix) { try { ConditionVariables values = new ConditionVariables(); ActionVars.HistoryEventVars(values, he, prefix); ActionVars.ShipInformation(values, he.ShipInformation, prefix, true); ActionVars.SystemVars(values, he.System, prefix); ap.Add(values); } catch { } }
static void ReportEntry(ActionProgramRun ap, List <HistoryEntry> hl, int pos, string prefix) { if (hl != null && pos >= 0 && pos < hl.Count) // if within range.. (1 based) { try { ConditionVariables values = new ConditionVariables(); ActionVars.HistoryEventVars(values, hl[pos], prefix); ActionVars.ShipBasicInformation(values, hl[pos].ShipInformation, prefix); ActionVars.SystemVars(values, hl[pos].System, prefix); ap.Add(values); } catch { } ap[prefix + "Count"] = hl.Count.ToString(System.Globalization.CultureInfo.InvariantCulture); // give a count of matches } else { ap[prefix + "JID"] = "0"; ap[prefix + "Count"] = "0"; } }