public void DisplayLog(LogLineCollection log) { if (log == null) { throw new ArgumentNullException("log"); } Log = log; }
protected void DisplaySelectedLogs(object sender, SelectionChangedEventArgs e) { List <string> texts = new List <string>(logFileListView.SelectedItems.Count); foreach (object o in logFileListView.SelectedItems) { string path = (string)o; string text = logReader.GetFileContents(path); texts.Add(text); } LogLineCollection c = logReader.GetCollectedLog(texts); DisplayLog(c); }
public LogLineCollection GetCollectedLog(List <string> texts) { if (texts == null) { throw new ArgumentNullException("texts"); } LogLineCollection all = new LogLineCollection(); foreach (string text in texts) { LogLineCollection c = LogLineCollection.GetLogLineCollection(text); all.AddRange(c); } all.Sort(); return(all); }
public static LogLineCollection GetLogLineCollection(string log) { if (log == null) { throw new ArgumentNullException("log"); } LogLineCollection c = new LogLineCollection(); string[] split = log.Split(separator, StringSplitOptions.RemoveEmptyEntries); foreach (string s in split) { LogLine logLine = LogLine.TryGetLogLine(s); if (logLine != null) { c.Add(logLine); } } return(c); }