Default accessor

by alski 2. November 2005 21:58

Now hopefully I wont forget this again. :) You need to declare one of these when you derive a collection class from CollectionBase and use it in XmlSerialization. I wonder if this has changed for dotNet framework v2.0

The syntax for a default accessor is

public T this[int index]
{
   get
   {
        return (T) List[i];
   }
   set
   {
        List[i] = value;
   }
}

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

RecentComments

Comment RSS