private string[] GetProfilesNames() { string path = ReturnProjectDirectory.GetProfilesPath(); string[] files = Directory.GetFiles(path, "*json"); return(files); }
private void OwnInitializeComponents() { ToolTip.SetToolTip(this.NameLabel, Product.Product.Name); NameLabel.Text = Product.Product.Name; KcalValue_Label.Text = Convert.ToString(Math.Round(Product.Product.Total_kcal_per_100 * (Product.Mass / 100), 1)) + " kcal"; FatValue_Label.Text = Convert.ToString(Math.Round(Product.Product.Fat_Total * (Product.Mass / 100), 1)) + " g"; ProteinValue_Label.Text = Convert.ToString(Math.Round(Product.Product.Protein * (Product.Mass / 100), 1)) + " g"; CarboValue_Label.Text = Convert.ToString(Math.Round(Product.Product.Carbohydrates * (Product.Mass / 100), 1)) + " g"; Weight_Label.Text = Product.Mass.ToString() + " g | ml"; try { ProductPicture.Image = Image.FromFile(ReturnProjectDirectory.GetProductImagePath(Product.Product.Name)); } catch { ProductPicture.Image = Properties.Resources.default_meal; } }