-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.xaml.cs
34 lines (29 loc) · 838 Bytes
/
App.xaml.cs
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
using System;
using System.IO;
using System.Reflection;
using System.Windows;
namespace Minecraft_SC_Generator
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
}
private Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs e)
{
if (e.Name.Contains("resources"))
return e.RequestingAssembly;
using (Stream s = Assembly.GetExecutingAssembly().GetManifestResourceStream("Minecraft_SC_Generator.WinTitleBitmaps.Wpf.dll"))
{
byte[] buffer = new byte[s.Length];
s.Read(buffer, 0, buffer.Length);
return Assembly.Load(buffer);
}
}
}
}