bool _isDocumentset = IsDocumentSet(_item);
public static bool IsDocumentSet(this SPListItem item)
{
bool documentSetItem = false;
DocumentSet documentSet = null;
if (null != item && item.IsFolder())
{
documentSet = DocumentSet.GetDocumentSet(item.Folder);
if (null != documentSet)
documentSetItem = true;
}
return documentSetItem;
}
3. If document set then get its files
if(isDocumentset)
{
SPFolder documentsetFolder = _item.Folder;
SPFile file = documentsetFolder.Files[0]; -> Get files
}
Ads by Google
No comments:
Post a Comment