예제 #1
0
        public FormMain()
        {
            //InitializeComponent();
            //CheckForIllegalCrossThreadCalls = false;

            //目录初始化
            if (!Directory.Exists(AppEnvironment.AppBinPath))
            {
                Directory.CreateDirectory(AppEnvironment.AppBinPath);
            }
            if (!Directory.Exists(AppEnvironment.AppPluginPath))
            {
                Directory.CreateDirectory(AppEnvironment.AppPluginPath);
            }
            if (!Directory.Exists(AppEnvironment.AppPluginConfigPath))
            {
                Directory.CreateDirectory(AppEnvironment.AppPluginConfigPath);
            }
            if (!Directory.Exists(AppEnvironment.AppLanguagePath))
            {
                Directory.CreateDirectory(AppEnvironment.AppLanguagePath);
            }

            //----数据初始化----
            InitUi.InitCustomShellType(AppEnvironment.AppCustomShellTypePath);
            InitUi.InitGlobalSetting(AppEnvironment.AppPath);
            var basicSetting = (GlobalSetting.Setting as Setting).BasicSetting;
            //----数据初始化结束----

            //语言初始化
            var lang = basicSetting.Language;

            AltLangRes.ReadLanguageResource(lang);
            AltStrRes.SetTranslatedStrings(AltLangRes.Table);

            //----导入插件----
            //_pluginsImport = new PluginsImport();
            _host = new Host(this);
            PluginProvider.Host = _host;
            PluginProvider.Compose(AppEnvironment.AppPluginPath, AppEnvironment.AppServicePath, basicSetting.IsOpenIPythonSupport);

            //UI处理
            Init();
            LoadPluginsInUi();
            InitPlugins(PluginProvider.Plugins);
            //----导入插件结束----

            //显示免责声明
            InitUi.InitWelcome();

            //auto call services
            AutoLoadServices(PluginProvider.Services);

            LoadServicesInUi();

            //auto load plugins
            AutoLoadPlugins(PluginProvider.Plugins);
        }
예제 #2
0
 public string GetTranslatedText(string strName, string strDefault)
 {
     return(AltStrRes.GetString(strName, strDefault));
 }