Skip to content

Instantly share code, notes, and snippets.

@xSke
Created December 22, 2019 16:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xSke/e0aa32d6a9bfa90251193a8b83091d2b to your computer and use it in GitHub Desktop.
Save xSke/e0aa32d6a9bfa90251193a8b83091d2b to your computer and use it in GitHub Desktop.
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Configuration;
using System.Diagnostics;
using System.Drawing;
using System.Globalization;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Markup;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("reversing__c_skarp_ud")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("reversing__c_skarp_ud")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: ThemeInfo(/*Could not decode attribute arguments.*/)]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace reversing__c_skarp_ud
{
public class App : Application
{
[DebuggerNonUserCode]
[GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
public void InitializeComponent()
{
((Application)this).set_StartupUri(new Uri("MainWindow.xaml", UriKind.Relative));
}
[STAThread]
[DebuggerNonUserCode]
[GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
public static void Main()
{
App app = new App();
app.InitializeComponent();
((Application)app).Run();
}
public App()
: this()
{
}
}
public class MainWindow : Window, IComponentConnector
{
internal Slider slider1;
internal Slider slider2;
internal Slider slider3;
internal TextBox kodeordsBoks;
internal Label sliderText1;
internal Label sliderText2;
internal Label sliderText3;
private bool _contentLoaded;
public MainWindow()
: this()
{
InitializeComponent();
TjekSliders();
((TextBoxBase)kodeordsBoks).set_IsReadOnly(true);
}
private string GetFlagString()
{
byte b = (byte)(((RangeBase)slider1).get_Value() + ((RangeBase)slider2).get_Value() + ((RangeBase)slider3).get_Value());
byte[] array = new byte[50]
{
51,
62,
78,
6,
30,
34,
14,
21,
28,
15,
13,
34,
8,
25,
24,
19,
34,
18,
31,
27,
8,
14,
22,
24,
15,
20,
19,
26,
34,
24,
15,
34,
28,
17,
17,
24,
15,
24,
25,
24,
34,
8,
25,
13,
28,
22,
22,
24,
9,
0
};
for (int i = 0; i < array.Length; i++)
{
array[i] = (byte)(array[i] ^ b);
}
return Encoding.UTF8.GetString(array);
}
private void TjekSliders()
{
((ContentControl)sliderText1).set_Content((object)((RangeBase)slider1).get_Value());
((ContentControl)sliderText2).set_Content((object)((RangeBase)slider2).get_Value());
((ContentControl)sliderText3).set_Content((object)((RangeBase)slider3).get_Value());
if (((RangeBase)slider1).get_Value() == 25.0 && ((RangeBase)slider2).get_Value() == 99.0 && ((RangeBase)slider3).get_Value() == 1.0)
{
kodeordsBoks.set_Text(GetFlagString());
}
else
{
kodeordsBoks.set_Text("-- FORKERT KOMBINATION --");
}
}
private void Slider1_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
TjekSliders();
}
private void Slider2_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
TjekSliders();
}
private void Slider3_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
TjekSliders();
}
[DebuggerNonUserCode]
[GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
public void InitializeComponent()
{
if (!_contentLoaded)
{
_contentLoaded = true;
Uri uri = new Uri("/reversing__c_skarp_ud;component/mainwindow.xaml", UriKind.Relative);
Application.LoadComponent((object)this, uri);
}
}
[DebuggerNonUserCode]
[GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
[EditorBrowsable(EditorBrowsableState.Never)]
void IComponentConnector.Connect(int connectionId, object target)
{
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Expected O, but got Unknown
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Expected O, but got Unknown
//IL_0073: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Expected O, but got Unknown
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Expected O, but got Unknown
//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Expected O, but got Unknown
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
//IL_00bb: Expected O, but got Unknown
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_00c8: Expected O, but got Unknown
switch (connectionId)
{
case 1:
slider1 = (Slider)(object)(Slider)target;
((RangeBase)slider1).add_ValueChanged((RoutedPropertyChangedEventHandler<double>)Slider1_ValueChanged);
break;
case 2:
slider2 = (Slider)(object)(Slider)target;
((RangeBase)slider2).add_ValueChanged((RoutedPropertyChangedEventHandler<double>)Slider2_ValueChanged);
break;
case 3:
slider3 = (Slider)(object)(Slider)target;
((RangeBase)slider3).add_ValueChanged((RoutedPropertyChangedEventHandler<double>)Slider3_ValueChanged);
break;
case 4:
kodeordsBoks = (TextBox)(object)(TextBox)target;
break;
case 5:
sliderText1 = (Label)(object)(Label)target;
break;
case 6:
sliderText2 = (Label)(object)(Label)target;
break;
case 7:
sliderText3 = (Label)(object)(Label)target;
break;
default:
_contentLoaded = true;
break;
}
}
}
}
namespace reversing__c_skarp_ud.Properties
{
[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[DebuggerNonUserCode]
[CompilerGenerated]
internal class Resources
{
private static ResourceManager resourceMan;
private static CultureInfo resourceCulture;
[EditorBrowsable(EditorBrowsableState.Advanced)]
internal static ResourceManager ResourceManager
{
get
{
if (resourceMan == null)
{
resourceMan = new ResourceManager("reversing__c_skarp_ud.Properties.Resources", typeof(Resources).Assembly);
}
return resourceMan;
}
}
[EditorBrowsable(EditorBrowsableState.Advanced)]
internal static CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
internal static Bitmap utilities_terminal => (Bitmap)(object)(Bitmap)ResourceManager.GetObject("utilities_terminal", resourceCulture);
internal Resources()
{
}
}
[CompilerGenerated]
[GeneratedCode("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed class Settings : ApplicationSettingsBase
{
private static Settings defaultInstance = (Settings)(object)SettingsBase.Synchronized((SettingsBase)(object)new Settings());
public static Settings Default => defaultInstance;
public Settings()
: this()
{
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment