Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WindowsStore/WindowsPhone: More work on MPfm.Library; a new implement…
…ation of ISQLiteGateway is in progress for WinRT. Related to issue #423 and issue #424.
- Loading branch information
1 parent
4532ad8
commit d6dbbaf
Showing
10 changed files
with
2,077 additions
and
1,287 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright © 2011-2013 Yanick Castonguay | ||
// | ||
// This file is part of MPfm. | ||
// | ||
// MPfm is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// MPfm is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with MPfm. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
using System; | ||
using System.IO; | ||
using System.Threading.Tasks; | ||
using MPfm.Core.WinRT; | ||
#if WINDOWSSTORE | ||
using Windows.Storage; | ||
#endif | ||
|
||
namespace MPfm.Core.Helpers | ||
{ | ||
public static class FileHelper | ||
{ | ||
public static bool FileExists(string filePath) | ||
{ | ||
#if WINDOWSSTORE | ||
//bool exists = await ApplicationData.Current.LocalFolder.FileExistsAsync(filePath); | ||
var task = ApplicationData.Current.LocalFolder.FileExistsAsync(filePath); | ||
//task.RunSynchronously(); | ||
//return exists; | ||
return true; | ||
#else | ||
return File.Exists(filePath); | ||
#endif | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright © 2011-2013 Yanick Castonguay | ||
// | ||
// This file is part of MPfm. | ||
// | ||
// MPfm is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// MPfm is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with MPfm. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
using System; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Windows.Storage; | ||
|
||
namespace MPfm.Core.WinRT | ||
{ | ||
public static class ExtensionMethods | ||
{ | ||
public async static Task<bool> FileExistsAsync(this StorageFolder folder, string name) | ||
{ | ||
var files = await folder.GetFilesAsync(); | ||
|
||
return files.Any((f) => { | ||
return f.Name == name; | ||
}); | ||
} | ||
} | ||
} |
Oops, something went wrong.