Example #1
0
        protected Route(IReadOnlyCollection <string> parts, Method method, IPersister persister, interfaces.Logging.ILogger logger)
        {
            // make sure that the parts are 'clean'
            _parts = CleanParts(parts);

            // we then need to get the parameters
            _parameters = GetParameterNames(parts);

            // save the method as well.
            _method = method;

            // set the persister.
            Persister = persister ?? throw new ArgumentNullException(nameof(persister));

            // set the logger
            Logger = logger ?? throw new ArgumentNullException(nameof(logger));
        }
Example #2
0
        public HttpServer(IWebServer webServer, IPersister persister, interfaces.Logging.ILogger logger)
        {
            if (!HttpListener.IsSupported)
            {
                throw new NotSupportedException("The Http Listener is not supported.");
            }

            // save our persister
            _persister = persister ?? throw new ArgumentNullException(nameof(persister));

            // the webserver config
            _webServer = webServer ?? throw new ArgumentNullException(nameof(webServer));

            // the logger
            _logger = logger ?? throw new ArgumentNullException(nameof(logger));

            // create our listener.
            _listener = new HttpListener();
        }
Example #3
0
 protected RouteFile(string script, string contentType, IPersister persister, interfaces.Logging.ILogger logger) : base(new[] { script }, Method.Get, persister, logger)
 {
     _resourceName = $"myoddweb.desktopsearch.http.Resources.{script}";
     ContentType   = contentType;
 }
Example #4
0
 public TransactionPerformanceCounter(IPerformance performance, string counterName, interfaces.Logging.ILogger logger) :
     base(performance.CategoryName, performance.CategoryHelp, counterName, helper.Performance.Type.CountPerSeconds, logger)
 {
 }
Example #5
0
 /// <summary>
 /// This is the search route
 /// The method is 'search' while the value is the query.
 /// </summary>
 public Search(IPersister persister, interfaces.Logging.ILogger logger) :
     base(new[] { "Search" }, Method.Post, persister, logger)
 {
 }
 public StyleSheet(string script, IPersister persister, interfaces.Logging.ILogger logger) : base(script, "text/css", persister, logger)
 {
 }
Example #7
0
 public Javascript(string script, IPersister persister, interfaces.Logging.ILogger logger) : base(script, "application/javascript", persister, logger)
 {
 }
Example #8
0
 /// <summary>
 /// This is the search route
 /// The method is 'search' while the value is the query.
 /// </summary>
 public Home(IPersister persister, interfaces.Logging.ILogger logger) : base(new string [0], Method.Get, persister, logger)
 {
 }