Skip to content

Commit 9ed1dcd

Browse files
authored
Merge pull request #34 from ArtjomP/fix-uwp-devel
update constructor
2 parents 9e91448 + 6e91fdc commit 9ed1dcd

2 files changed

Lines changed: 16 additions & 6 deletions

File tree

src/PCLExt.FileStorage.UWP/StorageFolderImplementation.cs

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
using PCLExt.FileStorage.Exceptions;
1212
using PCLExt.FileStorage.UWP.Extensions;
13+
using PCLExt.FileStorage.Extensions;
1314

1415
namespace PCLExt.FileStorage.UWP
1516
{
@@ -25,8 +26,11 @@ public bool Exists
2526
{
2627
try
2728
{
28-
var storageFolder = StorageFolder.GetFolderFromPathAsync(
29-
_storageFolder.Path).AsTask().GetAwaiter().GetResult();
29+
var storageFolder = StorageFolder
30+
.GetFolderFromPathAsync(_storageFolder.Path)
31+
.AsTask()
32+
.GetAwaiter()
33+
.GetResult();
3034
}
3135
catch (System.IO.FileNotFoundException)
3236
{
@@ -62,16 +66,21 @@ public StorageFolderImplementation(StorageFolder storageFolder)
6266
}
6367

6468
public StorageFolderImplementation(string path)
65-
{
69+
{
6670
_storageFolder = StorageFolder
6771
.GetFolderFromPathAsync(path)
68-
.GetResults();
72+
.AsTask()
73+
.GetAwaiter()
74+
.GetResult();
6975
}
7076

7177
private BasicProperties GetStorageFolderProperties()
7278
{
73-
return _storageFolder.GetBasicPropertiesAsync().
74-
AsTask().GetAwaiter().GetResult();
79+
return _storageFolder
80+
.GetBasicPropertiesAsync()
81+
.AsTask()
82+
.GetAwaiter()
83+
.GetResult();
7584
}
7685

7786
public ExistenceCheckResult CheckExists(string name)

src/PCLExt.FileStorage/Folders/FolderFromPath.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public FolderFromPath(params string[] paths) : base(GetFolderFromPath(System.IO.
1515
/// Creates a new <see cref="BaseFolder"/> corresponding to the specified path.
1616
/// </summary>
1717
/// <param name="path">The file path</param>
18+
/// <param name="createIfNotExisting">Create folder automatically</param>
1819
public FolderFromPath(string path, bool createIfNotExisting = false) : base(GetFolderFromPath(path, createIfNotExisting)) { }
1920
private static IFolder GetFolderFromPath(string path, bool createIfNotExisting = false)
2021
{

0 commit comments

Comments
 (0)