Skip to content

Commit

Permalink
Windows 10 Version 1709 - July 2018 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
oldnewthing committed Jul 19, 2018
1 parent c94ace4 commit cff2a43
Show file tree
Hide file tree
Showing 18 changed files with 244 additions and 218 deletions.
6 changes: 5 additions & 1 deletion Samples/BluetoothLE/cs/Scenario1_Discovery.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@ private void StartBleDeviceWatcher()
// Start over with an empty collection.
KnownDevices.Clear();

// Start the watcher.
// Start the watcher. Active enumeration is limited to approximately 30 seconds.
// This limits power usage and reduces interference with other Bluetooth activities.
// To monitor for the presence of Bluetooth LE devices for an extended period,
// use the BluetoothLEAdvertisementWatcher runtime class. See the BluetoothAdvertisement
// sample for an example.
deviceWatcher.Start();
}

Expand Down
2 changes: 1 addition & 1 deletion Samples/ContactPanel/cs/ContactPanel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProjectGuid>{DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}</ProjectGuid>
<ProjectGuid>{8C86632A-0887-504C-B11C-C82F188BE357}</ProjectGuid>
<OutputType>AppContainerExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SDKTemplate</RootNamespace>
Expand Down
38 changes: 19 additions & 19 deletions Samples/ContactPanel/cs/ContactPanel.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27004.2006
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ContactPanel", "ContactPanel.csproj", "{DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ContactPanel", "ContactPanel.csproj", "{8C86632A-0887-504C-B11C-C82F188BE357}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -15,24 +15,24 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Debug|ARM.ActiveCfg = Debug|ARM
{DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Debug|ARM.Build.0 = Debug|ARM
{DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Debug|ARM.Deploy.0 = Debug|ARM
{DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Debug|x64.ActiveCfg = Debug|x64
{DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Debug|x64.Build.0 = Debug|x64
{DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Debug|x64.Deploy.0 = Debug|x64
{DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Debug|x86.ActiveCfg = Debug|x86
{DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Debug|x86.Build.0 = Debug|x86
{DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Debug|x86.Deploy.0 = Debug|x86
{DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Release|ARM.ActiveCfg = Release|ARM
{DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Release|ARM.Build.0 = Release|ARM
{DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Release|ARM.Deploy.0 = Release|ARM
{DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Release|x64.ActiveCfg = Release|x64
{DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Release|x64.Build.0 = Release|x64
{DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Release|x64.Deploy.0 = Release|x64
{DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Release|x86.ActiveCfg = Release|x86
{DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Release|x86.Build.0 = Release|x86
{DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Release|x86.Deploy.0 = Release|x86
{8C86632A-0887-504C-B11C-C82F188BE357}.Debug|ARM.ActiveCfg = Debug|ARM
{8C86632A-0887-504C-B11C-C82F188BE357}.Debug|ARM.Build.0 = Debug|ARM
{8C86632A-0887-504C-B11C-C82F188BE357}.Debug|ARM.Deploy.0 = Debug|ARM
{8C86632A-0887-504C-B11C-C82F188BE357}.Debug|x64.ActiveCfg = Debug|x64
{8C86632A-0887-504C-B11C-C82F188BE357}.Debug|x64.Build.0 = Debug|x64
{8C86632A-0887-504C-B11C-C82F188BE357}.Debug|x64.Deploy.0 = Debug|x64
{8C86632A-0887-504C-B11C-C82F188BE357}.Debug|x86.ActiveCfg = Debug|x86
{8C86632A-0887-504C-B11C-C82F188BE357}.Debug|x86.Build.0 = Debug|x86
{8C86632A-0887-504C-B11C-C82F188BE357}.Debug|x86.Deploy.0 = Debug|x86
{8C86632A-0887-504C-B11C-C82F188BE357}.Release|ARM.ActiveCfg = Release|ARM
{8C86632A-0887-504C-B11C-C82F188BE357}.Release|ARM.Build.0 = Release|ARM
{8C86632A-0887-504C-B11C-C82F188BE357}.Release|ARM.Deploy.0 = Release|ARM
{8C86632A-0887-504C-B11C-C82F188BE357}.Release|x64.ActiveCfg = Release|x64
{8C86632A-0887-504C-B11C-C82F188BE357}.Release|x64.Build.0 = Release|x64
{8C86632A-0887-504C-B11C-C82F188BE357}.Release|x64.Deploy.0 = Release|x64
{8C86632A-0887-504C-B11C-C82F188BE357}.Release|x86.ActiveCfg = Release|x86
{8C86632A-0887-504C-B11C-C82F188BE357}.Release|x86.Build.0 = Release|x86
{8C86632A-0887-504C-B11C-C82F188BE357}.Release|x86.Deploy.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
5 changes: 1 addition & 4 deletions Samples/CustomCapability/cpp/Fx2Driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ namespace SDKTemplate
ref class Fx2Driver
{
internal:
// The device type value expected by the driver in IO control
// codes. The driver defines this as 0x65500 but the device type
// value is only 16-bits wide, so we truncate here to 0x5500.
static const uint16 DeviceType = 65500U;
static const uint16 FunctionBase = 0x800;

Expand All @@ -35,4 +32,4 @@ namespace SDKTemplate
private:
static const byte SevenSegmentValues[10];
};
}
}
7 changes: 2 additions & 5 deletions Samples/CustomCapability/cs/Fx2Driver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,15 @@ namespace SDKTemplate
{
static class Fx2Driver
{
// The device type value expected by the driver in IO control
// codes. The driver defines this as 0x65500 but the value gets
// truncated to a ushort. Do the same here.
public const ushort DeviceType = unchecked((ushort)0x65500);
public const ushort DeviceType = 65500;
public const ushort FunctionBase = 0x800;

public static
IOControlCode GetSevenSegmentDisplay = new IOControlCode(DeviceType,
FunctionBase + 7,
IOControlAccessMode.Read,
IOControlBufferingMethod.Buffered);

public static
IOControlCode SetSevenSegmentDisplay = new IOControlCode(DeviceType,
FunctionBase + 8,
Expand Down
8 changes: 4 additions & 4 deletions Samples/CustomCapability/js/js/fx2Driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"use strict";

var Custom = Windows.Devices.Custom;
var deviceType = 0x5500;
var deviceType = 65500;
var functionBase = 0x800;

var sevenSegmentValues = [
Expand All @@ -26,10 +26,10 @@
WinJS.Namespace.define(
"Fx2Driver",
{
//deviceType: deviceType,
//deviceType: deviceType,
//functionBase: functionBase,

getSevenSegmentDisplay: new Custom.IOControlCode(deviceType,
getSevenSegmentDisplay: new Custom.IOControlCode(deviceType,
functionBase + 7,
Custom.IOControlAccessMode.read,
Custom.IOControlBufferingMethod.buffered),
Expand All @@ -44,7 +44,7 @@
Custom.IOControlAccessMode.read,
Custom.IOControlBufferingMethod.buffered),

getInterruptMessage: new Custom.IOControlCode(deviceType,
getInterruptMessage: new Custom.IOControlCode(deviceType,
functionBase + 9,
Custom.IOControlAccessMode.read,
Custom.IOControlBufferingMethod.directOutput),
Expand Down
2 changes: 2 additions & 0 deletions Samples/RadioManager/cpp/RadioModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ using namespace concurrency;
RadioModel::RadioModel(Radio^ radio, UIElement^ parent)
{
this->radio = radio;
// Controlling the mobile broadband radio requires a restricted capability.
this->isEnabled = (radio->Kind != RadioKind::MobileBroadband);
this->parent = parent;
this->radio->StateChanged += ref new TypedEventHandler<Radio^, Object^>(this, &RadioModel::Radio_StateChanged);
}
Expand Down
2 changes: 1 addition & 1 deletion Samples/RadioManager/cpp/RadioModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace SDKTemplate
{
private:
Windows::Devices::Radios::Radio^ radio;
bool isEnabled = true;
bool isEnabled;
Windows::UI::Xaml::UIElement^ parent;

public:
Expand Down
4 changes: 3 additions & 1 deletion Samples/RadioManager/cs/RadioModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ namespace RadioManagerSample
public class RadioModel : INotifyPropertyChanged
{
private Radio radio;
private bool isEnabled = true;
private bool isEnabled;
private UIElement parent;

public RadioModel(Radio radio, UIElement parent)
{
this.radio = radio;
// Controlling the mobile broadband radio requires a restricted capability.
this.isEnabled = (radio.Kind != RadioKind.MobileBroadband);
this.parent = parent;
this.radio.StateChanged += Radio_StateChanged;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,16 @@

<ScrollViewer Grid.Row="1" VerticalScrollMode="Auto" VerticalScrollBarVisibility="Auto">
<StackPanel Orientation="Vertical" VerticalAlignment="Top">
<TextBlock Style="{StaticResource BasicTextStyle}">Use these SID values to register the app with Facebook.</TextBlock>
<TextBlock Style="{StaticResource BasicTextStyle}">Windows Store SID: <Run x:Name="WindowsStoreSidTextBlock"/></TextBlock>
<TextBlock Style="{StaticResource BasicTextStyle}">Windows Phone Store SID: <Run x:Name="WindowsPhoneStoreSidTextBlock"/></TextBlock>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<TextBlock Style="{StaticResource BasicTextStyle}" Text="App ID: " VerticalAlignment="Center" Width="125"/>
<TextBox x:Name="FacebookClientID" Height="14" Width="200" Text=""/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<TextBlock Style="{StaticResource BasicTextStyle}" Text="Site URL: " VerticalAlignment="Center" Width="125"/>
<TextBox x:Name="FacebookCallbackUrl" Height="14" Width="200" Text=""/>
<TextBox x:Name="FacebookCallbackUrl" Height="14" Width="200" Text="https://www.facebook.com/connect/login_success.html"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<TextBox x:Name="FacebookReturnedToken" Width="325" Text="Press Launch to view returned token..." IsEnabled="False"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ using namespace Windows::UI::Xaml::Navigation;
Scenario2_oAuthFacebook::Scenario2_oAuthFacebook()
{
InitializeComponent();

// Use these SIDs to register the app with Facebook.
WindowsStoreSidTextBlock->Text = WebAuthenticationBroker::GetCurrentApplicationCallbackUri()->Host;
WindowsPhoneStoreSidTextBlock->Text = "f48e0417-873f-476c-97a2-2d25c5fa2dc7"; // copied from Package.appxmanifest
}

void Scenario2_oAuthFacebook::Launch_Click(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
Expand All @@ -31,14 +35,15 @@ void Scenario2_oAuthFacebook::Launch_Click(Object^ sender, Windows::UI::Xaml::Ro
String^ facebookURL = "https://www.facebook.com/dialog/oauth?client_id=";

auto clientID = FacebookClientID->Text;
if (clientID == nullptr || clientID->IsEmpty())
if (clientID->IsEmpty())
{
MainPage::Current->NotifyUser("Enter a ClientID", NotifyType::ErrorMessage);
return;
}
if(FacebookCallbackUrl->Text == "")
if(FacebookCallbackUrl->Text->IsEmpty())
{
MainPage::Current->NotifyUser("Enter a Callback URL", NotifyType::ErrorMessage);
return;
}

facebookURL += clientID + "&redirect_uri=" + Uri::EscapeComponent(FacebookCallbackUrl->Text) + "&scope=read_stream&display=popup&response_type=token";
Expand All @@ -48,7 +53,7 @@ void Scenario2_oAuthFacebook::Launch_Click(Object^ sender, Windows::UI::Xaml::Ro
auto facebookToken = FacebookReturnedToken;

auto startURI = ref new Uri(facebookURL);
auto endURI = ref new Uri("https://www.facebook.com/connect/login_success.html");
auto endURI = ref new Uri(FacebookCallbackUrl->Text);
MainPage::Current->NotifyUser("Navigating to: " + facebookURL + "\n", NotifyType::StatusMessage);

create_task(WebAuthenticationBroker::AuthenticateAsync(WebAuthenticationOptions::None, startURI, endURI)).then([this](WebAuthenticationResult^ result)
Expand Down
16 changes: 16 additions & 0 deletions Samples/WebAuthenticationBroker/cs/SampleConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,20 @@ public class Scenario
public string Title { get; set; }
public Type ClassType { get; set; }
}

public static class FormDecoderExtensions
{
public static string TryGetValue(this Windows.Foundation.WwwFormUrlDecoder decoder, string name)
{
try
{
return decoder.GetFirstValueByName(name);
}
catch (ArgumentException)
{
return null;
}
}
}
}

60 changes: 22 additions & 38 deletions Samples/WebAuthenticationBroker/cs/Scenario1_Facebook.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,43 +19,27 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid x:Name="RootGrid" Margin="12,20,12,12">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel Margin="0,0,0,10">
<TextBlock Text="Description:" Style="{StaticResource SampleHeaderTextStyle}"/>
<TextBlock Style="{StaticResource ScenarioDescriptionTextStyle}" TextWrapping="Wrap">
Connect to Facebook using the OAuth 2.0 protocol for authentication and authorization.
</TextBlock>
</StackPanel>

<ScrollViewer Grid.Row="1" VerticalScrollMode="Auto" VerticalScrollBarVisibility="Auto">
<StackPanel Orientation="Vertical" VerticalAlignment="Top">
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<TextBlock Style="{StaticResource BasicTextStyle}" Text="App ID: " VerticalAlignment="Center" Width="85"/>
<TextBox x:Name="FacebookClientID" Height="14" Width="200" Text=""/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<TextBlock Style="{StaticResource BasicTextStyle}" Text="Site URL: " VerticalAlignment="Center" Width="85"/>
<TextBox x:Name="FacebookCallbackUrl" Height="14" Width="200" Text=""/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<TextBox x:Name="FacebookReturnedToken" Width="285" Text="Press Launch to view returned token..." IsEnabled="False"/>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<Button x:Name="Launch" Content="Launch" Width="285" Click="Launch_Click"/>
</StackPanel>
</StackPanel>
</ScrollViewer>
<ScrollViewer Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Padding="12,20,12,12">
<StackPanel Margin="0,0,0,10">
<TextBlock Text="Description:" Style="{StaticResource SampleHeaderTextStyle}"/>
<TextBlock Style="{StaticResource ScenarioDescriptionTextStyle}" TextWrapping="Wrap">
Connect to Facebook using the OAuth 2.0 protocol for authentication and authorization.
</TextBlock>

<!-- Status Block for providing messages to the user. Use the
NotifyUser() method to populate the message -->
<Border x:Name="ErrorBorder" Background="Red" Grid.Row="2"/>
<TextBlock x:Name="StatusBlock" Grid.Row="2" Margin="12, 10, 12, 10" Visibility="Collapsed"/>
</Grid>
</Grid>
<TextBlock Style="{StaticResource BasicTextStyle}">Use these SID values to register the app with Facebook.</TextBlock>
<TextBlock>Windows Store SID: <Run x:Name="WindowsStoreSidTextBlock"/></TextBlock>
<TextBlock>Windows Phone Store SID: <Run x:Name="WindowsPhoneStoreSidTextBlock"/></TextBlock>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<TextBlock Style="{StaticResource BasicTextStyle}" Text="App ID: " VerticalAlignment="Center" Width="85"/>
<TextBox x:Name="FacebookClientID" Height="14" Width="200" Text=""/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<TextBlock Style="{StaticResource BasicTextStyle}" Text="Site URL: " VerticalAlignment="Center" Width="85"/>
<TextBox x:Name="FacebookCallbackUrl" Height="14" Width="200" Text="https://www.facebook.com/connect/login_success.html"/>
</StackPanel>
<Button x:Name="Launch" Content="Launch" Click="Launch_Click" Margin="0,10,0,0"/>
<TextBlock Margin="0,10,0,0">Token: <Run x:Name="FacebookReturnedToken"/></TextBlock>
<TextBlock Margin="0,10,0,0">User Name: <Run x:Name="FacebookUserName"/></TextBlock>
</StackPanel>
</ScrollViewer>
</Page>
Loading

0 comments on commit cff2a43

Please sign in to comment.