00001 using Gtk; 00002 using System; 00003 using Foodolini.BusinessLogic; 00004 00005 namespace Foodolini.Activities.Home 00006 { 00007 [TreeNode(ListOnly = true)] 00008 public class FoodItemAdapter : TreeNode 00009 { 00010 public FoodItem FoodItem { get; private set; } 00011 00012 public FoodItemAdapter (FoodItem foodItem) 00013 { 00014 this.FoodItem = foodItem; 00015 } 00016 00017 [Gtk.TreeNodeValue(Column = 0)] 00018 public string Name { 00019 get { return this.FoodItem.Ingredient.LongDescription; } 00020 } 00021 00022 [Gtk.TreeNodeValue(Column = 1)] 00023 public string Quantity { 00024 get { return this.FoodItem.Quantity.ToString("0.00"); } 00025 } 00026 00027 [Gtk.TreeNodeValue(Column = 2)] 00028 public DateTime ExpirationDate { 00029 get { return this.FoodItem.ExpirationDate; } 00030 } 00031 00032 [Gtk.TreeNodeValue(Column = 3)] 00033 public string IsOpen 00034 { 00035 get { 00036 if (this.FoodItem.IsOpen) 00037 return "Open"; 00038 else 00039 return "Closed"; 00040 } 00041 00042 } 00043 } 00044 }