Пример #1
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);
        }
Пример #2
0
 /// <summary>
 /// Prepopulates collected data information on the interface
 /// </summary>
 private void PrepopulateCollectedDataLocation()
 {
     if (!string.IsNullOrEmpty(txtProjectName.Text) && !string.IsNullOrEmpty(txtNewProjectLocation.Text))
     {
         {
             Epi.Data.IDbDriverFactory factory = GetSelectedCollectedDataDriver();
             if (factory != null)
             {
                 collectedDataDBInfo.DBCnnStringBuilder = GetSelectedCollectedDataDriver().RequestDefaultConnection(txtProjectName.Text.Trim(), txtProjectName.Text.Trim());
                 txtCollectedData.Text         = collectedDataDBInfo.DBCnnStringBuilder.ConnectionString;
                 collectedDataConnectionString = txtCollectedData.Text;
             }
         }
     }
     else
     {
         collectedDataDBInfo.DBCnnStringBuilder = null;
         txtCollectedData.Text         = string.Empty;
         collectedDataConnectionString = string.Empty;
     }
 }
Пример #3
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);
        }