summaryrefslogtreecommitdiff
path: root/Decompiler/Gestor.Application.Converters/MimeIconConverter.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Decompiler/Gestor.Application.Converters/MimeIconConverter.cs')
-rw-r--r--Decompiler/Gestor.Application.Converters/MimeIconConverter.cs213
1 files changed, 213 insertions, 0 deletions
diff --git a/Decompiler/Gestor.Application.Converters/MimeIconConverter.cs b/Decompiler/Gestor.Application.Converters/MimeIconConverter.cs
new file mode 100644
index 0000000..60beec5
--- /dev/null
+++ b/Decompiler/Gestor.Application.Converters/MimeIconConverter.cs
@@ -0,0 +1,213 @@
+using System;
+using System.Globalization;
+using System.Windows.Data;
+using System.Windows.Markup;
+using ControlzEx;
+using MaterialDesignThemes.Wpf;
+
+namespace Gestor.Application.Converters;
+
+public class MimeIconConverter : MarkupExtension, IValueConverter
+{
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ //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_0013: Expected O, but got Unknown
+ //IL_0014: Expected O, but got Unknown
+ //IL_01ae: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01b3: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01be: Expected O, but got Unknown
+ //IL_01bf: Expected O, but got Unknown
+ //IL_0225: Unknown result type (might be due to invalid IL or missing references)
+ //IL_022a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0235: Expected O, but got Unknown
+ //IL_0236: Expected O, but got Unknown
+ //IL_01bf: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01c4: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01cf: Expected O, but got Unknown
+ //IL_01d0: Expected O, but got Unknown
+ //IL_01f2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01f7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0202: Expected O, but got Unknown
+ //IL_0203: Expected O, but got Unknown
+ //IL_0203: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0208: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0213: Expected O, but got Unknown
+ //IL_0214: Expected O, but got Unknown
+ //IL_01e1: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01e6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01f1: Expected O, but got Unknown
+ //IL_01f2: Expected O, but got Unknown
+ //IL_01d0: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01d5: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01e0: Expected O, but got Unknown
+ //IL_01e1: Expected O, but got Unknown
+ //IL_0214: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0219: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0224: Expected O, but got Unknown
+ //IL_0225: Expected O, but got Unknown
+ if (value == null)
+ {
+ PackIcon val = new PackIcon();
+ ((PackIconBase<PackIconKind>)val).Kind = (PackIconKind)1529;
+ return (object)val;
+ }
+ string text = value.ToString().ToLower();
+ if (text != null)
+ {
+ int length = text.Length;
+ if (length != 4)
+ {
+ if (length == 5)
+ {
+ switch (text[2])
+ {
+ case 'o':
+ break;
+ case 'l':
+ goto IL_0183;
+ case 'p':
+ goto IL_0192;
+ case 's':
+ if (text == ".json")
+ {
+ PackIcon val2 = new PackIcon();
+ ((PackIconBase<PackIconKind>)val2).Kind = (PackIconKind)2156;
+ return (object)val2;
+ }
+ goto IL_01ae;
+ default:
+ goto IL_01ae;
+ }
+ if (text == ".docx")
+ {
+ goto IL_01e1;
+ }
+ }
+ }
+ else
+ {
+ PackIcon val3;
+ switch (text[2])
+ {
+ case 'd':
+ {
+ if (!(text == ".pdf"))
+ {
+ goto IL_01ae;
+ }
+ PackIcon val5 = new PackIcon();
+ ((PackIconBase<PackIconKind>)val5).Kind = (PackIconKind)1580;
+ return (object)val5;
+ }
+ case 'x':
+ {
+ if (!(text == ".txt"))
+ {
+ goto IL_01ae;
+ }
+ PackIcon val4 = new PackIcon();
+ ((PackIconBase<PackIconKind>)val4).Kind = (PackIconKind)3399;
+ return (object)val4;
+ }
+ case 'o':
+ break;
+ case 'l':
+ goto IL_0102;
+ case 'p':
+ goto IL_0117;
+ case 'n':
+ goto IL_012c;
+ case 'm':
+ goto IL_013e;
+ case 'i':
+ if (!(text == ".zip"))
+ {
+ goto IL_01ae;
+ }
+ goto IL_0225;
+ case 'a':
+ if (!(text == ".rar"))
+ {
+ goto IL_01ae;
+ }
+ goto IL_0225;
+ default:
+ goto IL_01ae;
+ IL_0225:
+ val3 = new PackIcon();
+ ((PackIconBase<PackIconKind>)val3).Kind = (PackIconKind)301;
+ return (object)val3;
+ }
+ if (text == ".doc")
+ {
+ goto IL_01e1;
+ }
+ }
+ }
+ goto IL_01ae;
+ IL_0183:
+ if (!(text == ".xlsx"))
+ {
+ goto IL_01ae;
+ }
+ goto IL_01f2;
+ IL_0117:
+ if (!(text == ".jpg"))
+ {
+ goto IL_01ae;
+ }
+ goto IL_0203;
+ IL_0203:
+ PackIcon val6 = new PackIcon();
+ ((PackIconBase<PackIconKind>)val6).Kind = (PackIconKind)2102;
+ return (object)val6;
+ IL_012c:
+ if (!(text == ".png"))
+ {
+ goto IL_01ae;
+ }
+ goto IL_0203;
+ IL_0192:
+ if (!(text == ".jpge"))
+ {
+ goto IL_01ae;
+ }
+ goto IL_0203;
+ IL_01e1:
+ PackIcon val7 = new PackIcon();
+ ((PackIconBase<PackIconKind>)val7).Kind = (PackIconKind)1605;
+ return (object)val7;
+ IL_01ae:
+ PackIcon val8 = new PackIcon();
+ ((PackIconBase<PackIconKind>)val8).Kind = (PackIconKind)1529;
+ return (object)val8;
+ IL_01f2:
+ PackIcon val9 = new PackIcon();
+ ((PackIconBase<PackIconKind>)val9).Kind = (PackIconKind)1563;
+ return (object)val9;
+ IL_0102:
+ if (!(text == ".xls"))
+ {
+ goto IL_01ae;
+ }
+ goto IL_01f2;
+ IL_013e:
+ if (!(text == ".bmp"))
+ {
+ goto IL_01ae;
+ }
+ goto IL_0203;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+}