using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace HBLConsole.Converter
{
    public class IsEnableConvert : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            bool returnValue = false;
            if (value != null)
            {
                switch (value.ToString())
                {
                    case "无":
                        returnValue = false;
                        break;
                    case "离散量报警":
                    case "模拟量报警":
                        returnValue = true;
                        break;
                    default:
                        break;
                }
            }
            return returnValue;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
