A URL node which stores some childnodes and a callback
Exemplo n.º 1
0
        public void AddHandler(HTTPDelegate HTTPDelegate,

                               String URITemplate              = "/",
                               HTTPMethod HTTPMethod           = null,
                               HTTPContentType HTTPContentType = null,

                               HTTPAuthentication URIAuthentication         = null,
                               HTTPAuthentication HTTPMethodAuthentication  = null,
                               HTTPAuthentication ContentTypeAuthentication = null,

                               HTTPDelegate DefaultErrorHandler = null,
                               URIReplacement AllowReplacement  = URIReplacement.Fail)

        {
            URINode _URINode = null;

            if (!_URINodes.TryGetValue(URITemplate, out _URINode))
            {
                _URINode = new URINode(URITemplate, URIAuthentication, HTTPDelegate, DefaultErrorHandler);
                _URINodes.Add(URITemplate, _URINode);
            }

            _URINode.AddHandler(HTTPDelegate,

                                HTTPMethod,
                                HTTPContentType,

                                HTTPMethodAuthentication,
                                ContentTypeAuthentication,

                                DefaultErrorHandler,
                                AllowReplacement);
        }
Exemplo n.º 2
0
        public void AddHandler(HTTPDelegate        HTTPDelegate,

                               String              URITemplate                 = "/",
                               HTTPMethod          HTTPMethod                  = null,
                               HTTPContentType     HTTPContentType             = null,

                               HTTPAuthentication  URIAuthentication           = null,
                               HTTPAuthentication  HTTPMethodAuthentication    = null,
                               HTTPAuthentication  ContentTypeAuthentication   = null,

                               HTTPDelegate        DefaultErrorHandler         = null,
                               URIReplacement      AllowReplacement            = URIReplacement.Fail)
        {
            URINode _URINode = null;

            if (!_URINodes.TryGetValue(URITemplate, out _URINode))
            {
                _URINode = new URINode(URITemplate, URIAuthentication, HTTPDelegate, DefaultErrorHandler);
                _URINodes.Add(URITemplate, _URINode);
            }

            _URINode.AddHandler(HTTPDelegate,

                                HTTPMethod,
                                HTTPContentType,

                                HTTPMethodAuthentication,
                                ContentTypeAuthentication,

                                DefaultErrorHandler,
                                AllowReplacement);
        }