示例#1
0
        private void LoadCoreModule(IServiceContext tc, ModuleUpdateAction action)
        {
            Debug.Assert(tc != null);

            var a         = typeof(SlipStream.Core.ModuleModel).Assembly;
            var resources = this.GetResourcesInAssembly(a);

            this.InitializeResources(tc, resources, action);

            //加载核心模块数据
            if (action == ModuleUpdateAction.ToInstall)
            {
                LoggerProvider.EnvironmentLogger.Info(() => "Importing data for the Core Module...");
                var importer = new Model.XmlDataImporter(tc, this.Name);
                foreach (var resPath in s_coreInitDataFiles)
                {
                    using (var resStream = a.GetManifestResourceStream(resPath))
                    {
                        LoggerProvider.EnvironmentLogger.Info(() => "Importing data file: [" + resPath + "]");
                        importer.Import(resStream);
                        resStream.Close();
                    }
                }
            }
        }
示例#2
0
        private void ImportDataFiles(IServiceContext scope, string[] files)
        {
            var importer = new Model.XmlDataImporter(scope, this.Name);

            foreach (var dataFile in files)
            {
                var dataFilePath = System.IO.Path.Combine(this.Path, dataFile);
                LoggerProvider.EnvironmentLogger.Info(() => "Importing data file: [" + dataFilePath + "]");
                importer.Import(dataFilePath);
            }
        }