ICollection supported by Unity?

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Lapo, Bax

fernando24691
Posts: 30
Joined: 20 Oct 2010, 19:37

ICollection supported by Unity?

Postby fernando24691 » 07 Feb 2011, 21:41

Hello.

I've been trying to use ICollection<Users> to send object messages to custom users, but I cannot manage to create one.

I saw that ICollection belongs to .NET Framework 4, but Unity only has support up for .NET Framework 3.5.

Am I wrong? Is there any way to solve this?? :(

Thanks!
tchen
Posts: 191
Joined: 11 Dec 2010, 14:14

Postby tchen » 07 Feb 2011, 22:10

ICollection<T> is an interface and as such, doesn't support creation directly. You need to use an implementing class such as List<T> or Dictionary<K,V>

There's a whole bunch of them in the system.collections.generic namespace

http://msdn.microsoft.com/en-us/library ... 90%29.aspx


edited: added reference link
fernando24691
Posts: 30
Joined: 20 Oct 2010, 19:37

Postby fernando24691 » 07 Feb 2011, 22:28

Solved! Thank you very much! :D

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 26 guests