diff options
| author | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 17:17:46 +0000 |
|---|---|---|
| committer | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 17:17:46 +0000 |
| commit | 0440c722a221b8068bbf388c1c0c51f0faff0451 (patch) | |
| tree | 169cbf90c50ff7961db82ecb606c50c2a45a1688 /Gestor.Common/Gestor.Common.Converters/StatusExtratoColorConverter.cs | |
| parent | 225aa1499e37faf9d38257caabbadc68d78b427e (diff) | |
| download | gestor-master.tar.gz gestor-master.zip | |
Diffstat (limited to 'Gestor.Common/Gestor.Common.Converters/StatusExtratoColorConverter.cs')
| -rw-r--r-- | Gestor.Common/Gestor.Common.Converters/StatusExtratoColorConverter.cs | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/Gestor.Common/Gestor.Common.Converters/StatusExtratoColorConverter.cs b/Gestor.Common/Gestor.Common.Converters/StatusExtratoColorConverter.cs new file mode 100644 index 0000000..e1217f0 --- /dev/null +++ b/Gestor.Common/Gestor.Common.Converters/StatusExtratoColorConverter.cs @@ -0,0 +1,74 @@ +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; + } +} |