} // end of public void GetAllImagesFromCamera() private void DisplayObject(PortableDevice device, PortableDeviceObject portableDeviceObject) { if (portableDeviceObject is PortableDeviceFolder) { DisplayFolderContents(device, (PortableDeviceFolder)portableDeviceObject); } }
private int GetCountOfImageRec(PortableDevice device, PortableDeviceObject portableDeviceObject) { int count = 0; foreach (var item in ((PortableDeviceFolder)portableDeviceObject).Files) { if (item is PortableDeviceFolder) { count = count + GetCountOfImageRec(device, (PortableDeviceFolder)item); } if (item is PortableDeviceFile) { count++; } } return(count); }