Files
lserp_cs_6.0/插件库/Lskj.Main/Hosting/LegacyApplicationHost.cs
T

30 lines
874 B
C#

using System;
using Lskj.Main.Model;
namespace Lskj.Main.Hosting
{
/// <summary>
/// 为独立的新启动程序公开原 Ls_ERP 初始化和登录流程。
/// </summary>
public static class LegacyApplicationHost
{
public static void Run(string[] args, IExternalMainShell externalMainShell)
{
if (externalMainShell == null)
throw new ArgumentNullException("externalMainShell");
if (Manager.ExternalMainShell != null)
throw new InvalidOperationException("旧程序已经由另一个外部主界面托管。");
Manager.ExternalMainShell = externalMainShell;
try
{
Program.RunFromExternalHost(args);
}
finally
{
Manager.ExternalMainShell = null;
}
}
}
}