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

78 lines
2.4 KiB
C#
Raw Normal View History

using .Tools.SmartEditor;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace
{
public class Init
{
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];
Application.Run(new Form1(ProjectPath, "get"));
}
else if (args[0] == "open")
{
string ProjectPath = args[1];
Application.Run(new Form1(ProjectPath, "open"));
}
else if (args[0] == "edit")
{
string ProjectPath = args[1];
OpenEditor(ProjectPath);
}
}
else if(args.Length == 1)
{
if (args[0] == "edit" || System.IO.File.Exists(args[0]))
{
OpenEditor(args[0]);
}
else
{
Application.Run(new Form1("", ""));
}
}
else
{
Application.Run(new Form1("", ""));
//Application.Run(new FrmMainEditor());
}
}
static void OpenEditor(string path)
{
object mainHandle = QuickMsg.RyMemoryShare.ReadFromMemory(1024, typeof(Int64), "SmartEditor");
if (mainHandle != null && (long)mainHandle != 0)
{
var handle = new IntPtr((long)mainHandle);
if (path == "edit")
{
ryControls.Win32.SendMessage(handle, 17189, 100, 100);//让界面显示
}
else
{
ryConfig.MsgManager.SendMsg(handle, 1666, path);
}
return;
}
else
{
Application.Run(new FrmMainEditor(path == "edit" ? "" : path));
}
}
}
}