Skip to content

Commit

Permalink
Merge pull request #1741 from Microsoft/dev
Browse files Browse the repository at this point in the history
Sync latest changes from dev to master
  • Loading branch information
sibille authored Jan 25, 2018
2 parents 297842a + 043ee49 commit f06581e
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 55 deletions.
6 changes: 3 additions & 3 deletions _build/Extension-SetIdentityAndVersion.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ if($buildNumber -match $VersionRegEx){

$revision = [int]::Parse($matches[4]).ToString()

if($buildNumber.ToLower().StartsWith("dev")){
$revision = (65000 + [int]::Parse($matches[4])).ToString();
}
#if($buildNumber.ToLower().StartsWith("dev")){
# $revision = (65000 + [int]::Parse($matches[4])).ToString();
#}

$versionNumber = [int]::Parse($matches[1]).ToString() + "." + [int]::Parse($matches[2]).ToString() + "." + [int]::Parse($matches[3]).ToString() + "." + $revision
Write-Host "Version Number" $versionNumber
Expand Down
9 changes: 8 additions & 1 deletion code/src/Core/Locations/TemplatesContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,14 @@ public TemplatesContent(string workingFolder, string sourceId, Version wizardVer

public bool Exists()
{
return Current != null;
if (Current != null)
{
return Directory.Exists(Current.Path);
}
else
{
return false;
}
}

public bool RequiresContentUpdate()
Expand Down
4 changes: 2 additions & 2 deletions code/src/Core/Locations/TemplatesSynchronization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public async Task EnsureContentAsync(bool force = false)
{
try
{
if (!_content.Exists() || force)
if (!_content.Exists() || force || CurrentContent.Version < CurrentWizardVersion)
{
await ExtractInstalledContentAsync();
}
Expand Down Expand Up @@ -198,7 +198,7 @@ private async Task UpdateTemplatesCacheAsync(bool force)
{
try
{
if (force || _content.RequiresContentUpdate() || CodeGen.Instance.Cache.TemplateInfo.Count == 0)
if (force || _content.RequiresContentUpdate() || CodeGen.Instance.Cache.TemplateInfo.Count == 0 || CodeGen.Instance.GetCurrentContentSource(WorkingFolder, _content.Source.Id) != _content.LatestContentFolder)
{
SyncStatusChanged?.Invoke(this, new SyncStatusEventArgs { Status = SyncStatus.Updating });
await Task.Run(() =>
Expand Down
2 changes: 1 addition & 1 deletion code/src/UI/Controls/CodeViewer.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ private string GetLanguage(string filePath)
language = "csharp";
break;
case ".vb":
language = "vb.net";
language = "vb";
break;
case ".json":
language = "json";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ namespace Param_ItemNamespace.Services
{
public class FirstRunDisplayService : IFirstRunDisplayService
{
private static bool shown = false;

public async Task ShowIfAppropriateAsync()
{
if (SystemInformation.IsFirstRun)
if (SystemInformation.IsFirstRun && !shown)
{
shown = true;
var dialog = new FirstRunDialog();
await dialog.ShowAsync();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ namespace Param_ItemNamespace.Services
{
public static class FirstRunDisplayService
{
private static bool shown = false;

internal static async Task ShowIfAppropriateAsync()
{
if (SystemInformation.IsFirstRun)
if (SystemInformation.IsFirstRun && !shown)
{
shown = true;
var dialog = new FirstRunDialog();
await dialog.ShowAsync();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ Imports Microsoft.Toolkit.Uwp.Helpers

Namespace Services
Public NotInheritable Class FirstRunDisplayService
Shared shown As Boolean = False

Private Sub New()
End Sub

Friend Shared Async Function ShowIfAppropriateAsync() As Task
If SystemInformation.IsFirstRun Then
If SystemInformation.IsFirstRun AndAlso Not shown Then
shown = true
Dim dialog = New FirstRunDialog()
Await dialog.ShowAsync()
End If
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ namespace Param_ItemNamespace.Services
// For instructions on testing this service see https://github.com/Microsoft/WindowsTemplateStudio/tree/master/docs/features/whats-new-prompt.md
public class WhatsNewDisplayService : IWhatsNewDisplayService
{
private static bool shown = false;

public async Task ShowIfAppropriateAsync()
{
if (SystemInformation.IsAppUpdated)
if (SystemInformation.IsAppUpdated && !shown)
{
shown = true;
var dialog = new WhatsNewDialog();
await dialog.ShowAsync();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ namespace Param_ItemNamespace.Services
// For instructions on testing this service see https://github.com/Microsoft/WindowsTemplateStudio/tree/master/docs/features/whats-new-prompt.md
public static class WhatsNewDisplayService
{
private static bool shown = false;

internal static async Task ShowIfAppropriateAsync()
{
if (SystemInformation.IsAppUpdated)
if (SystemInformation.IsAppUpdated && !shown)
{
shown = true;
var dialog = new WhatsNewDialog();
await dialog.ShowAsync();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ Imports Microsoft.Toolkit.Uwp.Helpers
Namespace Services
' For instructions on testing this service see https://github.com/Microsoft/WindowsTemplateStudio/tree/master/docs/features/whats-new-prompt.md
Public Module WhatsNewDisplayService
Dim shown As Boolean = False

Friend Async Function ShowIfAppropriateAsync() As Task
If SystemInformation.IsAppUpdated Then
If SystemInformation.IsAppUpdated AndAlso Not shown Then
shown = True
Dim dialog = New WhatsNewDialog()
Await dialog.ShowAsync()
End If
Expand Down
28 changes: 0 additions & 28 deletions templates/Pages/Map.Prism/Services/LocationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,20 @@ public class LocationService : ILocationService
{
private Geolocator _geolocator;

/// <summary>
/// Raised when the current position is updated.
/// </summary>
public event EventHandler<Geoposition> PositionChanged;

/// <summary>
/// Gets the last known recorded position.
/// </summary>
public Geoposition CurrentPosition { get; private set; }

/// <summary>
/// Initializes the location service with a default accuracy (100 meters) and movement threshold.
/// </summary>
/// <returns>True if the initialization was successful and the service can be used.</returns>
public Task<bool> InitializeAsync()
{
return InitializeAsync(100);
}

/// <summary>
/// Initializes the location service with the specified accuracy and default movement threshold.
/// </summary>
/// <param name="desiredAccuracyInMeters">The desired accuracy at which the service provides location updates.</param>
/// <returns>True if the initialization was successful and the service can be used.</returns>
public Task<bool> InitializeAsync(uint desiredAccuracyInMeters)
{
return InitializeAsync(desiredAccuracyInMeters, (double)desiredAccuracyInMeters / 2);
}

/// <summary>
/// Initializes the location service with the specified accuracy and movement threshold.
/// </summary>
/// <param name="desiredAccuracyInMeters">The desired accuracy at which the service provides location updates.</param>
/// <param name="movementThreshold">The distance of movement, in meters, that is required for the service to raise the PositionChanged event.</param>
/// <returns>True if the initialization was successful and the service can be used.</returns>
public async Task<bool> InitializeAsync(uint desiredAccuracyInMeters, double movementThreshold)
{
// to find out more about getting location, go to https://docs.microsoft.com/en-us/windows/uwp/maps-and-location/get-location
Expand Down Expand Up @@ -77,10 +56,6 @@ public async Task<bool> InitializeAsync(uint desiredAccuracyInMeters, double mov
return result;
}

/// <summary>
/// Starts the service listening for location updates.
/// </summary>
/// <returns>An object that is used to manage the asynchronous operation.</returns>
public async Task StartListeningAsync()
{
if (_geolocator == null)
Expand All @@ -93,9 +68,6 @@ public async Task StartListeningAsync()
CurrentPosition = await _geolocator.GetGeopositionAsync();
}

/// <summary>
/// Stops the service listening for location updates.
/// </summary>
public void StopListening()
{
if (_geolocator == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ protected override Task OnLaunchApplicationAsync(LaunchActivatedEventArgs args)
return LaunchApplicationAsync(PageTokens.Param_HomeNamePage, null);
}

/// <summary>
/// Application-code (e.g. setting the theme and initial page navigation) to be executed
/// when the application is launched (e.g. through the Start menu) or activated (e.g. through URI scheme activation).
/// </summary>
/// <param name="page">The page to launch to.</param>
/// <param name="launchParam">An object parameter to be passed to the launch page.</param>
/// <returns>Task returned for async method</returns>
private async Task LaunchApplicationAsync(string page, object launchParam)
{
NavigationService.Navigate(page, launchParam);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ protected override Task OnLaunchApplicationAsync(LaunchActivatedEventArgs args)
return LaunchApplicationAsync(PageTokens.PivotPage, null);
}

/// <summary>
/// Application-code (e.g. setting the theme and initial page navigation) to be executed
/// when the application is launched (e.g. through the Start menu) or activated (e.g. through URI scheme activation).
/// </summary>
/// <param name="page">The page to launch to.</param>
/// <param name="launchParam">An object parameter to be passed to the launch page.</param>
/// <returns>Task returned for async method</returns>
private async Task LaunchApplicationAsync(string page, object launchParam)
{
NavigationService.Navigate(page, launchParam);
Expand Down

0 comments on commit f06581e

Please sign in to comment.