/// <summary>
 /// Runs the application.
 /// </summary>
 /// <param name="configuration">The configuration.</param>
 /// <param name="args">The arguments.</param>
 public static void RunApplication(AdaptiveConsoleConfiguration configuration, string[] args)
 {
     var consoleApplication = GetApplication(configuration, args);
     consoleApplication.Init();
     consoleApplication.Run();
     consoleApplication.Done();
 }
 public CatoolApplication(AdaptiveConsoleConfiguration configuration, string[] args) : base(configuration, args)
 {
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="ConsoleApplicationBase"/> class.
        /// </summary>
        /// <param name="configuration">The configuration.</param>
        /// <param name="args">The arguments.</param>
        protected ConsoleApplicationBase(AdaptiveConsoleConfiguration configuration, string[] args)
        {
            // Creates the argument information list.
            this.Arguments = new List<ArgumentInfo>();
            // Populates the argument information list. Initially each argument is the type of Parameter.
            foreach (string arg in args)
                this.Arguments.Add(new ArgumentInfo(arg, ArgumentCategory.Parameter));

            // Gets the application configuration.
            this.AdaptiveConsoleConfig = configuration;

            // Creates the option contract repository.
            this.OptionContractRepository = new List<OptionContractInfo>();
        }
 private static ConsoleApplicationBase GetApplication(AdaptiveConsoleConfiguration configuration, string[] args)
 {
     try
     {
         var type = Type.GetType(configuration.Provider);
         var objargs = new object[] { configuration, args };
         return (ConsoleApplicationBase) Activator.CreateInstance(type, objargs);
     }
     catch (Exception e)
     {
         throw new AdaptiveConsoleException(AdaptiveConsoleException.GENERAL_EXCEPTION_MESSAGE, e);
     }
 }