Indexed Properties

C# does not allow you to create 'named' indexed properties.
There are no plans to include the ability to declare your own properties that take parameters.
Instead of using an indexed property you should use a type with an indexer which is returned by a property.
The property is there to get access to an object and belongs to the parent object.
The indexer is used to enumerate through an object and belongs to the returned object.


VB.Net

This allows more than one indexed property on a type.
This allows property getters and setters to take arguments


Public Property Something(ByVal a As String) As String 
   Get
      Return MyDictionary(v)
   End Get
   Set
      MyDictionary(v) = value
   End Set
End Property



© 2020 Better Solutions Limited. All Rights Reserved. © 2020 Better Solutions Limited TopPrevNext