protected override void WndProc(ref Message m) { base.WndProc(ref m); // Debug.WriteLine(m.Msg.ToString("X")); if (m.Msg != AirSpaceNotificationMessage) { return; } RefreshRequired?.Invoke(this, EventArgs.Empty); }
public async Task <bool> DeleteProduct(ProductDetailsViewModel productToDelete) { var httpClient = new HttpClient(); Uri uri = new Uri($"http://localhost:5005/api/product/{productToDelete.ProductModel.Id}"); var response = await httpClient.DeleteAsync(uri); string responseString = await response.Content.ReadAsStringAsync(); if (!response.IsSuccessStatusCode) { // handle error return(false); } RefreshRequired?.Invoke(this, new EventArgs()); return(true); }
public async Task Update(ProductModel product) { foreach (var q in product.ProductQuantities) { var json = JsonConvert.SerializeObject(q); var data = new StringContent(json, Encoding.UTF8, "application/json"); var httpClient = new HttpClient(); Uri uri = new Uri($"http://localhost:5005/api/productquantity/{q.ProductQuantityId}"); var response = await httpClient.PutAsync(uri, data); string responseString = await response.Content.ReadAsStringAsync(); } RefreshRequired?.Invoke(this, new EventArgs()); }
public void Notify() { RefreshRequired?.Invoke(this, Unit.Default); }
/// <summary> /// Method for raising <see cref="RefreshRequired"/>. /// </summary> protected void OnRefreshRequired() { RefreshRequired?.Invoke(this, new EventArgs()); }
private void ReloadRequestAction_ReloadRequested(object sender, EventArgs e) { RefreshRequired?.Invoke(this, e); }
///// <summary> ///// ///// </summary> ///// <param name="type"></param> ///// <returns></returns> //private static string CSharpName(Type type) //{ // var name = type.Name; // if (!type.IsGenericType) // return name; // return $"{name.Substring(0, name.IndexOf('`'))}<{string.Join(", ", type.GetGenericArguments().Select(CSharpName))}>"; //} /// <summary> /// Raises the refresh required event. /// </summary> protected virtual void OnRefreshRequired() => RefreshRequired?.Invoke(this, EventArgs.Empty);
private void Workspace_RefreshRequired(object sender, EventArgs e) { RefreshRequired?.Invoke(sender, e); }