Ejemplo n.º 1
0
        /// <summary>
        /// Inform the user that he needs to enter some text,
        /// to send it to the Text Analytics API, so that he can get information on it.
        /// Then Wait for their input.
        /// - No text entered => get out of this service
        /// - text entered => starts service and then ask again when response received
        /// </summary>
        private static async void AskTextFromUser()
        {
            Console.WriteLine("You chosed, Text Analytics...");
            Console.WriteLine("Please enter your text (type nothing and press enter to get back to menu):");
            string input = Console.ReadLine();

            // Check if the user decides to get back
            if (string.IsNullOrWhiteSpace(input))
            {
                UserChoice = UserChoices.None;
            }
            else
            {
                // Start the application with the input text
                TextAnalyticsApp.TextToAnalyse = input;
                await TextAnalyticsApp.Start();
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Call the TextAnalytics request method.
 /// The binding in the WPF automatically handles the result.
 /// </summary>
 private async void HandleTextAnalyticsApiCall()
 {
     // Send the request
     await TextAnalyticsApp.Start();
 }