Skip to content

Commit

Permalink
Windows 10 Version 1809 - February 2019 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
oldnewthing committed Feb 7, 2019
2 parents 978355c + dffebbf commit d0e9bc9
Show file tree
Hide file tree
Showing 41 changed files with 483 additions and 333 deletions.
2 changes: 2 additions & 0 deletions Samples/BackgroundTransfer/cpp/Tasks/CompletionGroupTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ BackgroundDownloader^ CompletionGroupTask::CreateBackgroundDownloader()

builder->SetTrigger(completionGroup->Trigger);

// The system automatically unregisters the BackgroundTransferCompletionGroup task when it triggers.
// You do not need to unregister it explicitly.
BackgroundTaskRegistration^ taskRegistration = builder->Register();

BackgroundDownloader^ downloader = ref new BackgroundDownloader(completionGroup);
Expand Down
2 changes: 2 additions & 0 deletions Samples/BackgroundTransfer/cs/Tasks/CompletionGroupTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ public static BackgroundDownloader CreateBackgroundDownloader()
builder.TaskEntryPoint = "Tasks.CompletionGroupTask";
builder.SetTrigger(completionGroup.Trigger);

// The system automatically unregisters the BackgroundTransferCompletionGroup task when it triggers.
// You do not need to unregister it explicitly.
BackgroundTaskRegistration taskRegistration = builder.Register();

BackgroundDownloader downloader = new BackgroundDownloader(completionGroup);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@
var builder = new Windows.ApplicationModel.Background.BackgroundTaskBuilder();
builder.taskEntryPoint = taskEntryPoint;
builder.setTrigger(completionGroup.trigger);

// The system automatically unregisters the BackgroundTransferCompletionGroup task when it triggers.
// You do not need to unregister it explicitly.
var taskRegistration = builder.register();

var downloader = new Windows.Networking.BackgroundTransfer.BackgroundDownloader(completionGroup);
Expand Down
4 changes: 4 additions & 0 deletions Samples/BackgroundTransfer/vb/Tasks/CompletionGroupTask.vb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ Namespace Global.Tasks
Dim builder As BackgroundTaskBuilder = New BackgroundTaskBuilder()
builder.TaskEntryPoint = "Tasks.CompletionGroupTask"
builder.SetTrigger(completionGroup.Trigger)

' The system automatically unregisters the BackgroundTransferCompletionGroup task when it triggers.
' You do not need to unregister it explicitly.
Dim taskRegistration As BackgroundTaskRegistration = builder.Register()

Dim downloader As BackgroundDownloader = New BackgroundDownloader(completionGroup)
Return downloader
End Function
Expand Down
26 changes: 22 additions & 4 deletions Samples/DeviceEnumerationAndPairing/cpp/DisplayHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,24 @@ namespace SDKTemplate
return ref new DeviceSelectorInfo("UPnP", DeviceClass::All, "System.Devices.Aep.ProtocolId:=\"{0e261de4-12f0-46e6-91ba-428607ccef64}\"", DeviceInformationKind::AssociationEndpoint);
}

void AddVideoCastingIfSupported(Vector<DeviceSelectorInfo^>^ selectors)
{
try
{
selectors->Append(DeviceSelectorChoices::VideoCasting);
}
catch (Exception^ ex)
{
if (ex->HResult == HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED))
{
// Video casting not supported by the system.
}
else
{
throw;
}
}
}

IVectorView<DeviceSelectorInfo^>^ DeviceSelectorChoices::DevicePickerSelectors::get()
{
Expand All @@ -138,7 +156,7 @@ namespace SDKTemplate
selectors->Append(BluetoothLEUnpairedOnly);
selectors->Append(WiFiDirect);
selectors->Append(PointOfServicePrinter);
selectors->Append(VideoCasting);
AddVideoCastingIfSupported(selectors);
selectors->Append(DialAllApps);

return selectors->GetView();
Expand All @@ -161,7 +179,7 @@ namespace SDKTemplate
selectors->Append(BluetoothLE);
selectors->Append(WiFiDirect);
selectors->Append(PointOfServicePrinter);
selectors->Append(VideoCasting);
AddVideoCastingIfSupported(selectors);
selectors->Append(DialAllApps);
selectors->Append(Wsd);
selectors->Append(Upnp);
Expand All @@ -176,7 +194,7 @@ namespace SDKTemplate
selectors->Append(BluetoothLEPairedOnly);
selectors->Append(WiFiDirectPairedOnly);
selectors->Append(PointOfServicePrinter);
selectors->Append(VideoCasting);
AddVideoCastingIfSupported(selectors);
selectors->Append(DialAllApps);
selectors->Append(Wsd);
selectors->Append(Upnp);
Expand All @@ -191,7 +209,7 @@ namespace SDKTemplate
selectors->Append(BluetoothLE);
selectors->Append(WiFiDirect);
selectors->Append(PointOfServicePrinter);
selectors->Append(VideoCasting);
AddVideoCastingIfSupported(selectors);
selectors->Append(Wsd);
selectors->Append(Upnp);

Expand Down
20 changes: 16 additions & 4 deletions Samples/DeviceEnumerationAndPairing/cs/DisplayHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,18 @@ public static DeviceSelectorInfo Upnp
}
}

