Example #1
0
        public ImportResult AddTranslationUnit(TranslationUnit translationUnit, ImportSettings settings)
        {
            var result =
                _fileBasedTranslationProviderLanguageDirection.AddTranslationUnit(translationUnit,
                                                                                  settings);

            if (result == null)
            {
                return(null);
            }
            var tmDataAccess = TmDataAccess.OpenConnection(TranslationProvider.Uri);



            if (result.Action == Action.Add || result.Action == Action.Merge || result.Action == Action.Overwrite)
            {
                var customFieldsValue = new CustomFieldValues
                {
                    FileNameFullPath = translationUnit.GetFilePath(),
                    ProjectName      = translationUnit.GetProjectName()
                };
                tmDataAccess.AddOrUpdateCustomFields(result.TuId.Id, customFieldsValue);
            }

            return(result);
        }
        public ImportResult AddTranslationUnit(TranslationUnit translationUnit, ImportSettings settings)
        {
            var result =
                _fileBasedTranslationProviderLanguageDirection.AddTranslationUnit(translationUnit,
                    settings);
            if (result == null) return null;
            var tmDataAccess = TmDataAccess.OpenConnection(TranslationProvider.Uri);



            if (result.Action == Action.Add || result.Action == Action.Merge || result.Action == Action.Overwrite)
            {
                var customFieldsValue = new CustomFieldValues
                {
                    FileNameFullPath = translationUnit.GetFilePath(),
                    ProjectName = translationUnit.GetProjectName()
                };
                tmDataAccess.AddOrUpdateCustomFields(result.TuId.Id, customFieldsValue);
            }

            return result;
        }