Example #1
0
        /// <summary>
        /// Creates a line and checks existing rules against it
        /// </summary>
        /// <param name="line">line string value</param>
        /// <returns>LogLineData item</returns>
        private LogLineData CreateLineData(string line)
        {
            if (_ruleService == null)
            {
                _ruleService = Mvx.Resolve <IFormattingRuleService>();
            }

            var newLine = new LogLineData(line);

            _ruleService.CheckRules(newLine);

            return(newLine);
        }
Example #2
0
        public Boolean CheckRule(LogLineData line)
        {
            line.AppliedRule = null;

            if (String.IsNullOrEmpty(line.Value) || String.IsNullOrEmpty(_regex))
            {
                return(false);
            }

            if (line.Value.Contains(_regex))
            {
                line.AppliedRule = this;
                return(true);
            }

            return(false);
        }