public static void AddVideoCastingIfSupported(List<DeviceSelectorInfo> selectors)
{
try
{
selectors.Add(VideoCasting);
}
catch (Exception ex) when (ex.HResult == unchecked((int)0x80070032)) // HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED)
{
// Video casting is not supported by the system.
}
}

public static List<DeviceSelectorInfo> DevicePickerSelectors
{
get
Expand All @@ -207,7 +219,7 @@ public static List<DeviceSelectorInfo> DevicePickerSelectors
selectors.Add(BluetoothLEUnpairedOnly);
selectors.Add(WiFiDirect);
selectors.Add(PointOfServicePrinter);
selectors.Add(VideoCasting);
AddVideoCastingIfSupported(selectors);
selectors.Add(DialAllApps);

return selectors;
Expand Down Expand Up @@ -238,7 +250,7 @@ public static List<DeviceSelectorInfo> DeviceWatcherSelectors
selectors.Add(BluetoothLE);
selectors.Add(WiFiDirect);
selectors.Add(PointOfServicePrinter);
selectors.Add(VideoCasting);
AddVideoCastingIfSupported(selectors);
selectors.Add(DialAllApps);
selectors.Add(Wsd);
selectors.Add(Upnp);
Expand All @@ -257,7 +269,7 @@ public static List<DeviceSelectorInfo> BackgroundDeviceWatcherSelectors
selectors.Add(BluetoothLEPairedOnly);
selectors.Add(WiFiDirectPairedOnly);
selectors.Add(PointOfServicePrinter);
selectors.Add(VideoCasting);
AddVideoCastingIfSupported(selectors);
selectors.Add(DialAllApps);
selectors.Add(Wsd);
selectors.Add(Upnp);
Expand All @@ -279,7 +291,7 @@ public static List<DeviceSelectorInfo> PairingSelectors
selectors.Add(BluetoothLE);
selectors.Add(WiFiDirect);
selectors.Add(PointOfServicePrinter);
selectors.Add(VideoCasting);
AddVideoCastingIfSupported(selectors);
selectors.Add(Wsd);
selectors.Add(Upnp);

Expand Down
20 changes: 15 additions & 5 deletions Samples/DeviceEnumerationAndPairing/js/js/displayhelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,17 @@
var wiFiDirect = { displayName: "Wi-Fi Direct", selector: Windows.Devices.WiFiDirect.WiFiDirectDevice.getDeviceSelector(Windows.Devices.WiFiDirect.WiFiDirectDeviceSelectorType.associationEndpoint) };
var wiFiDirectPairedOnly = { displayName: "Wi-Fi Direct (paired)", selector: Windows.Devices.WiFiDirect.WiFiDirectDevice.getDeviceSelector() };
var pointOfServicePrinter = { displayName: "Point of Service Printer", selector: Windows.Devices.PointOfService.PosPrinter.getDeviceSelector() };
var videoCasting = { displayName: "Video Casting", selector: Windows.Media.Casting.CastingDevice.getDeviceSelector(Windows.Media.Casting.CastingPlaybackTypes.video) };

try {
var videoCasting = { displayName: "Video Casting", selector: Windows.Media.Casting.CastingDevice.getDeviceSelector(Windows.Media.Casting.CastingPlaybackTypes.video) };
} catch (e) {
if (e.number === 0x80070032 | 0) { // HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED)
// Video casting not supported by the system.
} else {
throw e;
}
}

var dialAllApps = { displayName: "DIAL (All Apps)", selector: Windows.Media.DialProtocol.DialDevice.getDeviceSelector("") };

// WSD and UPnP are unique in that there are currently no general WSD or UPnP APIs to USE the devices once you've discovered them.
Expand All @@ -53,7 +63,7 @@
devicePickerArray.push(bluetoothLEUnpairedOnly);
devicePickerArray.push(wiFiDirect);
devicePickerArray.push(pointOfServicePrinter);
devicePickerArray.push(videoCasting);
videoCasting && devicePickerArray.push(videoCasting);
devicePickerArray.push(dialAllApps);
var devicePickerSelectors = new WinJS.Binding.List(devicePickerArray);

Expand All @@ -68,7 +78,7 @@
deviceWatcherArray.push(bluetoothLE);
deviceWatcherArray.push(wiFiDirect);
deviceWatcherArray.push(pointOfServicePrinter);
deviceWatcherArray.push(videoCasting);
videoCasting && deviceWatcherArray.push(videoCasting);
deviceWatcherArray.push(dialAllApps);
deviceWatcherArray.push(wsd);
deviceWatcherArray.push(upnp);
Expand All @@ -79,7 +89,7 @@
backgroundDeviceWatcherArray.push(bluetoothLEPairedOnly);
backgroundDeviceWatcherArray.push(wiFiDirectPairedOnly);
backgroundDeviceWatcherArray.push(pointOfServicePrinter);
backgroundDeviceWatcherArray.push(videoCasting);
videoCasting && backgroundDeviceWatcherArray.push(videoCasting);
backgroundDeviceWatcherArray.push(dialAllApps);
backgroundDeviceWatcherArray.push(wsd);
backgroundDeviceWatcherArray.push(upnp);
Expand All @@ -90,7 +100,7 @@
pairingArray.push(bluetoothLE);
pairingArray.push(wiFiDirect);
pairingArray.push(pointOfServicePrinter);
pairingArray.push(videoCasting);
videoCasting && pairingArray.push(videoCasting);
pairingArray.push(wsd);
pairingArray.push(upnp);
var pairingSelectors = new WinJS.Binding.List(pairingArray);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<SDKReference Include="WindowsMobile, Version=10.0.17763.0">
<Name>Windows Mobile Extensions for the UWP</Name>
<SDKReference Include="WindowsDesktop, Version=10.0.17763.0">
<Name>Windows Desktop Extensions for the UWP</Name>
</SDKReference>
</ItemGroup>
<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Samples/IoT-GPIO/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ This sample demonstrates the following:

**Note** The Windows universal samples require Visual Studio 2017 to build and Windows 10 IoT Core to execute.

To obtain information about Windows 10 IoT Core, go to [Windows on Devices](http://windowsondevices.com)
To obtain information about Windows 10 IoT Core, go to [Windows on Devices](http://windowsondevices.com).

To see more samples specifically describing how to leverage Windows 10 IoT Core, click on the [Samples tab here](http://ms-iot.github.io/content/win10/StartCoding.htm).
You can find more Windows IoT Core samples in the [Windows 10 Internet of Things (IoT) Samples repo](https://go.microsoft.com/fwlink/?linkid=860459).

To obtain information about Microsoft Visual Studio and the tools for developing Windows apps, go to [Visual Studio](http://go.microsoft.com/fwlink/?LinkID=532422)

Expand Down
2 changes: 1 addition & 1 deletion Samples/IoT-I2C/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ The sample shows the following techniques:

To obtain information about Windows 10 IoT Core, go to [Windows on Devices](http://windowsondevices.com)

To see more samples specifically describing how to leverage Windows 10 IoT Core, click on the [Samples tab here](http://ms-iot.github.io/content/win10/StartCoding.htm).
You can find more Windows IoT Core samples in the [Windows 10 Internet of Things (IoT) Samples repo](https://go.microsoft.com/fwlink/?linkid=860459).

To obtain information about Microsoft Visual Studio and the tools for developing Windows apps, go to [Visual Studio](http://go.microsoft.com/fwlink/?LinkID=532422)

Expand Down
2 changes: 1 addition & 1 deletion Samples/IoT-SPI/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The sample shows the following techniques:

To obtain information about Windows 10 IoT Core, go to [Windows on Devices](http://windowsondevices.com).

To see more samples specifically describing how to leverage Windows 10 IoT Core, click on the [Samples tab here](http://ms-iot.github.io/content/win10/StartCoding.htm).
You can find more Windows IoT Core samples in the [Windows 10 Internet of Things (IoT) Samples repo](https://go.microsoft.com/fwlink/?linkid=860459).

To obtain information about Microsoft Visual Studio and the tools for developing Windows apps, go to [Visual Studio](http://go.microsoft.com/fwlink/?LinkID=532422)

Expand Down
140 changes: 0 additions & 140 deletions Samples/JumpList/cpp/App.xaml.cpp

This file was deleted.

Loading

0 comments on commit d0e9bc9

Please sign in to comment.