/// <summary>
        /// Executes the specified Bing Ads code example.
        /// </summary>
        /// <param name="example">The Bing Ads code example to execute.</param>
        public async void ExecuteExample(ExampleBase example)
        {
            try
            {
                OutputStatusMessage(string.Format("Running example: {0}\n", example.ExampleName));
                OutputStatusMessage(string.Format("Description: {0}\n", example.Description));

                await example.RunAsync(_authorizationData);

                OutputStatusMessage(string.Format("Example finished running: {0}\n", example.ExampleName));
            }

            // The example's RunAsync method should catch exceptions specific to the corresponding Bing Ads services.
            // Catch application exceptions that were not caught within the specified example.
            catch (Exception ex)
            {
                OutputStatusMessage(ex.Message);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Executes the specified Bing Ads code example.
        /// </summary>
        /// <param name="example">The Bing Ads code example to execute.</param>
        public async void ExecuteExample(ExampleBase example)
        {
            try
            {
                OutputStatusMessage(string.Format("Running example: {0}\n", example.ExampleName));
                OutputStatusMessage(string.Format("Description: {0}\n", example.Description));

                await example.RunAsync(_authorizationData);

                OutputStatusMessage(string.Format("Example finished running: {0}\n", example.ExampleName));
            }
            
                // The example's RunAsync method should catch exceptions specific to the corresponding Bing Ads services.
                // Catch application exceptions that were not caught within the specified example. 
            catch (Exception ex)
            {
                OutputStatusMessage(ex.Message);
            }
        }