Vb.net 自定义字典对象?
我想扩展VB.NET dictionary对象,使其不必抱怨某个项已经在关联数组中 这就是我想做的:Vb.net 自定义字典对象?,vb.net,inheritance,dictionary,Vb.net,Inheritance,Dictionary,我想扩展VB.NET dictionary对象,使其不必抱怨某个项已经在关联数组中 这就是我想做的: Public Class BetterDictionary Inherits System.Collections.Generic.Dictionary(Of Object, Object) Public Sub Store(ByRef key As Object, ByVal value As Object) If Me.ContainsKey(key
Public Class BetterDictionary
Inherits System.Collections.Generic.Dictionary(Of Object, Object)
Public Sub Store(ByRef key As Object, ByVal value As Object)
If Me.ContainsKey(key) Then
Me(key) = value
Else
Me.Add(key, value)
End If
End Sub
End Class
我现在的问题是:如何替换(of object,object)行以使字典为泛型/可自定义类型?将继承的类定义为:
Public Class BetterDictionary(Of TKey,TValue)
Inherits System.Collections.Generic.Dictionary(Of TKey, TValue)