summaryrefslogtreecommitdiff
path: root/Decompiler/Gestor.Application.Converters/IntToMedalConverter.cs
blob: 69a65ef19437d7e7e15786d7183e6d22acbd6b1a (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
52
53
54
55
using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Markup;
using System.Windows.Media;

namespace Gestor.Application.Converters;

public class IntToMedalConverter : MarkupExtension, IValueConverter
{
	public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
	{
		//IL_0043: 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_0077: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Expected O, but got Unknown
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0041: Expected O, but got Unknown
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Expected O, but got Unknown
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Expected O, but got Unknown
		if (value != null)
		{
			switch ((int)value)
			{
			case 3:
				return (object)new SolidColorBrush(Colors.Gold);
			case 2:
				return (object)new SolidColorBrush(Colors.Silver);
			case 1:
				return (object)new SolidColorBrush(Colors.SaddleBrown);
			}
		}
		Color val = default(Color);
		((Color)(ref val)).A = 64;
		((Color)(ref val)).R = 200;
		((Color)(ref val)).G = 200;
		((Color)(ref val)).B = 200;
		return (object)new SolidColorBrush(val);
	}

	public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
	{
		return value;
	}

	public override object ProvideValue(IServiceProvider serviceProvider)
	{
		return this;
	}
}