This repository has been archived by the owner on Aug 17, 2020. It is now read-only.
forked from snaverm/Pokemon-Go-Rocket-API
-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
22,440 additions
and
10,856 deletions.
There are no files selected for viewing
Binary file not shown.
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
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,49 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Windows.UI.Popups; | ||
using Windows.UI.Xaml; | ||
|
||
namespace PokemonGo_UWP.Utils | ||
{ | ||
/// <summary> | ||
/// MessageDialog extension methods | ||
/// </summary> | ||
public static class MessageDialogExtensions | ||
{ | ||
|
||
private static TaskCompletionSource<MessageDialog> _currentDialogShowRequest; | ||
|
||
/// <summary> | ||
/// Begins an asynchronous operation showing a dialog. | ||
/// If another dialog is already shown using | ||
/// ShowAsyncQueueQueue or ShowAsyncQueueIfPossible method - it will wait | ||
/// for that previous dialog to be dismissed before showing the new one. | ||
/// </summary> | ||
/// <param name="dialog">The dialog.</param> | ||
/// <returns></returns> | ||
/// <seealso cref="WinRTXamlToolkit.Controls.Extensions"/> | ||
/// <exception cref="System.InvalidOperationException">This method can only be invoked from UI thread.</exception> | ||
public static async Task<IUICommand> ShowAsyncQueue(this MessageDialog dialog) | ||
{ | ||
if (!Window.Current.Dispatcher.HasThreadAccess) | ||
{ | ||
throw new InvalidOperationException("This method can only be invoked from UI thread."); | ||
} | ||
|
||
while (_currentDialogShowRequest != null) | ||
{ | ||
await _currentDialogShowRequest.Task; | ||
} | ||
|
||
var request = _currentDialogShowRequest = new TaskCompletionSource<MessageDialog>(); | ||
var result = await dialog.ShowAsync(); | ||
_currentDialogShowRequest = null; | ||
request.SetResult(dialog); | ||
|
||
return result; | ||
} | ||
} | ||
} |
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,38 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Windows.ApplicationModel; | ||
using Octokit; | ||
|
||
namespace PokemonGo_UWP.Utils | ||
{ | ||
/// <summary> | ||
/// Manager that checks if there's an updated version on GitHub | ||
/// </summary> | ||
public static class UpdateManager | ||
{ | ||
/// <summary> | ||
/// Client to access GitHub | ||
/// </summary> | ||
private static readonly GitHubClient GitHubClient = new GitHubClient(new ProductHeaderValue("PoGo-UWP")); | ||
|
||
/// <summary> | ||
/// Checks if we have an updated version and returns the URI | ||
/// </summary> | ||
/// <returns></returns> | ||
public static async Task<string> IsUpdateAvailable() | ||
{ | ||
var releases = await GitHubClient.Repository.Release.GetAll("ST-Apps", "PoGo-UWP"); | ||
var latestRelease = releases[0]; | ||
// We skip prereleases, only stable ones | ||
if (latestRelease.Prerelease) return null; | ||
// Check if version number matches | ||
var currentVersion = Package.Current.Id.Version; | ||
var version = $"{currentVersion.Major}.{currentVersion.Minor}.{currentVersion.Build}"; | ||
var tagVersion = latestRelease.TagName.Replace("v", ""); | ||
return !version.Equals(tagVersion) ? latestRelease.HtmlUrl : null; | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,20 +1,21 @@ | ||
{ | ||
"dependencies": { | ||
"HockeySDK.UWP": "4.1.3", | ||
"Microsoft.NETCore.UniversalWindowsPlatform": "5.1.0", | ||
"Newtonsoft.Json": "9.0.1", | ||
"Template10": "1.1.12-preview-160712", | ||
"WinRTXamlToolkit.Controls.Gauge.UWP": "2.0.0" | ||
}, | ||
"frameworks": { | ||
"uap10.0": {} | ||
}, | ||
"runtimes": { | ||
"win10-arm": {}, | ||
"win10-arm-aot": {}, | ||
"win10-x86": {}, | ||
"win10-x86-aot": {}, | ||
"win10-x64": {}, | ||
"win10-x64-aot": {} | ||
} | ||
"dependencies": { | ||
"HockeySDK.UWP": "4.1.3", | ||
"Microsoft.NETCore.UniversalWindowsPlatform": "5.1.0", | ||
"Newtonsoft.Json": "9.0.1", | ||
"Octokit": "0.21.1", | ||
"Template10": "1.1.12-preview-160712", | ||
"WinRTXamlToolkit.Controls.Gauge.UWP": "2.0.0" | ||
}, | ||
"frameworks": { | ||
"uap10.0": {} | ||
}, | ||
"runtimes": { | ||
"win10-arm": {}, | ||
"win10-arm-aot": {}, | ||
"win10-x86": {}, | ||
"win10-x86-aot": {}, | ||
"win10-x64": {}, | ||
"win10-x64-aot": {} | ||
} | ||
} |
Oops, something went wrong.