Ejemplo n.º 1
0
        /// <summary>
        /// creates new TM
        /// </summary>
        /// <param name="TM">TM to get settings (desc, source lang, target lang) from</param>
        /// <param name="isIndexRevert">create TM with reverted index</param>
        public void CreateNewTM(FileBasedTranslationMemory TM, bool isIndexRevert)
        {
            FilePath = FileHelper.ChangeFileName(FilePath, @"{0}\{1}_{2}.sdltm");

            if (isIndexRevert)
            {
                NewTM = new FileBasedTranslationMemory(FilePath,
                                                       (TM.Description == null ? "" : TM.Description),
                                                       TM.LanguageDirection.TargetLanguage,
                                                       TM.LanguageDirection.SourceLanguage,
                                                       TM.FuzzyIndexes,
                                                       TM.Recognizers,
                                                       TM.TokenizerFlags,
                                                       TM.WordCountFlags);
            }
            else
            {
                NewTM = new FileBasedTranslationMemory(FilePath,
                                                       (TM.Description == null ? "" : TM.Description),
                                                       TM.LanguageDirection.SourceLanguage,
                                                       TM.LanguageDirection.TargetLanguage,
                                                       TM.FuzzyIndexes,
                                                       TM.Recognizers,
                                                       TM.TokenizerFlags,
                                                       TM.WordCountFlags);
            }
            TUsCount = 0;

            // manage settings, get settings from old TM
            CopySettings(TM);

            NewTM.Save();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// set TM protection
        /// </summary>
        /// <param name="psw">password to set</param>
        public void SetAdminProtection(string psw)
        {
            if (NewTM != null)
            {
                NewTM.SetAdministratorPassword(psw);

                NewTM.Save();
            }
        }