Beispiel #1
0
        public void DisplayLog(LogLineCollection log)
        {
            if (log == null)
            {
                throw new ArgumentNullException("log");
            }

            Log = log;
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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);
        }