Files @ 6a6817b17a06
Branch filter:

Location: ATITD-Tools/Desert-Paint-Codex/Converters/NotEnumBooleanConverter.cs

Jason Maltzen
Simulator view updates: new warning when the recipe is below minimum concentration. Add the missing reactions to the warning about missing reactions. Show the current saved recipe for a color, and allow replacing/saving the current simulated recipe as the recipe for that color.
using System;

namespace DesertPaintCodex.Converters
{
    public class NotEnumBooleanConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value is not Enum en) return false;
            
            string? parameterString = parameter.ToString();
            if (parameterString == null) return false;
            
            object parameterValue = Enum.Parse(value.GetType(), parameterString);
            return !parameterValue.Equals(value);
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new InvalidOperationException("NotEnumBooleanoConverter can only be used OneWay.");
        }
    }
}