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(); } }
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(); } }
protected virtual void OnPutAction(PutEventArgs <string> e) { OnPut?.Invoke(this, e); }
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)); }
protected void OnPutAction(PutEventArgs <Dictionary <string, object> > e) { OnPut?.Invoke(this, e); }
protected virtual void OnPutAction(PutEventArgs <ObjectType> e) { OnPut?.Invoke(this, e); }