Exemplo n.º 1
0
        private LogFilter GetFilterObjectFromUI()
        {
            LogFilter FilterObj = null;

            object         BoxVal   = 0;
            FilterOperator Op       = (FilterOperator)cbFilterOp.SelectedIndex;
            FilterSection  Sect     = (FilterSection)cbFilterSection.SelectedIndex;
            DebugType      DebType  = (DebugType)(cbSectionValues.SelectedIndex + 1);
            string         StrValue = txtValue.Text;

            switch (Sect)
            {
            case FilterSection.LogTypeSection:
                BoxVal = DebType;
                break;

            case FilterSection.TagSection:
            case FilterSection.MessageSection:
                BoxVal = txtValue.Text;
                break;

            case FilterSection.PidSection:
            {
                try
                {
                    BoxVal = int.Parse(StrValue);
                }
                catch { }

                break;
            }
            }


            FilterObj = new LogFilter(Op, BoxVal, Sect);

            FilterObj.UseRegexp = chkUseRegexp.Checked;

            return(FilterObj);
        }
Exemplo n.º 2
0
 public LogFilter(FilterOperator Op, object value, FilterSection section)
 {
     Oper  = Op;
     Value = value;
     Sect  = section;
 }
Exemplo n.º 3
0
 public LogFilter(FilterOperator Op, object value, FilterSection section)
 {
     Oper = Op;
     Value = value;
     Sect = section;
 }
        public static IFilter ToFilter(this FilterSection filterSection)
        {
            var filterRepository = filterSection == null ? null : CreateFilterRepository(filterSection.Included, filterSection.Excluded);

            return(filterRepository == null ? null : new ItemFilter(filterRepository));
        }
 public static IFilterRepository ToFilterRepository(this FilterSection filterSection)
 {
     return(filterSection == null ? null : CreateFilterRepository(filterSection.Included, filterSection.Excluded));
 }