public ITranslationProvider[] Browse(IWin32Window owner, LanguagePair[] languagePairs, ITranslationProviderCredentialStore credentialStore)
 {
     if (languagePairs.Length > 0)
     {
         TartuNLPConfigForm dialog = new TartuNLPConfigForm(new TartuNLPOptions(), languagePairs);
         if (dialog.ShowDialog(owner) == DialogResult.OK)
         {
             TartuNLPProvider testProvider = new TartuNLPProvider(dialog.Options);
             return(new ITranslationProvider[] { testProvider });
         }
     }
     else
     {
         MessageBox.Show("Please configure at least one language pair before setting up the plugin", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     return(null);
 }
        public bool Edit(IWin32Window owner, ITranslationProvider translationProvider, LanguagePair[] languagePairs, ITranslationProviderCredentialStore credentialStore)
        {
            TartuNLPProvider editProvider = translationProvider as TartuNLPProvider;

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

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

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