Esempio n. 1
0
        private void OpenTask(ModuleInfo moduleInfo)
        {
            Type moduleType = null;

            object instance = null;

            try
            {
                moduleType = Type.GetType(moduleInfo.ModuleType);
                instance   = Activator.CreateInstance(moduleType);
                if (moduleInfo.InitParams != null && instance != null)
                {
                    foreach (var item in moduleInfo.InitParams)
                    {
                        PropertyInfo property = instance.GetType().GetProperty(item.Key);
                        property.SetValue(instance, item.Value, null);
                    }
                }
                if (moduleInfo != null && instance != null)
                {
                    SMT.SaaS.FrameworkUI.EntityBrowser browser = new SaaS.FrameworkUI.EntityBrowser(instance);

                    browser.Show <string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { }, true);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("新建任务打开异常,请查看系统日志!");
                Logging.Logger.Current.Log("10000", "Platform", "新建任务", "新建任务打开异常", ex, Logging.Category.Exception, Logging.Priority.High);
            }
        }
Esempio n. 2
0
        private void OpenTask(ModuleInfo moduleInfo)
        {
            Type moduleType = null;

            object instance = null;

            try
            {
                moduleType = Type.GetType(moduleInfo.ModuleType);
                instance   = Activator.CreateInstance(moduleType);
                if (moduleInfo.InitParams != null && instance != null)
                {
                    //foreach (var item in moduleInfo.InitParams)
                    //{
                    //    PropertyInfo property = instance.GetType().GetProperty(item.Key);
                    //    property.SetValue(instance, item.Value, null);
                    //}
                }
                if (moduleInfo != null && instance != null)
                {
                    WindowsManager.ClearAllWindows();//清除所有打开的窗口
                    //WorkHost.Visibility = Visibility.Visible;
                    SMT.SaaS.FrameworkUI.EntityBrowser browser = new SaaS.FrameworkUI.EntityBrowser(instance);

                    parent.Child = browser;
                    //browser.Show<string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { }, true);
                    if (browser.ParentWindow != null)
                    {
                        WindowsManager.MaxWindow(browser.ParentWindow);
                    }
                }
            }
            catch (Exception ex)
            {
                LogErrMsg("新建任务打开异常,请查看系统日志:" + ex.ToString());
            }
        }
Esempio n. 3
0
        private void OpenTask(ModuleInfo moduleInfo)
        {
            Type moduleType = null;

            object instance = null;
            try
            {
                moduleType = Type.GetType(moduleInfo.ModuleType);
                instance = Activator.CreateInstance(moduleType);
                if (moduleInfo.InitParams != null && instance != null)
                {
                    foreach (var item in moduleInfo.InitParams)
                    {
                        PropertyInfo property = instance.GetType().GetProperty(item.Key);
                        property.SetValue(instance, item.Value, null);
                    }
                }
                if (moduleInfo != null && instance != null)
                {
                    WindowsManager.ClearAllWindows();//清除所有打开的窗口
                    //WorkHost.Visibility = Visibility.Visible;
                    SMT.SaaS.FrameworkUI.EntityBrowser browser = new SaaS.FrameworkUI.EntityBrowser(instance);

                    parent.Child = browser;
                    //browser.Show<string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { }, true);
                    if (browser.ParentWindow != null)
                    {
                        WindowsManager.MaxWindow(browser.ParentWindow);
                    }
                }
            }
            catch (Exception ex)
            {
                LogErrMsg("新建任务打开异常,请查看系统日志:"+ex.ToString());              
            }
        }
Esempio n. 4
0
        private void OpenTask(ModuleInfo moduleInfo)
        {
            Type moduleType = null;
           
            object instance = null;
            try
            {
                moduleType = Type.GetType(moduleInfo.ModuleType);
                instance = Activator.CreateInstance(moduleType);
                if (moduleInfo.InitParams != null && instance != null)
                {
                    foreach (var item in moduleInfo.InitParams)
                    {
                        PropertyInfo property = instance.GetType().GetProperty(item.Key);
                        property.SetValue(instance, item.Value, null);
                    }
                }
                if (moduleInfo != null && instance != null)
                {
                    SMT.SaaS.FrameworkUI.EntityBrowser browser = new SaaS.FrameworkUI.EntityBrowser(instance);

                    browser.Show<string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { }, true);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("新建任务打开异常,请查看系统日志!");
                Logging.Logger.Current.Log("10000", "Platform", "新建任务", "新建任务打开异常", ex, Logging.Category.Exception, Logging.Priority.High);
            }
        }