00001 00002 using System; 00003 using Gtk; 00004 using Foodolini.Activities; 00005 using Foodolini.BusinessLogic; 00006 00007 namespace Foodolini.Activities.Ingredients 00008 { 00012 [TreeNode(ListOnly = true)] 00013 public class IngredientAdapter : TreeNode 00014 { 00018 public Ingredient Ingredient { get; private set; } 00019 00026 public IngredientAdapter (Ingredient ingredient) 00027 { 00028 this.Ingredient = ingredient; 00029 } 00030 00034 [Gtk.TreeNodeValue(Column = 0)] 00035 public string Name { 00036 get { return this.Ingredient.LongDescription; } 00037 } 00038 00042 [Gtk.TreeNodeValue(Column = 1)] 00043 public double Protein { 00044 get { return this.Ingredient.Protein; } 00045 } 00046 00050 [Gtk.TreeNodeValue(Column = 2)] 00051 public double Carbohydrates { 00052 get { return this.Ingredient.Carbohydrates; } 00053 } 00054 00058 [Gtk.TreeNodeValue(Column = 3)] 00059 public double Fat { 00060 get { return this.Ingredient.Fat; } 00061 } 00062 00063 } 00064 }