using System; using System.Globalization; using System.Windows; using System.Windows.Data; using System.Windows.Markup; using System.Windows.Media; using Gestor.Model.Common; namespace Gestor.Common.Converters; public class StatusExtratoColorConverter : MarkupExtension, IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected I4, but got Unknown //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Expected O, but got Unknown //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Expected O, but got Unknown //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Expected O, but got Unknown if (value == null) { return (object)new SolidColorBrush(Colors.Black); } StatusParcela val = (StatusParcela)value; switch ((int)val - 1) { default: return (object)new SolidColorBrush(Colors.Black); case 0: case 4: case 9: case 11: case 20: return (object)new SolidColorBrush(Colors.Green); case 1: case 2: case 5: case 6: return (object)new SolidColorBrush(Colors.Red); case 10: return (object)new SolidColorBrush((Color)Application.Current.Resources[(object)"AggerYellow100"]); case 7: return (object)new SolidColorBrush(Colors.Gray); } } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { return (value != null && !string.IsNullOrEmpty(value.ToString())) ? int.Parse(value.ToString()) : 0; } public override object ProvideValue(IServiceProvider serviceProvider) { return this; } }