private bool CanConnectToGoogle(Settings tmpSettings) { if (tmpSettings == null) { return(false); } // show the wait cursor and get the list of languages this.Cursor = Cursors.WaitCursor; GoogleTranslationProvider tmpProvider = new GoogleTranslationProvider(tmpSettings); this.Cursor = Cursors.Default; return(tmpProvider.IsAPIKeyValid()); }
public TranslationProviderDisplayInfo GetDisplayInfo(Uri translationProviderUri, string translationProviderState) { var translationProviderDisplayInfo = new TranslationProviderDisplayInfo(); if (string.IsNullOrEmpty(translationProviderUri.UserInfo)) { translationProviderDisplayInfo.Name = GoogleTranslationProvider.GetTranslationProviderName(); } else { translationProviderDisplayInfo.Name = string.Concat( GoogleTranslationProvider.GetTranslationProviderName(), " (", translationProviderUri.UserInfo.Substring(0, translationProviderUri.UserInfo.Length - 1), ")"); } translationProviderDisplayInfo.SearchResultImage = PluginResources.google_alpha_studio; // TODO: _translationProviderDisplayInfo.TooltipText = ??? translationProviderDisplayInfo.TranslationProviderIcon = PluginResources.favicon; return(translationProviderDisplayInfo); }