Пример #1
0
        public ITranslationProvider[] Browse(IWin32Window owner, LanguagePair[] languagePairs, ITranslationProviderCredentialStore credentialStore)
        {
            var options = new MyMtTranslationOptions();

            //get credentials
            var getCredGt = GetCredentials(credentialStore, "deeplprovider:///");
            var dialog    = new MyMtDialog(options, credentialStore);

            if (dialog.ShowDialog(owner) == DialogResult.OK)
            {
                var provider = new MyMtTranslationProvider(options);
                var apiKey   = dialog.Options.ApiKey;
                SetDeeplCredentials(credentialStore, apiKey, true);
                return(new ITranslationProvider[] { provider });
            }
            return(null);
        }
 public MyMtTranslationProviderLanguageDirection(MyMtTranslationProvider deepLMtTranslationProvider, LanguagePair languageDirection)
 {
     _deepLMtTranslationProvider = deepLMtTranslationProvider;
     _languageDirection          = languageDirection;
     _options = deepLMtTranslationProvider.Options;
 }