Exemple #1
0
        public static void AppEnd()
        {
            GlobalExtend.EndInit();

            switch (appType)
            {
            case AppType.Winform:

                break;

            case AppType.WCFClient:
#if WcfFrame
                EFWCoreLib.WcfFrame.ClientController.WcfClientManage.UnConnection();
#endif
                break;
            }
        }
Exemple #2
0
        public static void AppStart()
        {
            lock (locker)
            {
                if (_isCalled == false)
                {
                    try
                    {
                        WriterLog("--------------------------------");
                        WriterLog("应用开始启动!");

                        string ClientType = System.Configuration.ConfigurationManager.AppSettings["ClientType"];
                        if (ClientType == "Web")
                        {
                            appType = AppType.Web;
                        }
                        else if (ClientType == "Winform")
                        {
                            appType     = AppType.Winform;
                            AppRootPath = System.Windows.Forms.Application.StartupPath + "\\";
                        }
                        else if (ClientType == "WCF")
                        {
                            appType     = AppType.WCF;
                            AppRootPath = System.Windows.Forms.Application.StartupPath + "\\";
                        }
                        else if (ClientType == "WCFClient")
                        {
                            appType     = AppType.WCFClient;
                            AppRootPath = System.Windows.Forms.Application.StartupPath + "\\";
                        }


                        IsSaas = System.Configuration.ConfigurationManager.AppSettings["IsSaas"] == "true" ? true : false;

                        container  = ZhyContainer.CreateUnity();
                        cache      = ZhyContainer.CreateCache();
                        database   = FactoryDatabase.GetDatabase();
                        taskList   = new List <TimingTask>();
                        codeList   = new List <FunClass>();
                        missingDll = new List <string>();

                        AppPluginManage.LoadAllPlugin();

                        //初始化Web定制任务
                        MultiTask.Init(container, taskList);//任务
                        //是否开启Web控制器请求权限认证

                        //扩展Global,网站程序启动、停止可自定义代码
                        GlobalExtend.StartInit();
                        //初始化委托代码
                        BaseDelegateCode.Init(container, codeList);//执行函数

                        _isCalled = true;


                        IsRun = true;

                        if (missingDll.Count > 0)
                        {
                            string msg = "缺失的程序集:";
                            WriterLog(msg);
                            for (int i = 0; i < missingDll.Count; i++)
                            {
                                msg = missingDll[i];
                                WriterLog(msg);
                            }
                            //MessageBox.Show(msg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }

                        WriterLog("应用启动成功!");
                        WriterLog("--------------------------------");
                        //AppMain();
                    }
                    catch (Exception err)
                    {
                        AppGlobal.WriterLog("应用启动失败!");
                        AppGlobal.WriterLog(err.Message);
                        AppGlobal.WriterLog("--------------------------------");
                        throw err;
                    }
                }
            }
        }
Exemple #3
0
 public static void AppEnd()
 {
     GlobalExtend.EndInit();
     EFWCoreLib.WcfFrame.ClientLinkManage.UnAllConnection();
 }