/// <summary> /// MTP device have named root objects /// </summary> /// <returns>all the root objects that support storage</returns> public IEnumerable <IDeviceObject> GetDeviceRootStorageObjects() { IList <IDeviceObject> returnValue = new List <IDeviceObject>(10); var parentId = PortableDeviceConstants.WPD_DEVICE_OBJECT_ID; var childObjectIds = _portableDeviceHelper.GetChildObjectIds(_portableDeviceContent, parentId); foreach (var id in childObjectIds) { if (IsStorageObject(id)) { var childObjectName = _portableDeviceHelper.GetObjectFileName(_portableDeviceContent, id); returnValue.Add(new DeviceObject(_portableDeviceHelper, _portableDeviceContent, id, childObjectName)); } } return(returnValue); }
private IEnumerable <string> GetFilteredChildObjectIds(Predicate <string> match) { return(_portableDeviceHelper.GetChildObjectIds(_portableDeviceContent, Id).Where(id => match(id))); }