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)); }
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); }