예제 #1
0
 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     Debug.Assert(value is ILogEntry, "Supplied value must be a LogEntry for conversion.");
     return(highlighter.Enabled && highlighter.IsMatch(value as ILogEntry)
                ? "Match"
                : "Not Match");
 }
예제 #2
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var match = false;

            if (value != null)
            {
                var entry = value as ILogEntry;
                if (entry == null)
                {
                    Log.WarnFormat("Expected 'value' to be an ILogEntry but found {0}", value);
                }
                else
                {
                    match = highlighter.Enabled && highlighter.IsMatch(entry);
                }
            }

            return(match ? "Match" : "Not Match");
        }