Eventuali duplicati:
count vs length vs size in a collectionPerché la matrice C# non ha una proprietà Count?
davvero strano:
C# array come il seguente
double[] test = new double[1];
supporta la proprietà lunghezza per ottenere la dimensione del array. Ma gli array implementano anche un'interfaccia IList:
IList<double> list = test;
Tuttavia, l'interfaccia IList fornisce anche una proprietà Count. Come mai l'array ("test" in questo caso) no?
Edit: Grazie a tutti voi che ha sottolineato che in realtà è l'interfaccia ICollection (non IList), che fornisce la proprietà Count, e anche che questo è dovuto alla esplicita implementazione dell'interfaccia.
... vs ** ** Capacità vs ** ** ItemCount (come 'ColumnCount' in' 'ListView' vs Columns.Count') vs ** ** NumItems (' NumIndices' in 'EnvDTE ') vs ** CountOfItems ** (' CountOfLines' in 'EnvDTE') vs etc ... Ho solo * amato * la coerenza nei framework di MS. :) – Mehrdad