Skip to content

Commit 8093be6

Browse files
ClémentClément
authored andcommitted
CLists as ICollections.
1 parent fc6a898 commit 8093be6

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
tags:
3+
- datatypes/collections
4+
---
5+
6+
# List as ICollection
7+
8+
Another way of implementing lists is to make our class realize the [ICollection abstract class](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.icollection-1?view=net-9.0):
9+
10+
11+
!include diag/cla/ICollection.md
12+
13+
This requires implementing a series of properties and methods:
14+
15+
16+
```{download="./code/projects/CList_Icollection.zip"}
17+
!include`snippetStart="/* Done with Cell.*/", snippetEnd="/* We are done realizing the ICollection class. */` code/projects/CList_Icollection/CList_Icollection.cs
18+
```
19+
20+

0 commit comments

Comments
 (0)