IList or ICollection

IList or ICollection

Anonymous
Not applicable
3,934 Views
3 Replies
Message 1 of 4

IList or ICollection

Anonymous
Not applicable

Hi Every Buddy:

 

I m a new here. When I learn Filtering section of Revit API Guide I found that sometimes IList was used such as:

IList<Element> walls = collector.WherePasses(filter).OfClass(typeof(Wall)).ToElements(); and sometimes ICollection was used such as: ICollection<Element> allLoads = collector.WherePasses(filter).ToElements(); to do the filtering. My question is when we should use which and what is the diffrence between them.

Thx for any help.

0 Likes
Accepted solutions (1)
3,935 Views
3 Replies
Replies (3)
Message 2 of 4

ollikat
Collaborator
Collaborator
Accepted solution

Hi

 

Your question is more related to .NET than Revit API. You can find documentation of those interfaces from MSDN. Furthermore you can find discussion about the subject from here:

 

http://stackoverflow.com/questions/9855693/ilist-vs-icollection-vs-collection

 

 

...and probably plenty of more using google.

Message 3 of 4

Anonymous
Not applicable

Thx Olikat. 

Message 4 of 4

Joe.Ye
Alumni
Alumni

 

ollikat answered the difference of ICollection and IList.

 

Here is the answer of this question

>>>My question is when we should use which?

 

In the RevitAPI.chm file, all methods or properties signature are listed. It displays the  collection type to that is used to  store the returned values.

 

Regards,



Joe Ye
Contractor
Developer Technical Services
Autodesk Developer Network
0 Likes