summaryrefslogtreecommitdiff
path: root/Decompiler/Gestor.Application.Converters/StatusIconConverter.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Decompiler/Gestor.Application.Converters/StatusIconConverter.cs')
-rw-r--r--Decompiler/Gestor.Application.Converters/StatusIconConverter.cs51
1 files changed, 51 insertions, 0 deletions
diff --git a/Decompiler/Gestor.Application.Converters/StatusIconConverter.cs b/Decompiler/Gestor.Application.Converters/StatusIconConverter.cs
new file mode 100644
index 0000000..3d2225b
--- /dev/null
+++ b/Decompiler/Gestor.Application.Converters/StatusIconConverter.cs
@@ -0,0 +1,51 @@
+using System;
+using System.Globalization;
+using System.Windows.Data;
+using System.Windows.Media;
+using Gestor.Model.Common;
+using Gestor.Model.Validation;
+using MaterialDesignThemes.Wpf;
+
+namespace Gestor.Application.Converters;
+
+public class StatusIconConverter : IMultiValueConverter
+{
+ public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+ {
+ //IL_0046: Unknown result type (might be due to invalid IL or missing references)
+ //IL_004b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_004c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_004e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0068: Expected I4, but got Unknown
+ //IL_00f0: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00f5: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00fb: Expected O, but got Unknown
+ if (values[2] != null && values[2] is bool && (bool)values[2])
+ {
+ return (object)(PackIconKind)1280;
+ }
+ object obj = values[0];
+ if (obj != null)
+ {
+ if (!(obj is TipoSeguro))
+ {
+ return (object)new SolidColorBrush(Colors.White);
+ }
+ TipoSeguro val = (TipoSeguro)values[0];
+ return (val - 3) switch
+ {
+ 2 => (object)(PackIconKind)2901,
+ 3 => (object)(PackIconKind)1554,
+ 0 => (object)(PackIconKind)1058,
+ 4 => (object)(PackIconKind)789,
+ _ => (object)(PackIconKind)((values[1] == null || (DateTime?)values[1] >= Funcoes.GetNetworkTime().Date.AddDays(-6.0)) ? 1545 : 1044),
+ };
+ }
+ return (object)(PackIconKind)1543;
+ }
+
+ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+}