示例#1
0
        /// <summary>
        /// Show the plug-in settings form when the user is adding the translation provider plug-in
        /// through the GUI of SDL Trados Studio
        /// </summary>
        /// <param name="owner"></param>
        /// <param name="languagePairs"></param>
        /// <param name="credentialStore"></param>
        /// <returns></returns>
        #region "Browse"
        public ITranslationProvider[] Browse(IWin32Window owner, LanguagePair[] languagePairs, ITranslationProviderCredentialStore credentialStore)
        {
            var dialog = new TausProviderConfDialog(new TausTranslationOptions());

            if (dialog.ShowDialog(owner) != DialogResult.OK)
            {
                return(null);
            }
            var testProvider = new TausTranslationProvider(dialog.Options);

            return(new ITranslationProvider[] { testProvider });
        }
示例#2
0
        /// <summary>
        /// If the plug-in settings can be changed by the user,
        /// SDL Trados Studio will display a Settings button.
        /// By clicking this button, users raise the plug-in user interface,
        /// in which they can modify any applicable settings, in our implementation
        /// the delimiter character and the list file name.
        /// </summary>
        /// <param name="owner"></param>
        /// <param name="translationProvider"></param>
        /// <param name="languagePairs"></param>
        /// <param name="credentialStore"></param>
        /// <returns></returns>
        #region "Edit"
        public bool Edit(IWin32Window owner, ITranslationProvider translationProvider, LanguagePair[] languagePairs, ITranslationProviderCredentialStore credentialStore)
        {
            var editProvider = translationProvider as TausTranslationProvider;

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

            var dialog = new TausProviderConfDialog(editProvider.Options);

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