public ITranslationProvider CreateTranslationProvider(Uri translationProviderUri, string translationProviderState, ITranslationProviderCredentialStore credentialStore)
        {
            DtSearch4StudioProvider dtSearch4StudioProvider;

            try
            {
                var persistenceService = new PersistenceService();
                var providerSettings   = persistenceService.GetProviderSettings();

                // in case we didn't have any settings stored there is no need to load the provider
                if (providerSettings == null)
                {
                    MessageBox.Show(Constants.EmptyProvider, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return(null);
                }
                //var searchService = new SearchService();
                dtSearch4StudioProvider = new DtSearch4StudioProvider(providerSettings);
            }
            catch (Exception ex)
            {
                Log.Logger.Error($"{Constants.CreateTranslationProvider}: {ex.Message}\n {ex.StackTrace}");
                throw ex;
            }
            return(dtSearch4StudioProvider);
        }
Exemplo n.º 2
0
        public bool Edit(IWin32Window owner, ITranslationProvider translationProvider, LanguagePair[] languagePairs, ITranslationProviderCredentialStore credentialStore)
        {
            var persistenceService = new PersistenceService();
            var settings           = persistenceService.GetProviderSettings();

            SetTranslationProvider((DtSearch4StudioProvider)translationProvider, settings);

            return(true);
        }