/// <inheritdoc/> public async Task <bool> ShowFileAsync(IStorageFile file) { if (file.HasPath) { return(await Launcher.LaunchUriAsync(new Uri(file.GetPath()))); } else { return(false); } }
/// <inheritdoc/> public async Task <bool> ShowFileAsync(IStorageFile file) { if (file.HasPath) { string folderPath = Path.GetDirectoryName(file.GetPath()); Process.Start("explorer.exe", folderPath); return(true); } else { return(false); } }
private static FileData GetFileData(IStorageFile file) { if (file == null) return null; var lastUpdate = file.GetLastUpdated(); return new FileData { Name = file.GetName(), VirtualPath = "/" + file.GetPath(), Created = lastUpdate, Updated = lastUpdate, Length = file.GetSize() }; }
private static FileData GetFileData(IStorageFile file) { if (file == null) { return(null); } var lastUpdate = file.GetLastUpdated(); return(new FileData { Name = file.GetName(), VirtualPath = "/" + file.GetPath(), Created = lastUpdate, Updated = lastUpdate, Length = file.GetSize() }); }
/// <inheritdoc/> public async Task <bool> OpenFileAsync(IStorageFile file) { if (file.HasPath) { Process.Start(file.GetPath()); return(true); } else { var newFile = await file.CopyToAsync(StorageService.TempFolder); if (newFile.HasPath) { Process.Start(newFile.GetPath()); return(true); } else { return(false); } } }