Exemplo n.º 1
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null || value.GetType() != typeof(SyntaxChecker.Result))
            {
                return(Binding.DoNothing);
            }

            Brush brush;

            SyntaxChecker.Result result = (SyntaxChecker.Result)value;
            switch (result)
            {
            case SyntaxChecker.Result.Clean:
                brush = Brushes.Green;
                break;

            case SyntaxChecker.Result.Warning:
                brush = Brushes.OrangeRed;
                break;

            case SyntaxChecker.Result.Error:
                brush = Brushes.Red;
                break;

            default:
                brush = Brushes.Gray;
                break;
            }
            return(brush);
        }
Exemplo n.º 2
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null || value.GetType() != typeof(SyntaxChecker.Result))
            {
                return(Binding.DoNothing);
            }

            PackIconMaterialKind icon;

            SyntaxChecker.Result result = (SyntaxChecker.Result)value;
            switch (result)
            {
            case SyntaxChecker.Result.Clean:
                icon = PackIconMaterialKind.Check;
                break;

            case SyntaxChecker.Result.Warning:
                icon = PackIconMaterialKind.Alert;
                break;

            case SyntaxChecker.Result.Error:
                icon = PackIconMaterialKind.Close;
                break;

            default:
                icon = PackIconMaterialKind.Magnify;
                break;
            }
            return(icon);
        }
Exemplo n.º 3
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null || value.GetType() != typeof(SyntaxChecker.Result))
            {
                return(null);
            }

            Brush brush;

            SyntaxChecker.Result result = (SyntaxChecker.Result)value;
            switch (result)
            {
            case SyntaxChecker.Result.Clean:
                brush = new SolidColorBrush(Colors.Green);
                break;

            case SyntaxChecker.Result.Warning:
                brush = new SolidColorBrush(Colors.OrangeRed);
                break;

            case SyntaxChecker.Result.Error:
                brush = new SolidColorBrush(Colors.Red);
                break;

            default:
                brush = new SolidColorBrush(Colors.Gray);
                break;
            }
            return(brush);
        }