Ejemplo n.º 1
0
        /// <summary>
        /// Shows the dialog.
        /// </summary>
        /// <param name="owner">The owner.</param>
        /// <returns><see cref="DialogResult.OK"/> if selection was successful; otherwise - <see cref="DialogResult.Cancel"/>.</returns>
        public DialogResult ShowDialog(IWin32Window owner)
        {
            var result = this.form.ShowDialog(owner);

            // if ok - get data from model
            if (result == DialogResult.OK)
            {
                this.SelectedTranslationProvider = this.model.SelectedTrados2007TranslationProvider;
            }

            return(result);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Selects the server-based trados 2007 translation provider.
 /// </summary>
 /// <param name="translationMemory">The translation memory.</param>
 /// <returns>
 ///   <c>true</c> if succeeded; otherwise - <c>false</c>
 /// </returns>
 public bool SelectServerBasedProvider(ServerBasedTrados2007TranslationMemory translationMemory)
 {
     try
     {
         var result = this.CheckServer(translationMemory);
         this.SelectedTrados2007TranslationProvider = translationMemory;
         return(result);
     }
     catch (Exception ex)
     {
         MessagingHelpers.ShowError(ex);
         return(false);
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Selects the file based provider.
 /// </summary>
 /// <param name="path">The local path.</param>
 /// <returns><c>true</c> if succeeded, otherwise - <c>false</c></returns>
 public bool SelectFileBasedProvider(string path)
 {
     try
     {
         var memory = new FileBasedTrados2007TranslationMemory(path);
         this.SelectedTrados2007TranslationProvider = memory;
         return(true);
     }
     catch (FileNotFoundException ex)
     {
         MessagingHelpers.ShowError(ex);
         return(false);
     }
     catch (ArgumentNullException ex)
     {
         MessagingHelpers.ShowError(ex, PluginResources.Exception_CouldNotOpen);
         return(false);
     }
 }