Default accessor

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;
   }
}

Add comment

  Country flag


  • Comment
  • Preview
Loading