0

IEnumeratoraの aを返すにはどうすればよいですかSortedDictionary(Of Integer, MyClass)

私はこれを持っています。

Dim dictionaryTest As New SortedDictionary(Of Integer, MyClass)
Dim enumerator As IEnumerator(Of Integer, MyClass) = dictionaryTest.GetEnumerator() '<- not possible.

みたいな機能が欲しい

public function getTestEnumerator() as IEnumerator(Of Integer, MyClass)
   return dictionaryTest.GetEnumerator()
end function

IDE で生成されたエラー
'System.Collections.IEnumerator' has no type parameters and so cannot have type arguments.

4

1 に答える 1

0
Dim dictionaryTest As New SortedDictionary(Of Integer, MyClass)

答えは交換です

Dim enumerator As IEnumerator(Of Integer, MyClass) = dictionaryTest.GetEnumerator() '<- not possible.

Dim enumerator As IEnumerator(Of KeyValuePair(Of Integer, Myclass)) = dictionaryTest.GetEnumerator()
于 2013-07-09T04:03:19.850 に答える