SuperDesign/Source/开发辅助工具/Program.cs

54 lines
1.7 KiB
C#
Raw Normal View History

using ryCommon;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Windows.Documents;
using System.Windows.Forms;
namespace
{
static class Program
{
static System.Threading.Mutex run;
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
//run = new System.Threading.Mutex(true, "SuperDesign", out bool runone);
//if(!runone)
//{
// return;
//}
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
//run.ReleaseMutex();
//run.Close();
Init.Show(args);
}
static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
{
try
{
AssemblyName assemblyName = new AssemblyName(args.Name);
if (System.IO.File.Exists(Application.StartupPath + @"\Bin\dlls\" + assemblyName.Name + ".dll"))
{
return Assembly.LoadFrom(Application.StartupPath + @"\Bin\dlls\" + assemblyName.Name + ".dll");
}
else
{
return args.RequestingAssembly;
}
}
catch
{
return args.RequestingAssembly;
}
}
}
}