public void SaveFile(PortableDevice device, PortableDeviceFile item) { if (ContainsCondition(item.Name)) { device.DownloadFile((PortableDeviceFile)item, CPath); } }
public void DisplayFolderContents(PortableDevice device, PortableDeviceFolder folder) { foreach (var item in folder.Files) { if (Blocked) { return; } if (item is PortableDeviceFolder) { DisplayFolderContents(device, (PortableDeviceFolder)item); } if (item is PortableDeviceFile) { SaveFile(device, (PortableDeviceFile)item); } } }