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