This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!
ICollection
ICollection will expose the following functionality:
- Synchronization. We need to expose synchronization functionality in a first class way. The List and Hashtable classes will provide some synchronization wrappers for people who do not want to implement synchronization themselves. It is not our desire to hide synchronization. Instead, we want the use of synchronization to be a choice developers make explicitly.
- Interop between Arrays. System.Array will be a collection and collections should transform into basic arrays.
- We understand that Count may be expensive to implement on some database driven collections. Since this is not the common case, and Count is a useful thing in most cases, we choose to leave count in place. We recommend throwing a NotSupportedException if Count is prohibitively expensive to compute.
- CopyTo: The array must be a single dimension array, but may have any low-bound. The index must be in the range of array.LowBound to Array.LowBound+Array.Length.
public interface ICollection : IEnumerable {
void CopyTo(Array array, int index);
property int Count;
property Object SyncRoot;
property boolean IsSynchronized;
property boolean IsReadOnly;
}