00001 00002 using System; 00003 using Gtk; 00004 using Foodolini.BusinessLogic; 00005 00006 namespace Foodolini.Activities.FoodRegistration 00007 { 00011 [TreeNode(ListOnly = true)] 00012 public class FoodItemAdapter : TreeNode 00013 { 00014 public FoodItem FoodItem { get; private set; } 00015 00016 public FoodItemAdapter (FoodItem foodItem){ 00017 this.FoodItem = foodItem; 00018 } 00019 00020 [Gtk.TreeNodeValue(Column = 0)] 00021 public string Name { 00022 get { 00023 return this.FoodItem.Ingredient.LongDescription; 00024 } 00025 } 00026 00027 [Gtk.TreeNodeValue(Column = 1)] 00028 public double Quantity { 00029 get { return this.FoodItem.Quantity; } 00030 } 00031 00032 [Gtk.TreeNodeValue(Column = 2)] 00033 public DateTime ExpirationDate { 00034 get { return this.FoodItem.ExpirationDate ; } 00035 } 00036 00040 public void ReportChange(){ 00041 this.OnChanged(); 00042 } 00043 } 00044 }