Ejemplo n.º 1
0
        public FilterResult Next(FilterResult result)
        {
            result = Enabled ? Execute(result) : result;

            if (DownstreamMember != null)
            {
                return DownstreamMember.Next(result);
            }

            return result;
        }
Ejemplo n.º 2
0
        protected override FilterResult Execute(FilterResult filterResult)
        {
            if (filterResult.IsMatch && trimTo != null)
            {
                var line = filterResult.Result;

                var toIndex = trimTo.IsMatch(line) ? trimTo.Match(line).Index : -1;

                if (toIndex != -1 && toIndex < line.Length)
                {
                    filterResult.Result = line.Substring(toIndex);
                }
            }

            return filterResult;
        }
Ejemplo n.º 3
0
        protected override FilterResult Execute(FilterResult filterResult)
        {
            if (filterResult.IsMatch && trimMiddle != null)
            {
                var line = filterResult.Result;

                var match = trimMiddle.Match(line);

                if (match.Groups.Count >= 2)
                {
                    var start = match.Groups[0].Index;
                    var end = match.Groups[match.Groups.Count - 1].Index + match.Groups[match.Groups.Count - 1].Length;

                    filterResult.Result = line.Remove(start, end - start);
                }
            }

            return filterResult;
        }
Ejemplo n.º 4
0
 protected override FilterResult Execute(FilterResult result)
 {
     return(GetResult(result.Result));
 }
Ejemplo n.º 5
0
 protected override FilterResult Execute(FilterResult result)
 {
     return GetResult(result.Result);
 }
Ejemplo n.º 6
0
 protected abstract FilterResult Execute(FilterResult result);
Ejemplo n.º 7
0
 protected abstract FilterResult Execute(FilterResult result);