summaryrefslogtreecommitdiff
path: root/Decompiler/Gestor.Application.Converters/IntToMedalConverter.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Decompiler/Gestor.Application.Converters/IntToMedalConverter.cs')
-rw-r--r--Decompiler/Gestor.Application.Converters/IntToMedalConverter.cs55
1 files changed, 55 insertions, 0 deletions
diff --git a/Decompiler/Gestor.Application.Converters/IntToMedalConverter.cs b/Decompiler/Gestor.Application.Converters/IntToMedalConverter.cs
new file mode 100644
index 0000000..69a65ef
--- /dev/null
+++ b/Decompiler/Gestor.Application.Converters/IntToMedalConverter.cs
@@ -0,0 +1,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;
+ }
+}