P
pamela fluente
I have been posting this question with no success. I do not know if I
am not being clear of the question is too difficult
) or unclear.
It seems to me that the need to wrap a collection is quite common in
real world programs.
I am having problem to understand how I can wrap collections in
System.Collections.Generic.
For example I want to wrap a System.Collections.Generic.Dictionary. I
wish the wrapping class to have a constructor similar to that of the
dictionary (besides some possible other argument).
I think it should be actually simple, but I cannot see the right
syntax to implement this idea. Could anyone suggest how ?
Intuitively I want something "like" (please * excuse me * if I use the
VB notation, which I am familiar with, I will have no problem to
understand any C# solution to my question )
'------------------------------------
Class DictionaryWrapper
Public Whatever As WhateverObject
Public MyDict As System.Collections.Generic.Dictionary(Of
MyObjectType1, MyObjectType2)(MyComparer)
Sub New(ByVal MyObjectType1 as type?, ByVal MyObjectType2 as
type?, ByVal MyComparer as IComparer , ByVal WhateverObj as
WhateverObject )
Me.MyDict = New System.Collections.Generic.Dictionary(Of
MyObjectType1, MyObjectType2)(MyComparer)
Me.Whatever = WhateverObj
End Sub
End Class
'------------------------------------
Thanks
-Pam
am not being clear of the question is too difficult

It seems to me that the need to wrap a collection is quite common in
real world programs.
I am having problem to understand how I can wrap collections in
System.Collections.Generic.
For example I want to wrap a System.Collections.Generic.Dictionary. I
wish the wrapping class to have a constructor similar to that of the
dictionary (besides some possible other argument).
I think it should be actually simple, but I cannot see the right
syntax to implement this idea. Could anyone suggest how ?
Intuitively I want something "like" (please * excuse me * if I use the
VB notation, which I am familiar with, I will have no problem to
understand any C# solution to my question )
'------------------------------------
Class DictionaryWrapper
Public Whatever As WhateverObject
Public MyDict As System.Collections.Generic.Dictionary(Of
MyObjectType1, MyObjectType2)(MyComparer)
Sub New(ByVal MyObjectType1 as type?, ByVal MyObjectType2 as
type?, ByVal MyComparer as IComparer , ByVal WhateverObj as
WhateverObject )
Me.MyDict = New System.Collections.Generic.Dictionary(Of
MyObjectType1, MyObjectType2)(MyComparer)
Me.Whatever = WhateverObj
End Sub
End Class
'------------------------------------
Thanks
-Pam