summaryrefslogtreecommitdiff
path: root/Decompiler/Gestor.Application.Converters/StatusIconConverter.cs
blob: 3d2225b9ad470f7511df3ff6bea3179f2acecd98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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;
	}
}