Exemplo n.º 1
0
 public bool Equals(LogFilter filter)
 {
     return(this.collapse == filter.collapse &&
            this.showTime == filter.showTime &&
            this.showLog == filter.showLog &&
            this.showWarning == filter.showWarning &&
            this.showError == filter.showError &&
            this.searchWithRegex == filter.searchWithRegex &&
            this.searchText.Equals(filter.searchText));
 }
Exemplo n.º 2
0
        public List <LogData> GetFilteredLogList(LogFilter filter, bool forceUpdate = false)
        {
            if (forceUpdate || this.logFilter.Equals(filter) == false)
            {
                var selectedLog = this.selectedLog;
                this.filteredLogList.Clear();
                this.selectedLogIndex = -1;
                var logList = (filter.collapse && !filter.showTime) ? this.collapsedLogList : this.logList;
                for (int i = 0; i < logList.Count; i++)
                {
                    var log = logList[i];
                    if (log == null)
                    {
                        continue;
                    }

                    if (filter.ShouldDisplay(log))
                    {
                        this.filteredLogList.Add(log);

                        if (filter.collapse)
                        {
                            if (log.Equals(selectedLog))
                            {
                                this.selectedLogIndex = this.filteredLogList.Count - 1;
                            }
                        }
                        else
                        {
                            if (log == selectedLog)
                            {
                                this.selectedLogIndex = this.filteredLogList.Count - 1;
                            }
                        }
                    }
                }

                this.logFilter = filter;
            }

            return(filteredLogList);
        }