public ListTranslationProviderLanguageDirection(ListTranslationProvider provider, LanguagePair languages)
 {
     _provider          = provider;
     _languageDirection = languages;
     _options           = _provider.Options;
     _visitor           = new ListTranslationProviderElementVisitor(_options);
 }
예제 #2
0
        public ITranslationProvider[] Browse(IWin32Window owner, LanguagePair[] languagePairs, ITranslationProviderCredentialStore credentialStore)
        {
            NeurotolgeConfDialog dialog = new NeurotolgeConfDialog(new ListTranslationOptions(), languagePairs);

            if (dialog.ShowDialog(owner) == DialogResult.OK)
            {
                ListTranslationProvider testProvider = new ListTranslationProvider(dialog.Options);
                return(new ITranslationProvider[] { testProvider });
            }
            return(null);
        }
        public ITranslationProvider CreateTranslationProvider(Uri translationProviderUri, string translationProviderState, ITranslationProviderCredentialStore credentialStore)
        {
            if (!SupportsTranslationProviderUri(translationProviderUri))
            {
                throw new Exception("Cannot handle URI.");
            }

            ListTranslationProvider tp = new ListTranslationProvider(new ListTranslationOptions(translationProviderUri));

            return(tp);
        }
예제 #4
0
        public bool Edit(IWin32Window owner, ITranslationProvider translationProvider, LanguagePair[] languagePairs, ITranslationProviderCredentialStore credentialStore)
        {
            ListTranslationProvider editProvider = translationProvider as ListTranslationProvider;

            if (editProvider == null)
            {
                return(false);
            }

            NeurotolgeConfDialog dialog = new NeurotolgeConfDialog(editProvider.Options, languagePairs);

            if (dialog.ShowDialog(owner) == DialogResult.OK)
            {
                editProvider.Options = dialog.Options;
                return(true);
            }
            return(false);
        }