Пример #1
0
        private SimpleHttpHandler(ContentState state)
        {
            _content = state;
            _handlers = new Dictionary<string, IRequestHandler[]>(StringComparer.OrdinalIgnoreCase);

            ContentRequestHandler content = new ContentRequestHandler(_content);
            SearchRequestHandler search = new SearchRequestHandler(_content);
            PingbackHandler pingback = new PingbackHandler(_content);
            PublishRequestHandler publish = new PublishRequestHandler(_content);

            _handlers.Add("HEAD", new IRequestHandler[] 
            {
                content,
                pingback,
            });
            _handlers.Add("GET", new IRequestHandler[] 
            {
                search, 
                content,
                pingback,
            });
            _handlers.Add("POST", new IRequestHandler[] 
            { 
                publish,
                pingback,
            });
        }
 public ContentRequestHandler(ContentState contentState)
 {
     _contentState = contentState;
 }
Пример #3
0
 public PingbackHandler(ContentState content)
 {
     _content = content;
     _filename = Path.Combine(_content.StoragePath, PingbackFile);
     _lockName = BitConverter.ToString(Hash.MD5(Encoding.UTF8.GetBytes(_filename)).ToArray());
 }
Пример #4
0
 public SearchRequestHandler(ContentState content)
 {
     _content = content;
 }
 public PublishRequestHandler(ContentState content)
 {
     _content = content;
 }
Пример #6
0
 public PingbackHandler(ContentState content)
 {
     _content  = content;
     _filename = Path.Combine(_content.StoragePath, PingbackFile);
     _lockName = BitConverter.ToString(Hash.MD5(Encoding.UTF8.GetBytes(_filename)).ToArray());
 }
Пример #7
0
 public ContentRequestHandler(ContentState contentState)
 {
     _contentState = contentState;
 }
Пример #8
0
 public SearchRequestHandler(ContentState content)
 {
     _content = content;
 }