SuperDesign/Source/开发辅助工具/Manager/Init.cs

62 lines
2.1 KiB
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using .Controls;
namespace
{
public class Init
{
static System.Threading.Mutex run;
public static void Show(string[] args)
{
if (args.Length >= 2)
{
if (args[0] == "ver")
{
string ProjectDir = args[1];
Manager.RyProject.UpdateVer(ProjectDir.Trim('"') + "\\Properties\\AssemblyInfo.cs");
}
else if (args[0] == "get")
{
string ProjectPath = args[1];
run = new System.Threading.Mutex(true, "SuperDesign_"+rySafe.MD5Sha1.GetMD5(ProjectPath), out bool runone);
if (!runone) //已经运行了
{
var handle = QuickMsg.RyMemoryShare.ReadFromMemory("SuperDesign" + rySafe.MD5Sha1.GetMD5(ProjectPath), 0);
if(handle>0)
{
ryControls.Win32.SendMessage((IntPtr)handle, 17189, 100, 100);
}
else
{
Application.Run(new Form1(ProjectPath, "get"));
}
}
else
{
Application.Run(new Form1(ProjectPath, "get"));
}
}
else if (args[0] == "open")
{
string ProjectPath = args[1];
Application.Run(new Form1(ProjectPath, "open"));
}
}
else if(args.Length == 1)
{
Application.Run(new Form1("", ""));
}
else
{
Application.Run(new Form1("", ""));
//Application.Run(new FrmMainEditor());
}
}
}
}