/// <summary> /// Create a new Translate command with a given default to language /// </summary> /// <param Name="defaultToLanguage">The default language the command should be translated to</param> public TranslateCommand(string defaultToLanguage, PCamera camera) { DefaultToLanguage = defaultToLanguage; Camera = camera; //Request a _AccessToken from the Azure Bing Translate service TranslateToken = new AzureToken(Resources.ClientSecrets.ClientID, Resources.ClientSecrets.ClientSecret, @"http://api.microsofttranslator.com"); //Create hooks for the translate and language detection services using the translate _AccessToken for authorisation TranslateService = new AzureServiceHelper(@"http://api.microsofttranslator.com/v2/Http.svc/Translate", TranslateToken); LanguageDetectService = new AzureServiceHelper(@"http://api.microsofttranslator.com/v2/Http.svc/Detect", TranslateToken); }
/// <summary> /// Create a new AzureServiceHelper /// </summary> /// <param Name="serviceUri">The URI of the service being called</param> /// <param Name="_AccessToken">The _AccessToken authorising the use of the service</param> public AzureServiceHelper(string serviceUri, AzureToken token) { ServiceURI = serviceUri; Token = token; }