private EnumProxy(object v) { this.realValue = v; System.Type t = v.GetType(); FieldInfo fi = t.GetField(v.ToString()); object[] attr = fi.GetCustomAttributes(typeof(EnumTitleAttribute), false); if (null == attr || attr.Length == 0) { this.attribute = new EnumTitleAttribute(v.ToString()); } else { this.attribute = attr[0] as EnumTitleAttribute; } }
private EnumProxy(object v) { this.realValue = v; System.Type t = v.GetType(); FieldInfo fi = t.GetField(v.ToString()); object[] attr = fi.GetCustomAttributes(typeof(EnumTitleAttribute), false); if (null == attr || attr.Length == 0) this.attribute = new EnumTitleAttribute(v.ToString()); else this.attribute = attr[0] as EnumTitleAttribute; }