2 // System.ComponentModel.MemberDescriptor.cs
5 // Miguel de Icaza (miguel@ximian.com)
7 // (C) Ximian, Inc. http://www.ximian.com
10 namespace System.ComponentModel {
12 public class MemberDescriptor {
16 protected MemberDescriptor (string name, Attribute [] attrs)
22 protected MemberDescriptor (MemberDescriptor reference, Attribute [] attrs)
24 name = reference.name;
28 protected MemberDescriptor (string name)
33 protected MemberDescriptor (MemberDescriptor reference)
35 name = reference.name;
36 attrs = reference.attrs;
39 protected virtual Attribute [] AttributeArray {
49 // FIXME: Implement Attributes property
50 [MonoTODO ("Implement Attributes property too")]
51 public virtual string Category {
53 foreach (Attribute attr in attrs){
57 if (attr is CategoryAttribute){
58 return ((CategoryAttribute) attr).Category;
65 public virtual string Description {
67 foreach (Attribute attr in attrs){
68 if (attr is DescriptionAttribute)
69 return ((DescriptionAttribute) attr).Description;
76 public virtual bool DesignTimeOnly {
78 foreach (Attribute attr in attrs){
79 if (attr is DesignOnlyAttribute)
80 return ((DesignOnlyAttribute) attr).IsDesignOnly;
88 // FIXME: Is there any difference between DisplayName and Name?
90 [MonoTODO ("Does this diff from Name ?")]
91 public virtual string DisplayName {
97 public virtual string Name {
103 public virtual bool IsBrowsable {
105 foreach (Attribute attr in attrs){
106 if (attr is BrowsableAttribute)
107 return ((BrowsableAttribute) attr).Browsable;
114 protected virtual int NameHashCode {
116 return name.GetHashCode ();