Per l'ennesima volta vorrei ringrazie FRANCESCO BALENA che accompagna tutti i miei più difficili compiti... nel manualone ho trvato un capitolino abbastanza nascosto dove ho estratto questo:
codice:Public Class ClasseProva(Of TKey, TValue) Inherits System.Collections.Generic.Dictionary(Of TKey, TValue) Private Function GetKey(ByVal index As Integer) As TKey Dim keys(Me.Count - 1) As TKey Me.Keys.CopyTo(keys, 0) Return keys(index) End Function ''' <param name="index">The index of the value to get or set.</param> Default Public Overloads Property Item(ByVal index As Integer) As TValue Get Return Me.Item(GetKey(index)) End Get Set(ByVal value As TValue) Me.Item(GetKey(index)) = value End Set End Property ''' <param name="index">The index of the element to remove.</param> Public Overloads Function Remove(ByVal index As Integer) As Boolean Return MyBase.Remove(GetKey(index)) End Function End Class

Rispondi quotando