예제 #1
0
        public static void Main(string[] args)
        {
            if (args != null && args.Length > 0)
            {
                if (args.Length != 1)
                {
                    DisplayUsage();
                    throw new ArgumentException("Incorrect number of arguments");
                }

                string blobSas = args[0];

                try
                {
                    MapperTask mapperTask = new MapperTask(blobSas);
                    mapperTask.RunAsync().Wait();
                }
                catch (AggregateException e)
                {
                    SampleHelpers.PrintAggregateException(e);

                    throw;
                }
            }
            else
            {
                DisplayUsage();
            }
        }
예제 #2
0
        public static void Main(string[] args)
        {
            try
            {
                // These methods involve user prompts to get some parameters and are therefore handled synchronously.
                AzureContext azureContext = GetAzureContext();
                string       location     = PromptUserForLocation();
                string       accountName  = PromptUserForAccountName();

                // Call the asynchronous version of the Main() method. This is done so that we can await various
                // calls to async methods within the "Main" method of this console application.
                MainAsync(azureContext, accountName, location).Wait();
            }
            catch (AggregateException ae)
            {
                Console.WriteLine();
                Console.WriteLine("One or more exceptions occurred.");
                Console.WriteLine();

                SampleHelpers.PrintAggregateException(ae.Flatten());
            }
            finally
            {
                Console.WriteLine();
                Console.WriteLine("Sample complete, hit ENTER to exit...");
                Console.ReadLine();
            }
        }
예제 #3
0
        public static void Main(string[] args)
        {
            try
            {
                ReducerTask reducerTask = new ReducerTask();
                reducerTask.RunAsync().Wait();
            }
            catch (AggregateException e)
            {
                SampleHelpers.PrintAggregateException(e);

                throw;
            }
        }
예제 #4
0
        public static void Main(string[] args)
        {
            try
            {
                SampleJobManagerTask jobManagerTask = new SampleJobManagerTask();

                jobManagerTask.RunAsync().Wait();
            }
            catch (AggregateException e)
            {
                SampleHelpers.PrintAggregateException(e);

                throw;
            }
        }
예제 #5
0
        public static void Main(string[] args)
        {
            try
            {
                JobSubmitter jobSubmitter = new JobSubmitter();

                jobSubmitter.RunAsync().Wait();
            }
            catch (AggregateException e)
            {
                SampleHelpers.PrintAggregateException(e);

                throw;
            }
        }
예제 #6
0
        private static void Main()
        {
            // Call the asynchronous version of the Main() method. This is done so that we can await various
            // calls to async methods within the "Main" method of this console application.

            try
            {
                AccountSettings accountSettings = SampleHelpers.LoadAccountSettings();
                MainAsync(accountSettings).Wait();
            }
            catch (AggregateException ex)
            {
                SampleHelpers.PrintAggregateException(ex);
                throw;
            }

            Console.WriteLine("Press return to exit...");
            Console.ReadLine();
        }
예제 #7
0
        public static void Main(string[] args)
        {
            // This will boost parallel submission speed for REST APIs. If your use requires many simultaneous service calls set this number to something large, such as 100.
            // See: https://msdn.microsoft.com/en-us/library/system.net.servicepointmanager.defaultconnectionlimit.aspx for more info.
            System.Net.ServicePointManager.DefaultConnectionLimit = 20;

            try
            {
                JobSubmitter jobSubmitter = new JobSubmitter();
                jobSubmitter.RunAsync().Wait();
            }
            catch (AggregateException aggregateException)
            {
                // Go through all exceptions and dump useful information
                SampleHelpers.PrintAggregateException(aggregateException);

                throw;
            }

            Console.WriteLine("Press return to exit...");
            Console.ReadLine();
        }
예제 #8
0
        public static void Main(string[] args)
        {
            try
            {
                // volání asynchroní metody main
                MainAsync().Wait();
            }
            catch (AggregateException ae)
            {
                Console.WriteLine();
                Console.WriteLine("One or more exceptions occurred.");
                Console.WriteLine();

                SampleHelpers.PrintAggregateException(ae);
            }
            finally
            {
                Console.WriteLine();
                Console.WriteLine("Sample complete, hit ENTER to exit...");
                Console.ReadLine();
            }
        }
예제 #9
0
        public static void Main(string[] args)
        {
            try
            {
                // Call the asynchronous version of the Main() method. This is done so that we can await various
                // calls to async methods within the "Main" method of this console application.
                MainAsync().Wait();
            }
            catch (AggregateException ae)
            {
                Console.WriteLine();
                Console.WriteLine("One or more exceptions occurred.");
                Console.WriteLine();

                SampleHelpers.PrintAggregateException(ae);
            }
            finally
            {
                Console.WriteLine();
                Console.WriteLine("Sample complete, hit ENTER to exit...");
                Console.ReadLine();
            }
        }