示例#1
0
 /// <inheritdoc/>
 public async Task <bool> ShowFileAsync(IStorageFile file)
 {
     if (file.HasPath)
     {
         return(await Launcher.LaunchUriAsync(new Uri(file.GetPath())));
     }
     else
     {
         return(false);
     }
 }
示例#2
0
 /// <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()
            };
        }
示例#4
0
        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()
            });
        }
示例#5
0
        /// <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);
                }
            }
        }