示例#1
0
        /// <summary>
        /// Initializes an instance of <see cref="ApplicationConfiguration"/>.
        /// </summary>
        public ApplicationConfiguration(IReadOnlyList <Type> commandTypes,
                                        IReadOnlyList <Type> customDirectives,
                                        ICliExceptionHandler exceptionHandler,
                                        bool isInteractiveModeAllowed,
                                        bool isAdvancedInputAllowed)
        {
            CommandTypes     = commandTypes;
            DirectiveTypes   = customDirectives;
            ExceptionHandler = exceptionHandler;

            IsInteractiveModeAllowed = isInteractiveModeAllowed;
            IsAdvancedInputAllowed   = isAdvancedInputAllowed;
        }
示例#2
0
        /// <summary>
        /// Configures the application to use the specified implementation of <see cref="ICliExceptionHandler"/>.
        /// </summary>
        public CliApplicationBuilder UseExceptionHandler(ICliExceptionHandler handler)
        {
            _exceptionHandler = handler;

            return(this);
        }