Default public Topic; Item( int index) {
   get {
       return CType(List(index), Topic);
   }
   set { ( value as Topic)
       List(index) = value;
   }
}

解决方案 »

  1.   

    using System;
    using System.Collections;namespace InformationClass
    {
    /// <summary>
    /// Users 的摘要说明。
    /// </summary>
    public class Users:System.Collections.CollectionBase
    {
    }
    .......
    //属性定义
    public User this[int index]
    {
    get
    {
    return (User) List[index];
    }
    }
      

  2.   

    Default public Topic; Item( int index) {
       get {
           return CType(List(index), Topic);
       }
       set { ( value as Topic)
           List(index) = value;
       }
    }语法错误?不知道还有什么方法,能不能不用索引器完成Item属性??
      

  3.   

    public Topic this[int index]
    {
        get { return List[index] as Topic; }
        set { List[index] = value; }
    }
      

  4.   

    带参数的属性就变成索引器了
    一个参数;
    public Topic this[int index]
    {
        get { return List[index] as Topic; }
        set { List[index] = value; }
    }
    多个参数
    public Topic this[int i,int y]
    {
        get { return List[i,j] as Topic; }
        set { List[i,j] = value; }
    }