/// <summary>
        /// Can be used in implementations in which a user login is required, e.g.
        /// for connecting to an online translation provider.
        /// Trados Studio fires calls method when a TranslationProviderAuthenticationException is thrown (e.g. in the TranslationProviderFactory class)
        /// If credentials are not required simply set
        /// this member to return always True.
        /// </summary>
        /// <param name="owner"></param>
        /// <param name="translationProviderUri"></param>
        /// <param name="translationProviderState"></param>
        /// <param name="credentialStore"></param>
        /// <returns></returns>
        public bool GetCredentialsFromUser(IWin32Window owner, Uri translationProviderUri, string translationProviderState, ITranslationProviderCredentialStore credentialStore)
        {
            _logger.Trace("");
            var options = new TranslationOptions(translationProviderUri);

            //only show controls for setting credentials, as that is the only thing that will end up getting saved
            var dialog = new ProviderConfDialog(options, credentialStore, null);

            dialog.DisplayForCredentialsOnly();

            return(dialog.ShowDialog(owner) == DialogResult.OK);
        }
Пример #2
0
 public void LoadState(string translationProviderState)
 {
     _logger.Trace("");
     Options = JsonConvert.DeserializeObject <TranslationOptions>(translationProviderState);
 }
Пример #3
0
 public TranslationProvider(TranslationOptions options)
 {
     _logger.Trace("");
     Options = options;
 }