Продолжаем исследовать исходный код некоторых компонент SharePoint. В этот раз посмотрим различия между свойством SPList.Items и методом SPList.GetItems()
// Microsoft.SharePoint.SPList public SPListItemCollection GetItems(params string[] fields) { if (fields == null) { throw new System.ArgumentNullException("fields"); } System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(); for (int i = 0; i < fields.Length; i++) { string text = fields[i]; if (text != null) { stringBuilder.Append(""); } } return this.GetItems(new SPQuery { ViewAttributes = "Scope=\"Recursive\"", ViewFields = stringBuilder.ToString() }); }
// Microsoft.SharePoint.SPList ///Returns a collection of items from the list based on the specified query. ///An /// Anobject that represents the items. object that contains the query. [ClientCallable] public SPListItemCollection GetItems([ClientCallableConstraint(Type = ClientCallableConstraintType.NotNull)] SPQuery query) { return new SPListItemCollection(this, query); }
// Microsoft.SharePoint.SPList ///Gets the number of items in the list. ///A 32-bit integer that indicates the number of items. [ClientCallable, ClientCallableConstraint(Type = ClientCallableConstraintType.Custom, FixedId = "a", Value = "It MUST be a greater than or equal to zero.")] public int ItemCount { get { this.EnsurePropsFresh(); return (int)this.m_arrListProps[(int)((System.UIntPtr)20), (int)((System.UIntPtr)this.m_iRow)]; } }
0 коммент.:
Отправить комментарий