public ArrayInstance ToArray() { var result = this.Engine.Array.Construct(); foreach (var contentType in m_contentTypeCollection.OfType <SPContentType>()) { ArrayInstance.Push(result, new SPContentTypeInstance(this.Engine.Object.InstancePrototype, contentType)); } return(result); }
private SPContentType FindContentTypeByName(SPContentTypeCollection contentTypes, string contentTypeName) { return contentTypes.OfType<SPContentType>() .FirstOrDefault(ct => ct.Name.ToUpper() == contentTypeName.ToUpper()); }
private SPContentType FindContentTypeByName(SPContentTypeCollection contentTypes, string contentTypeName) { return(contentTypes.OfType <SPContentType>() .FirstOrDefault(ct => ct.Name.ToUpper() == contentTypeName.ToUpper())); }
public virtual SPContentType GetContentType(SPContentTypeCollection contentTypeCollection, SPContentTypeId contentTypeId, bool isCollectionFromList) { if (isCollectionFromList) { return contentTypeCollection.OfType<SPContentType>().FirstOrDefault<SPContentType>(c => c.Id == contentTypeId || c.Parent.Id == contentTypeId); } else { return contentTypeCollection[contentTypeId]; } }