コード例 #1
0
        /// <summary>
        /// ImportLanguage()
        /// </summary>
        /// <param name="applicationPath"></param>
        /// <param name="targetCulture"></param>
        /// <param name="dataSource"></param>
        /// <param name="tableName"></param>
        /// <param name="callback"></param>
        public static void ImportLanguage(string applicationPath, string targetCulture, IDbDriver dataSource, string tableName, AppendLogCallback callback)
        {
            ResourceTool instance = new ResourceTool(applicationPath, callback);

            GlobalizationDataSet ds = instance.ReadResourcesFromDatabase(dataSource, tableName);

            instance.CompileSatelliteAssemblies(targetCulture, ds);
        }
コード例 #2
0
        /// <summary>
        /// Extract text resources from assemblies in specified folder
        /// </summary>
        /// <param name="applicationPath">Path of application.</param>
        /// <param name="sourceCulture">Culture code of the source.</param>
        /// <param name="targetCulture">Culture code of the target.</param>
        /// <param name="translator">Translation component.</param>
        /// <param name="exportFilePath">Path of file to export.</param>
        /// <param name="callback">Address pointer for <see cref="Epi.Windows.Localization.AppendLogCallback"/>.</param>
        public static void ExportLanguage(string applicationPath, string sourceCulture, string targetCulture, ITranslator translator, string exportFilePath, AppendLogCallback callback)
        {
            ResourceTool.dbFactory = Epi.Data.DbDriverFactoryCreator.GetDbDriverFactory(Epi.Configuration.AccessDriver);
            ResourceTool instance = new ResourceTool(applicationPath, callback);

            //IDbDriver db = DatabaseFactoryCreator.CreateDatabaseInstanceByFileExtension(exportFilePath);
            OleDbConnectionStringBuilder dbCnnStringBuilder = new OleDbConnectionStringBuilder();

            dbCnnStringBuilder.DataSource = exportFilePath;
            IDbDriver db = dbFactory.CreateDatabaseObject(dbCnnStringBuilder);

            GlobalizationDataSet ds = instance.ExtractResourcesToDataSet(sourceCulture, targetCulture, translator);

            instance.WriteResourcesToDatabase(ds, db);
        }
コード例 #3
0
ファイル: ResourceTool.cs プロジェクト: NALSS/epiinfo-82474
        /// <summary>
        /// ImportLanguage()
        /// </summary>
        /// <param name="applicationPath"></param>
        /// <param name="targetCulture"></param>
        /// <param name="dataSource"></param>
        /// <param name="tableName"></param>
        /// <param name="callback"></param>
        public static void ImportLanguage(string applicationPath, string targetCulture, IDbDriver dataSource, string tableName, AppendLogCallback callback)
        {
            ResourceTool instance = new ResourceTool(applicationPath, callback);

            GlobalizationDataSet ds = instance.ReadResourcesFromDatabase(dataSource, tableName);

            instance.CompileSatelliteAssemblies(targetCulture, ds);
        }
コード例 #4
0
ファイル: ResourceTool.cs プロジェクト: NALSS/epiinfo-82474
        /// <summary>
        /// Extract text resources from assemblies in specified folder
        /// </summary>
        /// <param name="applicationPath">Path of application.</param>
        /// <param name="sourceCulture">Culture code of the source.</param>
        /// <param name="targetCulture">Culture code of the target.</param>
        /// <param name="translator">Translation component.</param>
        /// <param name="exportFilePath">Path of file to export.</param>
        /// <param name="callback">Address pointer for <see cref="Epi.Windows.Localization.AppendLogCallback"/>.</param>
        public static void ExportLanguage(string applicationPath, string sourceCulture, string targetCulture, ITranslator translator, string exportFilePath, AppendLogCallback callback)
        {
            ResourceTool.dbFactory = Epi.Data.DbDriverFactoryCreator.GetDbDriverFactory(Epi.Configuration.AccessDriver);
            ResourceTool instance = new ResourceTool(applicationPath, callback);

            //IDbDriver db = DatabaseFactoryCreator.CreateDatabaseInstanceByFileExtension(exportFilePath);
            OleDbConnectionStringBuilder dbCnnStringBuilder = new OleDbConnectionStringBuilder();
            dbCnnStringBuilder.DataSource = exportFilePath;
            IDbDriver db = dbFactory.CreateDatabaseObject(dbCnnStringBuilder);

            GlobalizationDataSet ds = instance.ExtractResourcesToDataSet(sourceCulture, targetCulture, translator);
            instance.WriteResourcesToDatabase(ds, db);
        }