00001 using System; 00002 using Foodolini.BusinessLogic; 00003 using Gtk; 00004 00005 namespace Foodolini.Activities.Ingredients 00006 { 00007 [TreeNode(ListOnly = true)] 00008 public class NutrientAdapter : TreeNode 00009 { 00010 public Nutrient Nutrient {get; private set;} 00011 private double nutrientValue; 00012 00013 public NutrientAdapter(Nutrient nutrient, double nutrientValue) 00014 { 00015 this.Nutrient = nutrient; 00016 this.nutrientValue = nutrientValue; 00017 } 00018 00019 [Gtk.TreeNodeValue(Column = 0)] 00020 public string Name{ 00021 get {return this.Nutrient.Description;} 00022 } 00023 00024 [Gtk.TreeNodeValue(Column = 1)] 00025 public double Value{ 00026 get {return this.nutrientValue;} 00027 set { this.nutrientValue = value;} 00028 } 00029 00030 [Gtk.TreeNodeValue(Column=2)] 00031 public string Unit 00032 { 00033 get { return this.Nutrient.Unit; } 00034 } 00035 } 00036 }