Sean,
PMFJI
| dim example as List(of String)(of String)
I would expect either:
Dim example As List(Of List(Of String))
List<List<Strin g>> example;
Which is a list of a list of strings.
or
Dim example As List(Of String, String)
List<String, String> example
Which is a two dimensional list, which currently doesn't exist.
| example.add("so mething")("some thing else")
What are you expecting? Are you thinking:
Dim example As New Dictionary(Of String, List(Of String))
Dictionary<Stri ng, List<String>> example;
Then:
example.Add("so mething", New List(Of String))
example("someth ing").Add("some thing else")
example.Add("so mething", new List<String>)
example["something"].Add("something else")
If you're looking for the second, I would consider creating a new Type that
encapsulated the logic, aka a generic NameValueCollec tion.
--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley -
http://www.tsbradley.net
"Sean" <Se**@discussio ns.microsoft.co m> wrote in message
news:6A******** *************** ***********@mic rosoft.com...
|I wish I could do the following
|
| dim example as List(of String)(of String)
|
| example.add("so mething")("some thing else")
|
|
|
| "Kevin Spencer" wrote:
|
| > public class CollectionColle ction: Collection<Coll ectionType>
| > {
| > }
| >
| > --
| > HTH,
| >
| > Kevin Spencer
| > Microsoft MVP
| > ..Net Developer
| >
| > Presuming that God is "only an idea" -
| > Ideas exist.
| > Therefore, God exists.
| >
| > "Sean" <Se**@discussio ns.microsoft.co m> wrote in message
| > news:C2******** *************** ***********@mic rosoft.com...
| > > Although I said "key" its true I really dont need a key.
| > >
| > > What I am looking for is a generic "collection s of collections" which
is a
| > > specific phrase I read somewhere and I cant seem to find it again!
| > >
| > > true about not needing keys. We have some of that in our code right
now.
| > > SortList<T> is being used to sort a list however the list is then
| > > populated
| > > in a datagrid! Well I thought the grids already had IList (or whatever
| > > interface) required for sorting.
| > >
| > > Never the less, in general I am looking for either a collection of
| > > collections or a generic multidimensiona l "List".
| > >
| > > Thanks for your help
| > >
| > > "Nicholas Paldino [.NET/C# MVP]" wrote:
| > >
| > >> Sean,
| > >>
| > >> Use a Dictionary<K, V> instance. Create a type that exposes the
| > >> value/value pair (through fields/properties) and use that as the
value
| > >> type.
| > >>
| > >> Then, for the key, just use your key.
| > >>
| > >> Are you sure that you need to use an index? What are you using
it
| > >> for?
| > >> I've found that when people use a dictionary, they have little need
for
| > >> an
| > >> index, and can get around it using another dictionary (mapping index
to
| > >> key), or through the Keys collection exposed by the dictionary.
| > >>
| > >> Hope this helps.
| > >>
| > >>
| > >> --
| > >> - Nicholas Paldino [.NET/C# MVP]
| > >> -
mv*@spam.guard. caspershouse.co m
| > >>
| > >> "Sean" <Se**@discussio ns.microsoft.co m> wrote in message
| > >> news:91******** *************** ***********@mic rosoft.com...
| > >> >I need a generic collection that will do the following
| > >> >
| > >> > key/value/value
| > >> >
| > >> > or
| > >> >
| > >> > index/value/value
| > >> >
| > >> > basically I need a multidimensiona l generic Collection if that is
even
| > >> > possible!
| > >> >
| > >> > Thanks!
| > >>
| > >>
| > >>
| >
| >
| >