Exemplo n.º 1
0
        private AbstractRoute InitializeRoute <T>(IClient client, RouteOptionsBase options = null)
            where T : AbstractRoute, new()
        {
            var route = new T();

            options = options ?? new RouteOptionsBase();
            route.Initialize(Configuration, Handlers, viewRenderer, logger, client, options);

            return(route);
        }
Exemplo n.º 2
0
        public void Initialize(
            IntegrationConfiguration configuration,
            HandlerConfiguration handlers,
            IViewRenderer viewRenderer,
            ILogger logger,
            IClient client,
            RouteOptionsBase options)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            if (viewRenderer == null)
            {
                throw new ArgumentNullException(nameof(viewRenderer));
            }

            if (client == null)
            {
                throw new ArgumentNullException(nameof(client));
            }

            if (handlers == null)
            {
                throw new ArgumentNullException(nameof(handlers));
            }

            _configuration = configuration;
            _viewRenderer  = viewRenderer;
            _logger        = logger;
            _client        = client;
            _handlers      = handlers;
            _options       = options;

            _initialized = true;
        }