Esempio n. 1
0
        public MatchModel(IMatchModelMapper matchModelMapper, string text)
        {
            _path             = null;
            _matchModelMapper = matchModelMapper;

            MatchSubstring        substring  = new MatchSubstring(text, false);
            List <MatchSubstring> substrings = new List <MatchSubstring> {
                substring
            };

            _matchedText = new MatchString(substrings);

            _textBlock = GetTextBlock(_matchedText);
        }
Esempio n. 2
0
        private static bool MatchedSubtringsEqual(MatchSubstring actualSubstring, MatchSubstring expectedSubstring)
        {
            if (actualSubstring == null && expectedSubstring == null)
            {
                return(true);
            }

            if (!(actualSubstring != null && expectedSubstring != null))
            {
                return(false);
            }

            return(actualSubstring.IsMatched == expectedSubstring.IsMatched &&
                   string.Equals(actualSubstring.Value, expectedSubstring.Value, StringComparison.Ordinal));
        }