2014年7月13日 星期日

[RESOLVED] List accept any type of lists


hello all ,


plz help me to create list can accept any type of lists


thx :)



Hi,


Do you want something such as List> or List> ? My understanding would be that you want a "List" with each item of this list being itself a "List"  of objects. Or perhaps just any data structure that would allow to enumerate
objects ?


Or do you mean just that you want a list in which you culd store any kind of item ?


 



i meant i want to create List when i assign List to it , Ok , and when i assign to it List No problem , that what i meant about accept any type of lists , thx :)



So it seems you are just looking for List. I believe first you wanted a list of list because of the "list that accepts (ie. can store) any type of lists" rather than "list that accepts (ie can store) any type of object".


Double check you don't have a base class for what you'll store. Do you really have to mix int and string and other objects types in the same list ?


Finally:

- if you do have some code that fails, it can be better to directly tell us about the problem you have

- similary sometimes it is better to tell about your overall goal (sometimes it can raise suggestion to use another and possibly better way to do what you are trying to do in a particular way or just to better understand your issue)


I'm starting to wonder if your issue could be about this stuff: http://msdn.microsoft.com/en-us/library/dd799517(v=vs.110).aspx You try to assing a list of a given type to a list
of another type if I understood.


 


 



thanks :)


沒有留言:

張貼留言