使用Reflection在运行系统中访问类中的项目列表?

时间:2011-08-12 21:51:06

标签: c# reflection

我有一个自定义类作为属性“AttributesCustomList”,这个类包含LIST ..

[XmlElement("AttributesCustomList")]
CustomClass _AttributesCustomList;
[CategoryAttribute("Custom"), ReadOnly(false),
Description("This property is customised to put new attributes")]
//[RefreshProperties(RefreshProperties.All)]
[RulesCriteria("Custom AttributesList")]
public CustomClass AttributesCustomList
{
    get { return _AttributesCustomList; }
    set { _AttributesCustomList = value; }
}


public class CustomClass : CollectionBase, ICustomTypeDescriptor
{ 
    public void Add(CustomProperty Value)
    {
       base.List.Add(Value);
    }

    /// <summary>
    /// Remove item from List
    /// </summary>
    /// <param name="Name"></param>
    public void Remove(string Name)
    {
        foreach (CustomProperty prop in base.List)
        {
            if (prop.Name == Name)
            {
                base.List.Remove(prop);
                return;
            }
        }
    }

}

我想使用Reflection在运行时访问其项目列表,我该怎么办?日Thnx

0 个答案:

没有答案