public void AddLine(string TraitValue, LogEntry Line) { var existsInCollection = LineCollections.TryGetValue(TraitValue, out var lc); lc ??= new SingleTraitValueEventCollection() { TraitName = Name, TraitValue = TraitValue, }; lc.Add(Line); if (!existsInCollection) { LineCollections.Add(lc.TraitValue, lc); } }
/// <summary> /// Lines associated with the given index value /// </summary> /// <param name="IndexValue"></param> /// <returns></returns> /// <remarks></remarks> public LogEntryCollection <LogEntry> LinesFromTraitValue(string TraitValue) { LineCollections.TryGetValue(TraitValue, out var lc); return(lc ?? new()); }