예제 #1
0
        protected virtual void InitEnvironment()
        {
            Logger.LogInfo("LCL LEnvironment InitEnvironment ....");
            //如果配置了文化,则修改 UI 文化。否则使用系统默认的文化。
            var cultureName = LEnvironment.CurrentCulture;

            if (!string.IsNullOrWhiteSpace(cultureName))
            {
                try
                {
                    var culture = CultureInfo.GetCultureInfo(cultureName);
                    Thread.CurrentThread.CurrentUICulture = culture;
                }
                catch (CultureNotFoundException) { }
            }
            //如果是客户端,则所有线程使用一个身份;如果是服务端,则每个线程使用一个单独的身份。
            if (LEnvironment.Location.IsWPFUI)
            {
                AppContext.SetProvider(new StaticAppContextProvider());
            }
            else
            {
                AppContext.SetProvider(new WebOrThreadStaticAppContextProvider());
            }
            LEnvironment.AppObjectContainer = new TinyIoCObjectContainer();
            LEnvironment.InitApp(this);
        }
예제 #2
0
 protected virtual void InitAllPlugins()
 {
     LEnvironment.StartupPlugins();
 }