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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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());
        }
Exemple #4
0
 public void Notify()
 {
     RefreshRequired?.Invoke(this, Unit.Default);
 }
Exemple #5
0
 /// <summary>
 /// Method for raising <see cref="RefreshRequired"/>.
 /// </summary>
 protected void OnRefreshRequired()
 {
     RefreshRequired?.Invoke(this, new EventArgs());
 }
Exemple #6
0
 private void ReloadRequestAction_ReloadRequested(object sender, EventArgs e)
 {
     RefreshRequired?.Invoke(this, e);
 }
Exemple #7
0
        ///// <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);
 }