List<T> Compiler Error!

2 posts, 0 answers
  1. maledong
    maledong avatar
    7 posts
    Member since:
    Aug 2011

    Posted 09 Sep 2011 Link to this post

    Hey all the telerik member:)
    Here's a feedback from dd——I notice that you've compiled List<T>'s index accessor as the codes below:
    public T Item
     {
      get
      {
       if (index >= this._size)
       {
        ThrowHelper.ThrowArgumentOutOfRangeException();
       }
       return this._items[index];
      }
      set
      {
       if (index >= this._size)
       {
        ThrowHelper.ThrowArgumentOutOfRangeException();
       }
       this._items[index] = value;
       this._version = this._version + 1;
      }
     }
    Sorry but this is a wrong issue! Because in C# Microsoft suggests us using "this" index accessor instead of Item, and Item is a key word in Visual Basic.——The C# language uses the this keyword to define the indexers instead of implementing the Item property. Visual Basic implements Item as a default property, which provides the same indexing functionality.
     (See related things at:http://msdn.microsoft.com/zh-cn/library/system.collections.arraylist.item.aspx#Y970)
  2. Tsviatko Yovtchev
    Admin
    Tsviatko Yovtchev avatar
    409 posts

    Posted 15 Sep 2011 Link to this post

    Hello Maledong,

     That's definitely wrong. Thanks for letting us know. We'll fix it, so please, updatre regularly.

    Greetings,
    Tsviatko Yovtchev
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
Back to Top