G
Guest
Hi, how is possible to have a strong-typed implementation of Item property in
the same class as IList is implemented?
Default Public Property Item(ByVal index As Integer) As Object
Implements System.Collections.IList.Item
Get
Return Me(index)
End Get
Set(ByVal Value As Object)
Me(index) = CType(Value, Azienda)
End Set
End Property
Public Overridable Property Item(ByVal index As Integer) As Azienda
Get
Return DirectCast(coll(index), Azienda)
End Get
Set(ByVal Value As Azienda)
coll(index) = Value
CType(coll(index), Azienda).RowState = DataRowState.Modified
RaiseEvent ListChanged(Me, New
ListChangedEventArgs(ListChangedType.ItemChanged, index))
End Set
End Property
The code above give me this design time error:
'Public Default Property Item(index As Integer) As Object' and 'Public
Overridable Property Item(index As Integer) As Azienda' cannot overload each
other because they differ only by return types.
I know to make it in C# but not in VB.NET
Can anyone help me?
Thanks in advance.
the same class as IList is implemented?
Default Public Property Item(ByVal index As Integer) As Object
Implements System.Collections.IList.Item
Get
Return Me(index)
End Get
Set(ByVal Value As Object)
Me(index) = CType(Value, Azienda)
End Set
End Property
Public Overridable Property Item(ByVal index As Integer) As Azienda
Get
Return DirectCast(coll(index), Azienda)
End Get
Set(ByVal Value As Azienda)
coll(index) = Value
CType(coll(index), Azienda).RowState = DataRowState.Modified
RaiseEvent ListChanged(Me, New
ListChangedEventArgs(ListChangedType.ItemChanged, index))
End Set
End Property
The code above give me this design time error:
'Public Default Property Item(index As Integer) As Object' and 'Public
Overridable Property Item(index As Integer) As Azienda' cannot overload each
other because they differ only by return types.
I know to make it in C# but not in VB.NET
Can anyone help me?
Thanks in advance.