Esempio n. 1
0
        private static bool Init()
        {
            try
            {
                CoreFrame.Init.AttributeManager.WinformControllerManager.LoadAttribute();

                string entrycontroller = "wcfclientLoginController";

                EFWCoreLib.WinformFrame.Controller.WinformController controller = EFWCoreLib.WinformFrame.Controller.ControllerHelper.CreateController(entrycontroller);
                //controller.Init();
                if (controller == null)
                {
                    throw new Exception("没有找到wcfclientLoginController启动控制器!");
                }
                ((System.Windows.Forms.Form)controller.DefaultView).Show();
                winfromMain.MainForm = ((System.Windows.Forms.Form)controller.DefaultView);

                return(true);
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
                //AppExit();
                return(false);
            }
        }
Esempio n. 2
0
        private static bool Init()
        {
            try
            {
                AppGlobal.AppStart();

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

                string entryplugin;
                string entrycontroller;

                PluginSysManage.GetWinformEntry(out entryplugin, out entrycontroller);
                EFWCoreLib.WinformFrame.Controller.WinformController controller = EFWCoreLib.WinformFrame.Controller.ControllerHelper.CreateController(entryplugin + "@" + entrycontroller);
                //controller.Init();
                if (controller == null)
                {
                    throw new Exception("插件配置的启动项(插件名或控制器名称)不正确!");
                }
                ((System.Windows.Forms.Form)controller.DefaultView).Show();
                winfromMain.MainForm = ((System.Windows.Forms.Form)controller.DefaultView);


                return(true);
            }
            catch (Exception err)
            {
                //记录错误日志
                ZhyContainer.CreateException().HandleException(err, "HISPolicy");
                //Application.Exit();
                //throw new Exception(err.Message + "\n\n请联系管理员!");
                MessageBox.Show(err.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
                //AppExit();
                return(false);
            }
        }
Esempio n. 3
0
        static void AppGlobal_Init(object sender, EventArgs e)
        {
            try
            {
                AppGlobal.AppStart();

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

                string entryplugin;
                string entrycontroller;
                switch (appType)
                {
                case AppType.Winform:
#if WinfromFrame
                    PluginSysManage.GetWinformEntry(out entryplugin, out entrycontroller);
                    EFWCoreLib.WinformFrame.Controller.WinformController controller = EFWCoreLib.WinformFrame.Controller.ControllerHelper.CreateController(entryplugin + "@" + entrycontroller);
                    //controller.Init();
                    if (controller == null)
                    {
                        throw new Exception("插件配置的启动项(插件名或控制器名称)不正确!");
                    }
                    ((System.Windows.Forms.Form)controller.DefaultView).Show();
                    winfromMain.MainForm = ((System.Windows.Forms.Form)controller.DefaultView);
#endif
                    break;

                case AppType.WCFClient:
#if WcfFrame
                    PluginSysManage.GetWcfClientEntry(out entryplugin, out entrycontroller);
                    EFWCoreLib.WcfFrame.ClientController.WcfClientController wcfcontroller = EFWCoreLib.WcfFrame.ClientController.ControllerHelper.CreateController(entryplugin + "@" + entrycontroller);
                    if (wcfcontroller == null)
                    {
                        throw new Exception("插件配置的启动项(插件名或控制器名称)不正确!!");
                    }

                    EFWCoreLib.WcfFrame.ClientController.ReplyClientCallBack callback = new WcfFrame.ClientController.ReplyClientCallBack();
                    EFWCoreLib.WcfFrame.ClientController.WcfClientManage.CreateConnection(callback);
                    //wcfcontroller.Init();
                    ((System.Windows.Forms.Form)wcfcontroller.DefaultView).Show();
                    winfromMain.MainForm = ((System.Windows.Forms.Form)wcfcontroller.DefaultView);
#endif
                    break;
                }
            }
            catch (Exception err)
            {
                //记录错误日志
                ZhyContainer.CreateException().HandleException(err, "HISPolicy");
                //Application.Exit();
                //throw new Exception(err.Message + "\n\n请联系管理员!");
                MessageBox.Show(err.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                AppExit();
            }
        }