internal LogTypeSort(ApplicationClass application, string name, LogTypeSort parent) { this.m_Application = application; this.Name = name; this.Parent = parent; this.Children = new LogTypeSortCollection(); this.LogTypes = new LogTypeCollection(); }
private void GetLogTypes(LogTypeSort logTypeSort, List <LogType> lst) { foreach (LogType logType in logTypeSort.LogTypes) { if (lst.Contains(logType) == false) { lst.Add(logType); } } foreach (LogTypeSort children in logTypeSort.Children) { this.GetLogTypes(children, lst); } }
internal LogTypeSort FindSort(string sortPath) { string[] strSortNames = sortPath.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); if (strSortNames.Length == 0) { return(this); } else { foreach (LogTypeSort children in this.Children) { if (children.Name.Equals(strSortNames[0])) { if (strSortNames.Length == 1) { return(children); } else { string strSortName = ""; for (int intIndex = 1; intIndex < strSortNames.Length; intIndex++) { strSortName += '/' + strSortNames[intIndex]; } return(children.FindSort(strSortName.Substring(1))); } } } LogTypeSort sort = new LogTypeSort(this.m_Application, strSortNames[0], this); this.Children.Add(sort); if (strSortNames.Length == 1) { return(sort); } else { string strSortName = ""; for (int intIndex = 1; intIndex < strSortNames.Length; intIndex++) { strSortName += '/' + strSortNames[intIndex]; } return(sort.FindSort(strSortName.Substring(1))); } } }
/// <summary> /// 按照日志类型或日志分类筛选日志,可通过 LogTypeSorts 或 LogTypes 属性添加需要筛选的类型。 /// </summary> /// <param name="logTypeSort"></param> public LogTypeFilter(LogTypeSort logTypeSort) { this.LogTypeSorts.Add(logTypeSort); }