Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ConsoleApplication" /> class.
        /// </summary>
        /// <param name="applicationContext">An instance of the strongly-typed application context.</param>
        /// <param name="arguments">A collection of all arguments passed through to the application
        /// from the command line.</param>
        /// <exception cref="ArgumentNullException">Thrown when the given application context or collection of arguments is null.</exception>
        protected ConsoleApplication(TContext applicationContext, string[] arguments)
        {
            VerificationProvider.VerifyNotNull(applicationContext, "applicationContext");
            VerificationProvider.VerifyNotNull(arguments, "arguments");

            mRegistrar = new ExecutableCommandRegistrar(mObjectConverterFactory);

            mArguments = arguments;

            // Initialize and load the application context
            mApplicationContext = applicationContext;
            mApplicationContext.Load();
        }
Beispiel #2
0
 /// <summary>
 /// Allows derived types to perform custom registration of application-specific supported commands.
 /// </summary>
 /// <param name="registrar">Handler of executable command registration.</param>
 protected virtual void RegisterCommands(ExecutableCommandRegistrar registrar)
 {
 }