00001 using System; 00002 using Gdk; 00003 using System.Reflection; 00004 00005 namespace Foodolini.Activities{ 00006 00007 [AttributeUsageAttribute(AttributeTargets.Class, Inherited = false)] 00008 public class FoodoliniActivityAttribute : System.Attribute{ 00009 private string name; 00010 private bool subActivity; 00011 private string icon; 00012 00013 public FoodoliniActivityAttribute(string name){ 00014 this.name = name; 00015 this.subActivity = false; 00016 } 00017 public FoodoliniActivityAttribute(string name, bool subActivity){ 00018 this.name = name; 00019 this.subActivity = subActivity; 00020 } 00021 public FoodoliniActivityAttribute(string name, bool subActivity, string icon){ 00022 this.name = name; 00023 this.subActivity = subActivity; 00024 this.icon = icon; 00025 } 00026 public string Name{ 00027 get{ return this.name; } 00028 } 00029 public bool IsSubActivity{ 00030 get{ 00031 return this.subActivity; 00032 } 00033 } 00034 public Pixbuf GetIcon(Assembly assembly){ 00035 if(this.icon == null) 00036 return null; 00037 return new Pixbuf(assembly, this.icon); 00038 } 00039 } 00040 }