Skip to content

Commit

Permalink
Windows 10 RTM Release - November 2015 Update 1
Browse files Browse the repository at this point in the history
  • Loading branch information
oldnewthing committed Nov 19, 2015
1 parent 2b58558 commit 2d38b5d
Show file tree
Hide file tree
Showing 308 changed files with 3,123 additions and 959 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,12 @@ For additional Windows samples, see [Windows on GitHub](http://microsoft.github.
<td><a href="Samples/Logging">Logging</a></td>
</tr>
<tr>
<td><a href="Samples/PdfDocument">PDF document</a></td>
<td><a href="Samples/DataReaderWriter">Serializing and deserializing data</a></td>
<td><a href="Samples/XamlBind">x:Bind</a></td>
<td><a href="Samples/XamlDeferLoadStrategy">x:DeferLoadStrategy</a></td>
</tr>
<tr>
<td><a href="Samples/XamlDeferLoadStrategy">x:DeferLoadStrategy</a></td>
<td><a href="Samples/XmlDocument">XML DOM</a></td>
<td><a href="Samples/XmlLite">XmlLite</a></td>
</tr>
Expand Down Expand Up @@ -387,19 +388,20 @@ For additional Windows samples, see [Windows on GitHub](http://microsoft.github.
<tr>
<td><a href="Samples/PasswordVault">Credential locker</a></td>
<td><a href="Samples/CredentialPicker">Credential picker</a></td>
<td><a href="Samples/DisablingScreenCapture">Disabling screen capture</a></td>
<td><a href="Samples/DeviceLockdownAzureLogin">Device lockdown with Azure login</a></td>
</tr>
<tr>
<td><a href="Samples/DisablingScreenCapture">Disabling screen capture</a></td>
<td><a href="Samples/EnterpriseDataProtection">Enterprise data protection</a></td>
<td><a href="Samples/KeyCredentialManager">KeyCredentialManager</a></td>
<td><a href="Samples/Personalization">Lock screen personalization</a></td>
</tr>
<tr>
<td><a href="Samples/Personalization">Lock screen personalization</a></td>
<td><a href="Samples/SmartCard">Smart cards</a></td>
<td><a href="Samples/UserInfo">User information</a></td>
<td><a href="Samples/UserConsentVerifier">UserConsentVerifier</a></td>
</tr>
<tr>
<td><a href="Samples/UserConsentVerifier">UserConsentVerifier</a></td>
<td><a href="Samples/WebAccountManagement">Web account management</a></td>
<td><a href="Samples/WebAuthenticationBroker">WebAuthenticationBroker</a></td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion Samples/Accelerometer/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!---
category: DevicesSensorsAndPower
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620477&clcid=0x409
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620477
--->

# Accelerometer sample
Expand Down
2 changes: 1 addition & 1 deletion Samples/ActivitySensor/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!---
category: DevicesSensorsAndPower
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620478&clcid=0x409
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620478
--->

# Activity detection sensor sample
Expand Down
2 changes: 1 addition & 1 deletion Samples/AdaptiveStreaming/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!---
category: AudioVideoAndCamera
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620479&clcid=0x409
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620479
--->

# Adaptive streaming sample
Expand Down
2 changes: 1 addition & 1 deletion Samples/AdvancedCasting/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!---
category: AudioVideoAndCamera
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620480&clcid=0x409
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620480
--->

# Advanced casting sample
Expand Down
2 changes: 1 addition & 1 deletion Samples/AllJoyn/ConsumerExperiences/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!---
category: DevicesSensorsAndPower
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=534021&clcid=0x409
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=534021
--->

# AllJoyn consumer experiences sample
Expand Down
2 changes: 1 addition & 1 deletion Samples/AllJoyn/ProducerExperiences/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!---
category: DevicesSensorsAndPower
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=534025&clcid=0x409
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=534025
--->

# AllJoyn producer experiences sample
Expand Down
2 changes: 1 addition & 1 deletion Samples/Altimeter/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!---
category: DevicesSensorsAndPower
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620481&clcid=0x409
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620481
--->

# Altimeter sample
Expand Down
2 changes: 1 addition & 1 deletion Samples/AnimationLibrary/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!---
category: GraphicsAndAnimation
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620483&clcid=0x409
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620483
--->

# Animation library (HTML) sample
Expand Down
1 change: 0 additions & 1 deletion Samples/AnimationLibrary/js/html/samplePage.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ <h2 class="win-type-subheader">Sample Page Header</h2>
ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent
luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Typi non habent claritatem insitam; est
usus legentis in iis qui facit eorum claritatem.</p>
<button class="win-button" id="returnButton">Click to return</button>
</div>
</div>
</div>
Expand Down
13 changes: 7 additions & 6 deletions Samples/AnimationLibrary/js/js/samplePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@
(function () {
"use strict";

var systemNavigationManager = Windows.UI.Core.SystemNavigationManager.getForCurrentView();

WinJS.UI.Pages.define("/html/samplePage.html", {
ready: function (element, options) {
returnButton.addEventListener("click", transitionBetweenPages, false);
// rootGrid.style.overflow= "auto";
// content.style.overflow = "visible";
systemNavigationManager.addEventListener("backrequested", backRequested);
systemNavigationManager.appViewBackButtonVisibility = Windows.UI.Core.AppViewBackButtonVisibility.visible;

// Run enter page animation to animate in the page that has just been loaded
WinJS.UI.Animation.enterPage([samplePageHeader, samplePageSection1, samplePageSection2], null);
},
unload: function () {
// rootGrid.style.overflow = "visible";
// content.style.overflow = "auto";
systemNavigationManager.removeEventListener("backrequested", backRequested);
systemNavigationManager.appViewBackButtonVisibility = Windows.UI.Core.AppViewBackButtonVisibility.collapsed;
}
});

function transitionBetweenPages() {
function backRequested() {
// When navigating away from this page, run exit page animation on current page, then navigate to new page
WinJS.UI.Animation.exitPage([samplePageHeader, samplePageSection1, samplePageSection2], null).done(
function () {
Expand Down
2 changes: 1 addition & 1 deletion Samples/AnimationMetrics/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!---
category: GraphicsAndAnimation
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620484&clcid=0x409
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620484
--->

# Animation metrics sample
Expand Down
2 changes: 1 addition & 1 deletion Samples/AppServices/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!---
category: DeepLinksAndAppToAppCommunication
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620489&clcid=0x409
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620489
--->

# App services sample
Expand Down
2 changes: 1 addition & 1 deletion Samples/ApplicationData/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!---
category: AppSettings
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620486&clcid=0x409
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620486
--->

# Application data sample
Expand Down
2 changes: 1 addition & 1 deletion Samples/ApplicationResources/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!---
category: GlobalizationAndLocalization
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620487&clcid=0x409
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620487
--->

# Application resources and localization sample
Expand Down
2 changes: 1 addition & 1 deletion Samples/Appointments/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!---
category: ContactsAndCalendar
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620488&clcid=0x409
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620488
--->

# Appointment calendar sample
Expand Down
2 changes: 1 addition & 1 deletion Samples/AssociationLaunching/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!---
category: LaunchingAndBackgroundTasks
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620490&clcid=0x409
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620490
--->

# Association launching sample
Expand Down
2 changes: 1 addition & 1 deletion Samples/AudioCategory/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!---
category: AudioVideoAndCamera
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620491&clcid=0x409
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620491
--->

# Audio categories sample
Expand Down
2 changes: 1 addition & 1 deletion Samples/AudioCreation/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!---
category: AudioVideoAndCamera
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=619481&clcid=0x409
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=619481
--->

# AudioGraph sample
Expand Down
2 changes: 1 addition & 1 deletion Samples/BackButton/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!---
category: Navigation
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=624048&clcid=0x409
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=624048
--->

# Back Button Sample
Expand Down
2 changes: 1 addition & 1 deletion Samples/BackgroundAudio/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!---
category: AudioVideoAndCamera
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=619997&clcid=0x409
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=619997
--->

# Background audio sample
Expand Down
57 changes: 37 additions & 20 deletions Samples/BackgroundAudio/cs/BackgroundAudio/Scenario1.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public sealed partial class Scenario1 : Page
#region Private Fields and Properties
private MainPage rootPage;
private AutoResetEvent backgroundAudioTaskStarted;
private bool isMyBackgroundTaskRunning = false;
private bool _isMyBackgroundTaskRunning = false;
private Dictionary<string, BitmapImage> albumArtCache = new Dictionary<string, BitmapImage>();
const int RPC_S_SERVER_UNAVAILABLE = -2147023174; // 0x800706BA

Expand All @@ -52,7 +52,7 @@ private bool IsMyBackgroundTaskRunning
{
get
{
if (isMyBackgroundTaskRunning)
if (_isMyBackgroundTaskRunning)
return true;

string value = ApplicationSettingsHelper.ReadResetSettingsValue(ApplicationSettingsConstants.BackgroundTaskState) as string;
Expand All @@ -64,13 +64,13 @@ private bool IsMyBackgroundTaskRunning
{
try
{
isMyBackgroundTaskRunning = EnumHelper.Parse<BackgroundTaskState>(value) == BackgroundTaskState.Running;
_isMyBackgroundTaskRunning = EnumHelper.Parse<BackgroundTaskState>(value) == BackgroundTaskState.Running;
}
catch(ArgumentException)
{
isMyBackgroundTaskRunning = false;
_isMyBackgroundTaskRunning = false;
}
return isMyBackgroundTaskRunning;
return _isMyBackgroundTaskRunning;
}
}
}
Expand All @@ -87,20 +87,28 @@ private MediaPlayer CurrentPlayer
get
{
MediaPlayer mp = null;
int retryCount = 2;

try
while (mp == null && --retryCount >= 0)
{
mp = BackgroundMediaPlayer.Current;
}
catch (Exception ex)
{
if (ex.HResult == RPC_S_SERVER_UNAVAILABLE)
try
{
// The foreground app uses RPC to communicate with the background process.
// If the background process crashes or is killed for any reason RPC_S_SERVER_UNAVAILABLE
// is returned when calling Current.
ResetAfterLostBackground();
StartBackgroundAudioTask();
mp = BackgroundMediaPlayer.Current;
}
catch (Exception ex)
{
if (ex.HResult == RPC_S_SERVER_UNAVAILABLE)
{
// The foreground app uses RPC to communicate with the background process.
// If the background process crashes or is killed for any reason RPC_S_SERVER_UNAVAILABLE
// is returned when calling Current. We must restart the task, the while loop will retry to set mp.
ResetAfterLostBackground();
StartBackgroundAudioTask();
}
else
{
throw;
}
}
}

Expand All @@ -114,12 +122,13 @@ private MediaPlayer CurrentPlayer
}

/// <summary>
/// The background task did exist, but it has disappeared. Put the foreground back into an initial state.
/// The background task did exist, but it has disappeared. Put the foreground back into an initial state. Unfortunately,
/// any attempts to unregister things on BackgroundMediaPlayer.Current will fail with the RPC error once the background task has been lost.
/// </summary>
private void ResetAfterLostBackground()
{
BackgroundMediaPlayer.Shutdown();
isMyBackgroundTaskRunning = false;
_isMyBackgroundTaskRunning = false;
backgroundAudioTaskStarted.Reset();
prevButton.IsEnabled = true;
nextButton.IsEnabled = true;
Expand All @@ -136,6 +145,10 @@ private void ResetAfterLostBackground()
{
throw new Exception("Failed to get a MediaPlayer instance.");
}
else
{
throw;
}
}
}

Expand Down Expand Up @@ -220,7 +233,7 @@ protected override void OnNavigatedTo(NavigationEventArgs e)

protected override void OnNavigatedFrom(NavigationEventArgs e)
{
if(isMyBackgroundTaskRunning)
if(_isMyBackgroundTaskRunning)
{
RemoveMediaPlayerEventHandlers();
ApplicationSettingsHelper.SaveSettingsValue(ApplicationSettingsConstants.BackgroundTaskState, BackgroundTaskState.Running.ToString());
Expand Down Expand Up @@ -500,9 +513,9 @@ private void UpdateTransportControls(MediaPlayerState state)
/// </summary>
private void RemoveMediaPlayerEventHandlers()
{
CurrentPlayer.CurrentStateChanged -= this.MediaPlayer_CurrentStateChanged;
try
{
BackgroundMediaPlayer.Current.CurrentStateChanged -= this.MediaPlayer_CurrentStateChanged;
BackgroundMediaPlayer.MessageReceivedFromBackground -= BackgroundMediaPlayer_MessageReceivedFromBackground;
}
catch (Exception ex)
Expand Down Expand Up @@ -536,6 +549,10 @@ private void AddMediaPlayerEventHandlers()
// Internally MessageReceivedFromBackground calls Current which can throw RPC_S_SERVER_UNAVAILABLE
ResetAfterLostBackground();
}
else
{
throw;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion Samples/BackgroundSensors/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!---
category: DevicesSensorsAndPower
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620509&clcid=0x409
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620509
--->

# Background sensors sample
Expand Down
2 changes: 1 addition & 1 deletion Samples/BackgroundTask/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!---
category: LaunchingAndBackgroundTasks
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=618666&clcid=0x409
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=618666
--->

# Background task sample
Expand Down
2 changes: 1 addition & 1 deletion Samples/BackgroundTransfer/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!---
category: NetworkingAndWebServices
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620510&clcid=0x409
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620510
--->

# Background transfer sample
Expand Down
2 changes: 1 addition & 1 deletion Samples/BarcodeScanner/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!---
category: DevicesSensorsAndPower
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620014&clcid=0x409
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620014
--->

# Barcode scanner sample
Expand Down
2 changes: 1 addition & 1 deletion Samples/Barometer/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!---
category: DevicesSensorsAndPower
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620511&clcid=0x409
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620511
--->

# Barometer sample
Expand Down
Loading

0 comments on commit 2d38b5d

Please sign in to comment.