private void handleRequest(HttpListenerContext context)
        {
            var eventArgs = new HttpEventArgs(context.Request, context.Response);
            var method    = context.Request.HttpMethod;

            try
            {
                if (method == HttpMethod.Get.Method)
                {
                    OnGet?.Invoke(this, eventArgs);
                }
                else if (method == HttpMethod.Post.Method)
                {
                    OnPost?.Invoke(this, eventArgs);
                }
                else if (method == HttpMethod.Put.Method)
                {
                    OnPut?.Invoke(this, eventArgs);
                }
            }
            catch (NotImplementedException)
            {
                context.Response.Abort();
            }
        }
Пример #2
0
 public void Put(int row, int column, int value)
 {
     //помещает значение в соответствующую ячейку
     if (row < table.Count && column < table.First().Count)
     {
         table[row][column] = value;
         OnPut?.Invoke(this, new DataModelPutEventArgs(value, row, column));
     }
     else
     {
         throw new ArgumentException();
     }
 }
Пример #3
0
 protected virtual void OnPutAction(PutEventArgs <string> e)
 {
     OnPut?.Invoke(this, e);
 }
Пример #4
0
 private void TriggerOnPut(string key, string region, CacheActionEventArgOrigin origin = CacheActionEventArgOrigin.Local)
 {
     OnPut?.Invoke(this, new CacheActionEventArgs(key, region, origin));
 }
 private void TriggerOnPut(TKey key, CacheActionEventArgOrigin origin = CacheActionEventArgOrigin.Local)
 {
     OnPut?.Invoke(this, new CacheActionEventArgs <TKey>(key, origin));
 }
Пример #6
0
 protected void OnPutAction(PutEventArgs <Dictionary <string, object> > e)
 {
     OnPut?.Invoke(this, e);
 }
Пример #7
0
 protected virtual void OnPutAction(PutEventArgs <ObjectType> e)
 {
     OnPut?.Invoke(this, e);
 }