Windows 10 RTM Release - March 2016 Update

This commit is contained in:
Raymond Chen 2016-03-09 16:56:03 -08:00
Родитель 94d11a63c3
Коммит 46269af7cd
59 изменённых файлов: 70 добавлений и 1903 удалений

Просмотреть файл

@ -388,22 +388,25 @@ For additional Windows samples, see [Windows on GitHub](http://microsoft.github.
</tr>
<tr>
<td><a href="Samples/PasswordVault">Credential locker</a></td>
<td><a href="Samples/ClientDeviceInformation">Client Device Information</a></td>
<td><a href="Samples/CredentialPicker">Credential picker</a></td>
<td><a href="Samples/DeviceLockdownAzureLogin">Device lockdown with Azure login</a></td>
</tr>
<tr>
<td><a href="Samples/DeviceLockdownAzureLogin">Device lockdown with Azure login</a></td>
<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>
</tr>
<tr>
<td><a href="Samples/KeyCredentialManager">KeyCredentialManager</a></td>
<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>
</tr>
<tr>
<td><a href="Samples/UserInfo">User information</a></td>
<td><a href="Samples/UserConsentVerifier">UserConsentVerifier</a></td>
<td><a href="Samples/WebAccountManagement">Web account management</a></td>
</tr>
<tr>
<td><a href="Samples/WebAuthenticationBroker">WebAuthenticationBroker</a></td>
</tr>
</table>
@ -452,27 +455,26 @@ For additional Windows samples, see [Windows on GitHub](http://microsoft.github.
<td><a href="Samples/DatagramSocket">DatagramSocket</a></td>
</tr>
<tr>
<td><a href="Samples/EasProtocol">Exchange Active Sync (EAS)</a></td>
<td><a href="Samples/HttpClient">HttpClient</a></td>
<td><a href="Samples/Json">JSON</a></td>
<td><a href="Samples/MobileBroadband">Mobile broadband</a></td>
</tr>
<tr>
<td><a href="Samples/MobileBroadband">Mobile broadband</a></td>
<td><a href="Samples/RadioManager">Radios</a></td>
<td><a href="Samples/FeedReader">RSS reader end-to-end (JavaScript)</a></td>
<td><a href="Samples/SocketActivityStreamSocket">Socket activity trigger stream socket</a></td>
</tr>
<tr>
<td><a href="Samples/SocketActivityStreamSocket">Socket activity trigger stream socket</a></td>
<td><a href="Samples/StreamSocket">StreamSocket</a></td>
<td><a href="Samples/Syndication">Syndication</a></td>
<td><a href="Samples/UssdProtcol">USSD protocol</a></td>
</tr>
<tr>
<td><a href="Samples/UssdProtcol">USSD protocol</a></td>
<td><a href="Samples/WebSocket">WebSocket</a></td>
<td><a href="Samples/WiFiDirect">Wi-Fi Direct</a></td>
<td><a href="Samples/WiFiDirectServices">Wi-Fi Direct services</a></td>
</tr>
<tr>
<td><a href="Samples/WiFiDirectServices">Wi-Fi Direct services</a></td>
<td><a href="Samples/WiFiScan">Wi-Fi scanning</a></td>
</tr>
</table>

Просмотреть файл

@ -1,30 +1,26 @@
<!---
category: NetworkingAndWebServices
<!---
category: IdentitySecurityAndEncryption
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620540
--->
# Exchange Active Sync (EAS) sample
# Client Device Information sample
This sample shows how mail clients can retrieve device information and work with supplied Exchange Active Sync (EAS) policies.
This sample shows how apps can retrieve device information such as operating system and manufacturer.
Windows Store apps can configure their mail clients to stay compliant with the given EAS policies. To bring the local computer compliant, you must request the user's consent before you proceed through the use of a consent UI. Then you can configure the exchange account.
This sample requires some experience with WMI programming.
**Note**  This sample was created using one of the universal app templates available in Visual Studio. It shows how its solution is structured so it can run on both Windows 10 and Windows Phone 10.
You can choose one of three scenarios:
This sample demonstrates the following:
- Retrieving device information
- Checking if device policies are compliant with supplied EAS policies
- Applying supplied EAS policies.
## Related Topics
[Windows.Security.ExchangeActiveSyncProvisioning](http://msdn.microsoft.com/library/windows/apps/hh701506)
[EasClientDeviceInformation class](https://msdn.microsoft.com/library/windows/apps/windows.security.exchangeactivesyncprovisioning.easclientdeviceinformation)
## Operating system requirements
Windows 10
*Client*: Windows 10
**Server:** Windows Server 2016 Technical Preview
**Phone:** Windows 10
## Build the sample

Просмотреть файл

@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.22609.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EasProtocol", "EasProtocol.vcxproj", "{F710B9FD-4E6B-42D7-A99A-6D48888D48B0}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ClientDeviceInformation", "ClientDeviceInformation.vcxproj", "{F710B9FD-4E6B-42D7-A99A-6D48888D48B0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

Просмотреть файл

@ -157,12 +157,6 @@
<ClInclude Include="Scenario1_GetDeviceInformation.xaml.h">
<DependentUpon>Scenario1_GetDeviceInformation.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="Scenario2_CheckCompliance.xaml.h">
<DependentUpon>Scenario2_CheckCompliance.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="Scenario3_ApplyEASPolicy.xaml.h">
<DependentUpon>Scenario3_ApplyEASPolicy.xaml</DependentUpon>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="..\..\..\SharedContent\xaml\App.xaml">
@ -172,8 +166,6 @@
<SubType>Designer</SubType>
</Page>
<Page Include="Scenario1_GetDeviceInformation.xaml" />
<Page Include="Scenario2_CheckCompliance.xaml" />
<Page Include="Scenario3_ApplyEASPolicy.xaml" />
<Page Include="..\..\..\SharedContent\xaml\Styles.xaml">
<Link>Styles\Styles.xaml</Link>
</Page>
@ -202,12 +194,6 @@
<ClCompile Include="Scenario1_GetDeviceInformation.xaml.cpp">
<DependentUpon>Scenario1_GetDeviceInformation.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="Scenario2_CheckCompliance.xaml.cpp">
<DependentUpon>Scenario2_CheckCompliance.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="Scenario3_ApplyEASPolicy.xaml.cpp">
<DependentUpon>Scenario3_ApplyEASPolicy.xaml</DependentUpon>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Image Include="..\..\..\SharedContent\media\microsoft-sdk.png">
@ -232,9 +218,6 @@
<Link>Assets\windows-sdk.png</Link>
</Image>
</ItemGroup>
<ItemGroup>
<SDKReference Include="WindowsDesktop, Version=10.0.10240.0" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>

Просмотреть файл

@ -50,8 +50,6 @@
<ItemGroup>
<Page Include="..\..\..\SharedContent\cpp\MainPage.xaml" />
<Page Include="Scenario1_GetDeviceInformation.xaml" />
<Page Include="Scenario2_CheckCompliance.xaml" />
<Page Include="Scenario3_ApplyEASPolicy.xaml" />
<Page Include="..\..\..\SharedContent\xaml\Styles.xaml">
<Filter>Styles</Filter>
</Page>

Просмотреть файл

@ -7,14 +7,14 @@
IgnorableNamespaces="uap mp">
<Identity
Name="Microsoft.SDKSamples.EAS.CPP"
Name="Microsoft.SDKSamples.ClietnDeviceInformation.CPP"
Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"
Version="1.0.0.0" />
<mp:PhoneIdentity PhoneProductId="da04b78c-400c-4d37-89d3-dfe18910850f" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
<Properties>
<DisplayName>EAS Protocol C++ Sample</DisplayName>
<DisplayName>Client Device Information C++ Sample</DisplayName>
<PublisherDisplayName>Microsoft Corporation</PublisherDisplayName>
<Logo>Assets\StoreLogo-sdk.png</Logo>
</Properties>
@ -30,12 +30,12 @@
<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="EAS.App">
EntryPoint="ClientDeviceInformation.App">
<uap:VisualElements
DisplayName="EAS Protocol C++ Sample"
DisplayName="Client Device Information C++ Sample"
Square150x150Logo="Assets\squareTile-sdk.png"
Square44x44Logo="Assets\smallTile-sdk.png"
Description="EAS Protocol C++ Sample"
Description="Client Device Information C++ Sample"
BackgroundColor="#00B2F0">
<uap:SplashScreen Image="Assets\splash-sdk.png" />

Просмотреть файл

@ -9,6 +9,4 @@ using namespace SDKTemplate;
Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Scenario>
{
{ "Get Device Information", "SDKTemplate.Scenario1_GetDeviceInformation" },
{ "Check Compliance", "SDKTemplate.Scenario2_CheckCompliance" },
{ "Apply EAS Policy", "SDKTemplate.Scenario3_ApplyEASPolicy" }
};

Просмотреть файл

@ -107,12 +107,6 @@
<Compile Include="Scenario1_GetDeviceInformation.xaml.cs">
<DependentUpon>Scenario1_GetDeviceInformation.xaml</DependentUpon>
</Compile>
<Compile Include="Scenario2_CheckCompliance.xaml.cs">
<DependentUpon>Scenario2_CheckCompliance.xaml</DependentUpon>
</Compile>
<Compile Include="Scenario3_ApplyEASPolicy.xaml.cs">
<DependentUpon>Scenario3_ApplyEASPolicy.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
@ -134,14 +128,6 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Scenario2_CheckCompliance.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Scenario3_ApplyEASPolicy.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="..\..\..\SharedContent\xaml\Styles.xaml">
<Link>Styles\Styles.xaml</Link>
<Generator>MSBuild:Compile</Generator>
@ -174,11 +160,6 @@
<Link>Assets\windows-sdk.png</Link>
</Content>
</ItemGroup>
<ItemGroup>
<SDKReference Include="WindowsDesktop, Version=10.0.10240.0">
<Name>Microsoft Desktop Extension SDK for Universal App Platform</Name>
</SDKReference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>

Просмотреть файл

@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.22609.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasProtocol", "EasProtocol.csproj", "{DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClientDeviceInformation", "ClientDeviceInformation.csproj", "{DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

Просмотреть файл

@ -7,7 +7,7 @@
IgnorableNamespaces="uap mp">
<Identity
Name="Microsoft.SDKSamples.EAS.CS"
Name="Microsoft.SDKSamples.ClientDeviceInformation.CS"
Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"
Version="1.0.0.0" />
@ -15,7 +15,7 @@
<mp:PhoneIdentity PhoneProductId="806cd623-e526-4b54-be9a-8eebc63b3e4b" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
<Properties>
<DisplayName>EAS Protocol C# Sample</DisplayName>
<DisplayName>Client Device Information C# Sample</DisplayName>
<PublisherDisplayName>Microsoft Corporation</PublisherDisplayName>
<Logo>Assets\StoreLogo-sdk.png</Logo>
</Properties>
@ -31,12 +31,12 @@
<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="EAS.App">
EntryPoint="ClientDeviceInformation.App">
<uap:VisualElements
DisplayName="EAS Protocol C# Sample"
DisplayName="Client Device Information C# Sample"
Square150x150Logo="Assets\squareTile-sdk.png"
Square44x44Logo="Assets\SmallTile-sdk.png"
Description="EAS Protocol C# Sample"
Description="Client Device Information C# Sample"
BackgroundColor="#00b2f0">
<uap:SplashScreen Image="Assets\Splash-sdk.png" />

Просмотреть файл

@ -12,7 +12,6 @@
using System;
using System.Collections.Generic;
using Windows.UI.Xaml.Controls;
using EAS;
namespace SDKTemplate
{
@ -23,8 +22,6 @@ namespace SDKTemplate
List<Scenario> scenarios = new List<Scenario>
{
new Scenario() { Title="Get Device Information", ClassType=typeof(Scenario1_GetDeviceInformation)},
new Scenario() { Title="Check Compliance", ClassType=typeof(Scenario2_CheckCompliance)},
new Scenario() { Title="Apply EAS Policy", ClassType=typeof(Scenario3_ApplyEASPolicy)}
};
}

Просмотреть файл

@ -11,10 +11,10 @@
//*********************************************************
-->
<Page
x:Class="EAS.Scenario1_GetDeviceInformation"
x:Class="SDKTemplate.Scenario1_GetDeviceInformation"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:EAS"
xmlns:local="using:SDKTemplate"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
@ -42,7 +42,7 @@
<StackPanel Orientation="Vertical" HorizontalAlignment="Left" Margin="0,10,0,0">
<TextBlock VerticalAlignment="Center" Text="OperatingSystem :" Style="{StaticResource BasicTextStyle}"/>
<TextBox IsEnabled="False" x:Name="OperatingSystem" Width="280"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" HorizontalAlignment="Left" Margin="0,10,0,0">
<TextBlock VerticalAlignment="Center" Text="FriendlyName :" Style="{StaticResource BasicTextStyle}"/>
<TextBox IsEnabled="False" x:Name="FriendlyName" Width="280"/>

Просмотреть файл

@ -9,13 +9,12 @@
//
//*********************************************************
using SDKTemplate;
using System;
using Windows.Security.ExchangeActiveSyncProvisioning;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
namespace EAS
namespace SDKTemplate
{
public sealed partial class Scenario1_GetDeviceInformation : Page
{

Просмотреть файл

@ -58,8 +58,6 @@
<Link>default.html</Link>
</Content>
<Content Include="html\scenario1.html" />
<Content Include="html\scenario2.html" />
<Content Include="html\scenario3.html" />
<Content Include="..\..\..\SharedContent\media\microsoft-sdk.png">
<Link>images\microsoft-sdk.png</Link>
</Content>
@ -86,8 +84,6 @@
</Content>
<Content Include="js\sample-configuration.js" />
<Content Include="js\scenario1.js" />
<Content Include="js\scenario2.js" />
<Content Include="js\scenario3.js" />
<Content Include="..\..\..\SharedContent\js\Microsoft.WinJS\css\ui-dark.css">
<Link>Microsoft.WinJS.4.0\css\ui-dark.css</Link>
</Content>

Просмотреть файл

@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.22609.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{262852C6-CD72-467D-83FE-5EEB1973A190}") = "EasProtocol", "EasProtocol.jsproj", "{C2ADB9AF-EDB3-4E57-8056-9D0531D4A6B2}"
Project("{262852C6-CD72-467D-83FE-5EEB1973A190}") = "ClientDeviceInformation", "ClientDeviceInformation.jsproj", "{C2ADB9AF-EDB3-4E57-8056-9D0531D4A6B2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

Просмотреть файл

@ -6,14 +6,14 @@
IgnorableNamespaces="uap mp">
<Identity
Name="Microsoft.SDKSamples.EAS.JS"
Name="Microsoft.SDKSamples.ClientDeviceInformation.JS"
Version="1.0.0.0"
Publisher="CN=Microsoft" />
<mp:PhoneIdentity PhoneProductId="10fec429-fbc2-4e15-a042-da8debb674af" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
<Properties>
<DisplayName>EAS Protocol JS Sample</DisplayName>
<DisplayName>Client Device Information JS Sample</DisplayName>
<PublisherDisplayName>Microsoft Corporation</PublisherDisplayName>
<Logo>images\storelogo-sdk.png</Logo>
</Properties>
@ -33,8 +33,8 @@
StartPage="default.html">
<uap:VisualElements
DisplayName="EAS Protocol JS Sample"
Description="EAS Protocol JS Sample"
DisplayName="Client Device Information JS Sample"
Description="Client Device Information JS Sample"
BackgroundColor="#00b2f0"
Square150x150Logo="images\storelogo-sdk.png"

Просмотреть файл

@ -6,9 +6,7 @@
var sampleTitle = "EAS protocol";
var scenarios = [
{ url: "/html/scenario1.html", title: "Get Device Information" },
{ url: "/html/scenario2.html", title: "Check Compliance" },
{ url: "/html/scenario3.html", title: "Apply EAS Policy" }
{ url: "/html/scenario1.html", title: "Get Device Information" }
];
WinJS.Namespace.define("SdkSample", {

Просмотреть файл

@ -59,27 +59,10 @@ Rect Scenario2::GetTextboxSelectionRect(TextBox^ textbox)
rectLast = textbox->GetRectFromCharacterIndex(lastIndex, false);
}
GeneralTransform^ buttonTransform = textbox->TransformToVisual(nullptr);
const Point pointOrig(0, 0);
const Point pointTransformed = buttonTransform->TransformPoint(pointOrig);
Rect selectionRect = RectHelper::Union(rectFirst, rectLast);
// Make sure that we return a valid rect if selection is on multiple lines
// and end of the selection is to the left of the start of the selection.
float x, y, dx, dy;
y = pointTransformed.Y + rectFirst.Top;
dy = rectLast.Bottom - rectFirst.Top;
if (rectLast.Right > rectFirst.Left)
{
x = pointTransformed.X + rectFirst.Left;
dx = rectLast.Right - rectFirst.Left;
}
else
{
x = pointTransformed.X + rectLast.Right;
dx = rectFirst.Left - rectLast.Right;
}
return Rect(x, y, dx, dy);
GeneralTransform^ transform = textbox->TransformToVisual(nullptr);
return transform->TransformBounds(selectionRect);
}
void Scenario2::ReadOnlyTextBox_ContextMenuOpening(Object^ sender, ContextMenuEventArgs^ e)

Просмотреть файл

@ -56,26 +56,10 @@ namespace SDKTemplate
rectLast = textbox.GetRectFromCharacterIndex(lastIndex, false);
}
GeneralTransform buttonTransform = textbox.TransformToVisual(null);
Point point = buttonTransform.TransformPoint(new Point());
rectFirst.Union(rectLast);
// Make sure that we return a valid rect if selection is on multiple lines
// and end of the selection is to the left of the start of the selection.
double x, y, dx, dy;
y = point.Y + rectFirst.Top;
dy = rectLast.Bottom - rectFirst.Top;
if (rectLast.Right > rectFirst.Left)
{
x = point.X + rectFirst.Left;
dx = rectLast.Right - rectFirst.Left;
}
else
{
x = point.X + rectLast.Right;
dx = rectFirst.Left - rectLast.Right;
}
return new Rect(x, dx, y, dy);
GeneralTransform transform = textbox.TransformToVisual(null);
return transform.TransformBounds(rectFirst);
}
private async void ReadOnlyTextBox_ContextMenuOpening(object sender, ContextMenuEventArgs e)

Просмотреть файл

@ -1,119 +0,0 @@
<!--
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
-->
<Page
x:Class="SDKTemplate.Scenario2_CheckCompliance"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:SDKTemplate"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
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">
This scenario provides an example how mail client provision a device with supplied EAS policies. Mail client can check if current device settings are compliant with EAS policies required by EAS server.
</TextBlock>
</StackPanel>
<ScrollViewer Grid.Row="1" VerticalScrollMode="Auto" VerticalScrollBarVisibility="Auto">
<StackPanel Orientation="Vertical" VerticalAlignment="Top">
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="RequireEncryption (True/False)" Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<ComboBox x:Name="RequireEncryptionValue" Margin="0,0,10,0" Width="115" SelectedIndex="0">
<ComboBoxItem Content="False"/>
<ComboBoxItem Content="True" />
</ComboBox>
<TextBox x:Name="RequireEncryptionResult" Width="155" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="MinPasswordLength (0-16) " Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<TextBox x:Name="MinPasswordLengthValue" Margin="0,0,10,0" Width="115"/>
<TextBox x:Name="MinPasswordLengthResult" Width="155" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="DisallowConvenienceLogon (True/False) " Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<ComboBox x:Name="DisallowConvenienceLogonValue" Margin="0,0,10,0" Width="115" SelectedIndex="0">
<ComboBoxItem Content="False"/>
<ComboBoxItem Content="True"/>
</ComboBox>
<TextBox x:Name="DisallowConvenienceLogonResult" Width="155" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="MinPasswordComplexCharacters (0-4) " Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<TextBox x:Name="MinPasswordComplexCharactersValue" Margin="0,0,10,0" Width="115"/>
<TextBox x:Name="MinPasswordComplexCharactersResult" Width="155" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="PasswordExpiration (0-999 days)" Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<TextBox x:Name="PasswordExpirationValue" Margin="0,0,10,0" Width="115"/>
<TextBox x:Name="PasswordExpirationResult" Width="155" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="PasswordHistory (0-24) " Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<TextBox x:Name="PasswordHistoryValue" Margin="0,0,10,0" Width="115"/>
<TextBox x:Name="PasswordHistoryResult" Width="155" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="MaxPasswordFailedAttempts (0, 4-999)" Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<TextBox x:Name="MaxPasswordFailedAttemptsValue" Margin="0,0,10,0" Width="115"/>
<TextBox x:Name="MaxPasswordFailedAttemptsResult" Width="155" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="MaxInactivityTimeLock (0-599940 secs)" Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<TextBox x:Name="MaxInactivityTimeLockValue" Margin="0,0,10,0" Width="115"/>
<TextBox x:Name="MaxInactivityTimeLockResult" Width="155" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="EncryptionProviderType" Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<TextBox x:Name="EncryptionProviderTypeResult" Width="280" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,15,0,0">
<Button x:Name="Launch" Content="Launch" Margin="0,0,10,0" Width="115" Click="Launch_Click"/>
<Button x:Name="Reset" Content="Reset" Width="115" Click="Reset_Click"/>
</StackPanel>
</StackPanel>
</ScrollViewer>
<!-- 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>
</Page>

Просмотреть файл

@ -1,172 +0,0 @@
// Copyright (c) Microsoft. All rights reserved.
#include "pch.h"
#include "Scenario2_CheckCompliance.xaml.h"
using namespace SDKTemplate;
using namespace Platform;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
using namespace Windows::Security::ExchangeActiveSyncProvisioning;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::UI::Xaml::Controls::Primitives;
using namespace Windows::UI::Xaml::Data;
using namespace Windows::UI::Xaml::Input;
using namespace Windows::UI::Xaml::Media;
using namespace Windows::UI::Xaml::Navigation;
Scenario2_CheckCompliance::Scenario2_CheckCompliance() : rootPage(MainPage::Current)
{
InitializeComponent();
}
void Scenario2_CheckCompliance::Launch_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
try
{
EasClientSecurityPolicy^ RequestedPolicy = ref new EasClientSecurityPolicy;
if (RequireEncryptionValue == nullptr)
{
RequestedPolicy->RequireEncryption = false;
}
else
{
if (RequireEncryptionValue->SelectedIndex == 1)
{
RequestedPolicy->RequireEncryption = true;
}
else
{
RequestedPolicy->RequireEncryption = false;
}
}
if (RequireEncryptionValue == nullptr || MinPasswordLengthValue->Text == "")
{
RequestedPolicy->MinPasswordLength = 0;
}
else
{
RequestedPolicy->MinPasswordLength = _wtoi(MinPasswordLengthValue->Text->Data());
}
if (DisallowConvenienceLogonValue == nullptr)
{
RequestedPolicy->DisallowConvenienceLogon = false;
}
else
{
if (DisallowConvenienceLogonValue->SelectedIndex == 1)
{
RequestedPolicy->DisallowConvenienceLogon = true;
}
else
{
RequestedPolicy->DisallowConvenienceLogon = false;
}
}
if (MinPasswordComplexCharactersValue == nullptr || MinPasswordComplexCharactersValue->Text == "")
{
RequestedPolicy->MinPasswordComplexCharacters = 0;
}
else
{
RequestedPolicy->MinPasswordComplexCharacters = _wtoi(MinPasswordComplexCharactersValue->Text->Data());
}
TimeSpan ExpirationDays;
if (PasswordExpirationValue == nullptr || PasswordExpirationValue->Text == "")
{
ExpirationDays.Duration = 0;
RequestedPolicy->PasswordExpiration = ExpirationDays;
}
else
{
ExpirationDays.Duration = _wtoi(PasswordExpirationValue->Text->Data()) * 86400000;
RequestedPolicy->PasswordExpiration = ExpirationDays;
}
if (PasswordHistoryValue == nullptr || PasswordHistoryValue->Text == "")
{
RequestedPolicy->PasswordHistory = 0;
}
else
{
RequestedPolicy->PasswordHistory = _wtoi(PasswordHistoryValue->Text->Data());
}
if (MaxPasswordFailedAttemptsValue == nullptr || MaxPasswordFailedAttemptsValue->Text == "")
{
RequestedPolicy->MaxPasswordFailedAttempts = 0;
}
else
{
RequestedPolicy->MaxPasswordFailedAttempts = _wtoi(MaxPasswordFailedAttemptsValue->Text->Data());
}
TimeSpan Inactiveseconds;
if (MaxInactivityTimeLockValue == nullptr || MaxInactivityTimeLockValue->Text == "")
{
Inactiveseconds.Duration = 0;
RequestedPolicy->MaxInactivityTimeLock = Inactiveseconds;
}
else
{
Inactiveseconds.Duration = _wtoi(MaxInactivityTimeLockValue->Text->Data()) * 1000;
RequestedPolicy->MaxInactivityTimeLock = Inactiveseconds;
}
EasComplianceResults^ CheckResult = RequestedPolicy->CheckCompliance();
RequireEncryptionResult->Text = CheckResult->RequireEncryptionResult.ToString();
EncryptionProviderTypeResult->Text = CheckResult->EncryptionProviderType.ToString();
MinPasswordLengthResult->Text = CheckResult->MinPasswordLengthResult.ToString();
DisallowConvenienceLogonResult->Text = CheckResult->DisallowConvenienceLogonResult.ToString();
MinPasswordComplexCharactersResult->Text = CheckResult->MinPasswordComplexCharactersResult.ToString();
PasswordExpirationResult->Text = CheckResult->PasswordExpirationResult.ToString();
PasswordHistoryResult->Text = CheckResult->PasswordHistoryResult.ToString();
MaxPasswordFailedAttemptsResult->Text = CheckResult->MaxPasswordFailedAttemptsResult.ToString();
MaxInactivityTimeLockResult->Text = CheckResult->MaxInactivityTimeLockResult.ToString();
}
catch (Platform::Exception^ ex)
{
MainPage::Current->NotifyUser(ex->Message, NotifyType::ErrorMessage);
}
}
void Scenario2_CheckCompliance::Reset_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
try
{
RequireEncryptionValue->SelectedIndex = 0;
MinPasswordLengthValue->Text = "";
DisallowConvenienceLogonValue->SelectedIndex = 0;
MinPasswordComplexCharactersValue->Text = "";
PasswordExpirationValue->Text = "";
PasswordHistoryValue->Text = "";
MaxPasswordFailedAttemptsValue->Text = "";
MaxInactivityTimeLockValue->Text = "";
RequireEncryptionResult->Text = "";
EncryptionProviderTypeResult->Text = "";
MinPasswordLengthResult->Text = "";
DisallowConvenienceLogonResult->Text = "";
MinPasswordComplexCharactersResult->Text = "";
PasswordExpirationResult->Text = "";
PasswordHistoryResult->Text = "";
MaxPasswordFailedAttemptsResult->Text = "";
MaxInactivityTimeLockResult->Text = "";
}
catch (Platform::Exception^ ex)
{
MainPage::Current->NotifyUser(ex->Message, NotifyType::ErrorMessage);
}
}

Просмотреть файл

@ -1,21 +0,0 @@
// Copyright (c) Microsoft. All rights reserved.
#pragma once
#include "Scenario2_CheckCompliance.g.h"
#include "MainPage.xaml.h"
namespace SDKTemplate
{
[Windows::Foundation::Metadata::WebHostHidden]
public ref class Scenario2_CheckCompliance sealed
{
public:
Scenario2_CheckCompliance();
private:
void Launch_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void Reset_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
SDKTemplate::MainPage^ rootPage;
};
}

Просмотреть файл

@ -1,113 +0,0 @@
<!--
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
-->
<Page
x:Class="SDKTemplate.Scenario3_ApplyEASPolicy"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:SDKTemplate"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
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">
This scenario provides an example how mail client setup a device with supplied EAS policies. Mail client can check if current device settings are compliant with EAS policies required by EAS server. If some non-compliance settings can be changed to be compliant, mail client can apply the policy settings to the device.
</TextBlock>
</StackPanel>
<ScrollViewer Grid.Row="1" VerticalScrollMode="Auto" VerticalScrollBarVisibility="Auto">
<StackPanel Orientation="Vertical" VerticalAlignment="Top">
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="RequireEncryption (True/False)" Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<ComboBox x:Name="RequireEncryptionValue" Margin="0,0,10,0" Width="115" SelectedIndex="0">
<ComboBoxItem Content="False"/>
<ComboBoxItem Content="True" />
</ComboBox>
<TextBox x:Name="RequireEncryptionResult" Width="155" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="MinPasswordLength (0-16) " Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<TextBox x:Name="MinPasswordLengthValue" Margin="0,0,10,0" Width="115"/>
<TextBox x:Name="MinPasswordLengthResult" Width="155" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="DisallowConvenienceLogon (True/False) " Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<ComboBox x:Name="DisallowConvenienceLogonValue" Margin="0,0,10,0" Width="115" SelectedIndex="0">
<ComboBoxItem Content="False"/>
<ComboBoxItem Content="True"/>
</ComboBox>
<TextBox x:Name="DisallowConvenienceLogonResult" Width="155" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="MinPasswordComplexCharacters (0-4) " Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<TextBox x:Name="MinPasswordComplexCharactersValue" Margin="0,0,10,0" Width="115"/>
<TextBox x:Name="MinPasswordComplexCharactersResult" Width="155" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="PasswordExpiration (0-999 days)" Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<TextBox x:Name="PasswordExpirationValue" Margin="0,0,10,0" Width="115"/>
<TextBox x:Name="PasswordExpirationResult" Width="155" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="PasswordHistory (0-24) " Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<TextBox x:Name="PasswordHistoryValue" Margin="0,0,10,0" Width="115"/>
<TextBox x:Name="PasswordHistoryResult" Width="155" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="MaxPasswordFailedAttempts (0, 4-999)" Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<TextBox x:Name="MaxPasswordFailedAttemptsValue" Margin="0,0,10,0" Width="115"/>
<TextBox x:Name="MaxPasswordFailedAttemptsResult" Width="155" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="MaxInactivityTimeLock (0-599940 secs)" Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<TextBox x:Name="MaxInactivityTimeLockValue" Margin="0,0,10,0" Width="115"/>
<TextBox x:Name="MaxInactivityTimeLockResult" Width="155" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,15,0,0">
<Button x:Name="Launch" Content="Launch" Margin="0,0,10,0" Width="115" Click="Launch_Click"/>
<Button x:Name="Reset" Content="Reset" Width="115" Click="Reset_Click"/>
</StackPanel>
</StackPanel>
</ScrollViewer>
<!-- 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>
</Page>

Просмотреть файл

@ -1,186 +0,0 @@
// Copyright (c) Microsoft. All rights reserved.
#include "pch.h"
#include "Scenario3_ApplyEASPolicy.xaml.h"
using namespace SDKTemplate;
using namespace Platform;
using namespace concurrency;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
using namespace Windows::Security::ExchangeActiveSyncProvisioning;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::UI::Xaml::Controls::Primitives;
using namespace Windows::UI::Xaml::Data;
using namespace Windows::UI::Xaml::Input;
using namespace Windows::UI::Xaml::Media;
using namespace Windows::UI::Xaml::Navigation;
Scenario3_ApplyEASPolicy::Scenario3_ApplyEASPolicy() : rootPage(MainPage::Current)
{
InitializeComponent();
}
void Scenario3_ApplyEASPolicy::Launch_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
try
{
EasClientSecurityPolicy^ RequestedPolicy = ref new EasClientSecurityPolicy;
if (RequireEncryptionValue == nullptr)
{
RequestedPolicy->RequireEncryption = false;
}
else
{
if (RequireEncryptionValue->SelectedIndex == 1)
{
RequestedPolicy->RequireEncryption = true;
}
else
{
RequestedPolicy->RequireEncryption = false;
}
}
if (MinPasswordLengthValue == nullptr || MinPasswordLengthValue->Text == "")
{
RequestedPolicy->MinPasswordLength = 0;
}
else
{
RequestedPolicy->MinPasswordLength = _wtoi(MinPasswordLengthValue->Text->Data());
}
if (DisallowConvenienceLogonValue == nullptr)
{
RequestedPolicy->DisallowConvenienceLogon = false;
}
else
{
if (DisallowConvenienceLogonValue->SelectedIndex == 1)
{
RequestedPolicy->DisallowConvenienceLogon = true;
}
else
{
RequestedPolicy->DisallowConvenienceLogon = false;
}
}
if (MinPasswordComplexCharactersValue == nullptr || MinPasswordComplexCharactersValue->Text == "")
{
RequestedPolicy->MinPasswordComplexCharacters = 0;
}
else
{
RequestedPolicy->MinPasswordComplexCharacters = _wtoi(MinPasswordComplexCharactersValue->Text->Data());
}
TimeSpan ExpirationDays;
if (PasswordExpirationValue == nullptr || PasswordExpirationValue->Text == "")
{
ExpirationDays.Duration = 0;
RequestedPolicy->PasswordExpiration = ExpirationDays;
}
else
{
ExpirationDays.Duration = _wtoi(PasswordExpirationValue->Text->Data()) * 86400000;
RequestedPolicy->PasswordExpiration = ExpirationDays;
}
if (PasswordHistoryValue == nullptr || PasswordHistoryValue->Text == "")
{
RequestedPolicy->PasswordHistory = 0;
}
else
{
RequestedPolicy->PasswordHistory = _wtoi(PasswordHistoryValue->Text->Data());
}
if (MaxPasswordFailedAttemptsValue == nullptr || MaxPasswordFailedAttemptsValue->Text == "")
{
RequestedPolicy->MaxPasswordFailedAttempts = 0;
}
else
{
RequestedPolicy->MaxPasswordFailedAttempts = _wtoi(MaxPasswordFailedAttemptsValue->Text->Data());
}
TimeSpan Inactiveseconds;
if (MaxInactivityTimeLockValue == nullptr || MaxInactivityTimeLockValue->Text == "")
{
Inactiveseconds.Duration = 0;
RequestedPolicy->MaxInactivityTimeLock = Inactiveseconds;
}
else
{
Inactiveseconds.Duration = _wtoi(MaxInactivityTimeLockValue->Text->Data()) * 1000;
RequestedPolicy->MaxInactivityTimeLock = Inactiveseconds;
}
task<EasComplianceResults^> ApplyOp(RequestedPolicy->ApplyAsync());
ApplyOp.then([=](task<EasComplianceResults^> resultTask)
{
try
{
auto results = resultTask.get();
RequireEncryptionResult->Text = results->RequireEncryptionResult.ToString();
MinPasswordLengthResult->Text = results->MinPasswordLengthResult.ToString();
DisallowConvenienceLogonResult->Text = results->DisallowConvenienceLogonResult.ToString();
MinPasswordComplexCharactersResult->Text = results->MinPasswordComplexCharactersResult.ToString();
PasswordExpirationResult->Text = results->PasswordExpirationResult.ToString();
PasswordHistoryResult->Text = results->PasswordHistoryResult.ToString();
MaxPasswordFailedAttemptsResult->Text = results->MaxPasswordFailedAttemptsResult.ToString();
MaxInactivityTimeLockResult->Text = results->MaxInactivityTimeLockResult.ToString();
}
catch (Platform::Exception^ ex)
{
// ignore that 0x800704C7 exception
if (ex->HResult != 0x800704C7)
{
MainPage::Current->NotifyUser(ex->Message, NotifyType::ErrorMessage);
}
}
});
}
catch (Platform::Exception^ ex)
{
MainPage::Current->NotifyUser(ex->Message, NotifyType::ErrorMessage);
}
}
void Scenario3_ApplyEASPolicy::Reset_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
try
{
RequireEncryptionValue->SelectedIndex = 0;
MinPasswordLengthValue->Text = "";
DisallowConvenienceLogonValue->SelectedIndex = 0;
MinPasswordComplexCharactersValue->Text = "";
PasswordExpirationValue->Text = "";
PasswordHistoryValue->Text = "";
MaxPasswordFailedAttemptsValue->Text = "";
MaxInactivityTimeLockValue->Text = "";
RequireEncryptionResult->Text = "";
MinPasswordLengthResult->Text = "";
DisallowConvenienceLogonResult->Text = "";
MinPasswordComplexCharactersResult->Text = "";
PasswordExpirationResult->Text = "";
PasswordHistoryResult->Text = "";
MaxPasswordFailedAttemptsResult->Text = "";
MaxInactivityTimeLockResult->Text = "";
}
catch (Platform::Exception^ ex)
{
MainPage::Current->NotifyUser(ex->Message, NotifyType::ErrorMessage);
}
}

Просмотреть файл

@ -1,21 +0,0 @@
// Copyright (c) Microsoft. All rights reserved.
#pragma once
#include "Scenario3_ApplyEASPolicy.g.h"
#include "MainPage.xaml.h"
namespace SDKTemplate
{
[Windows::Foundation::Metadata::WebHostHidden]
public ref class Scenario3_ApplyEASPolicy sealed
{
public:
Scenario3_ApplyEASPolicy();
private:
void Launch_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void Reset_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
SDKTemplate::MainPage^ rootPage;
};
}

Просмотреть файл

@ -1,119 +0,0 @@
<!--
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
-->
<Page
x:Class="EAS.Scenario2_CheckCompliance"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:EAS"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
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">
This scenario provides an example how mail client provision a device with supplied EAS policies. Mail client can check if current device settings are compliant with EAS policies required by EAS server.
</TextBlock>
</StackPanel>
<ScrollViewer Grid.Row="1" VerticalScrollMode="Auto" VerticalScrollBarVisibility="Auto">
<StackPanel Orientation="Vertical" VerticalAlignment="Top">
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="RequireEncryption (True/False)" Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<ComboBox x:Name="RequireEncryptionValue" Margin="0,0,10,0" Width="115" SelectedIndex="0">
<ComboBoxItem Content="False"/>
<ComboBoxItem Content="True" />
</ComboBox>
<TextBox x:Name="RequireEncryptionResult" Width="155" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="MinPasswordLength (0-16) " Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<TextBox x:Name="MinPasswordLengthValue" Margin="0,0,10,0" Width="115"/>
<TextBox x:Name="MinPasswordLengthResult" Width="155" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="DisallowConvenienceLogon (True/False) " Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<ComboBox x:Name="DisallowConvenienceLogonValue" Margin="0,0,10,0" Width="115" SelectedIndex="0">
<ComboBoxItem Content="False"/>
<ComboBoxItem Content="True"/>
</ComboBox>
<TextBox x:Name="DisallowConvenienceLogonResult" Width="155" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="MinPasswordComplexCharacters (0-4) " Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<TextBox x:Name="MinPasswordComplexCharactersValue" Margin="0,0,10,0" Width="115"/>
<TextBox x:Name="MinPasswordComplexCharactersResult" Width="155" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="PasswordExpiration (0-999 days)" Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<TextBox x:Name="PasswordExpirationValue" Margin="0,0,10,0" Width="115"/>
<TextBox x:Name="PasswordExpirationResult" Width="155" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="PasswordHistory (0-24) " Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<TextBox x:Name="PasswordHistoryValue" Margin="0,0,10,0" Width="115"/>
<TextBox x:Name="PasswordHistoryResult" Width="155" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="MaxPasswordFailedAttempts (0, 4-999)" Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<TextBox x:Name="MaxPasswordFailedAttemptsValue" Margin="0,0,10,0" Width="115"/>
<TextBox x:Name="MaxPasswordFailedAttemptsResult" Width="155" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="MaxInactivityTimeLock (0-599940 secs)" Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<TextBox x:Name="MaxInactivityTimeLockValue" Margin="0,0,10,0" Width="115"/>
<TextBox x:Name="MaxInactivityTimeLockResult" Width="155" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="EncryptionProviderType" Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<TextBox x:Name="EncryptionProviderTypeResult" Width="280" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,15,0,0">
<Button x:Name="Launch" Content="Launch" Margin="0,0,10,0" Width="115" Click="Launch_Click"/>
<Button x:Name="Reset" Content="Reset" Width="115" Click="Reset_Click"/>
</StackPanel>
</StackPanel>
</ScrollViewer>
<!-- 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>
</Page>

Просмотреть файл

@ -1,161 +0,0 @@
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
using SDKTemplate;
using System;
using Windows.Security.ExchangeActiveSyncProvisioning;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
namespace EAS
{
public sealed partial class Scenario2_CheckCompliance : Page
{
MainPage rootPage = MainPage.Current;
public Scenario2_CheckCompliance()
{
this.InitializeComponent();
}
private void Launch_Click(object sender, RoutedEventArgs e)
{
try
{
EasClientSecurityPolicy RequestedPolicy = new EasClientSecurityPolicy();
EasComplianceResults ComplianceResult = null;
if (RequireEncryptionValue == null)
{
RequestedPolicy.RequireEncryption = false;
}
else
{
if (RequireEncryptionValue.SelectedIndex == 1)
{
RequestedPolicy.RequireEncryption = true;
}
else
{
RequestedPolicy.RequireEncryption = false;
}
}
if (MinPasswordLengthValue == null || MinPasswordLengthValue.Text.Length == 0)
{
RequestedPolicy.MinPasswordLength = 0;
}
else
{
RequestedPolicy.MinPasswordLength = Convert.ToByte(MinPasswordLengthValue.Text);
}
if (DisallowConvenienceLogonValue == null)
{
RequestedPolicy.DisallowConvenienceLogon = false;
}
else
{
if (DisallowConvenienceLogonValue.SelectedIndex == 1)
{
RequestedPolicy.DisallowConvenienceLogon = true;
}
else
{
RequestedPolicy.DisallowConvenienceLogon = false;
}
}
if (MinPasswordComplexCharactersValue == null || MinPasswordComplexCharactersValue.Text.Length == 0)
{
RequestedPolicy.MinPasswordComplexCharacters = 0;
}
else
{
RequestedPolicy.MinPasswordComplexCharacters = Convert.ToByte(MinPasswordComplexCharactersValue.Text);
}
if (PasswordExpirationValue == null || PasswordExpirationValue.Text.Length == 0)
{
RequestedPolicy.PasswordExpiration = TimeSpan.Parse("0");
}
else
{
RequestedPolicy.PasswordExpiration = TimeSpan.FromDays(Convert.ToDouble(PasswordExpirationValue.Text));
}
if (PasswordHistoryValue == null || PasswordHistoryValue.Text.Length == 0)
{
RequestedPolicy.PasswordHistory = 0;
}
else
{
RequestedPolicy.PasswordHistory = Convert.ToByte(PasswordHistoryValue.Text);
}
if (MaxPasswordFailedAttemptsValue == null || MaxPasswordFailedAttemptsValue.Text.Length == 0)
{
RequestedPolicy.MaxPasswordFailedAttempts = 0;
}
else
{
RequestedPolicy.MaxPasswordFailedAttempts = Convert.ToByte(MaxPasswordFailedAttemptsValue.Text);
}
if (MaxInactivityTimeLockValue == null || MaxInactivityTimeLockValue.Text.Length == 0)
{
RequestedPolicy.MaxInactivityTimeLock = TimeSpan.Parse("0");
}
else
{
RequestedPolicy.MaxInactivityTimeLock = TimeSpan.FromSeconds(Convert.ToDouble(MaxInactivityTimeLockValue.Text));
}
ComplianceResult = RequestedPolicy.CheckCompliance();
RequireEncryptionResult.Text = ComplianceResult.RequireEncryptionResult.ToString();
EncryptionProviderTypeResult.Text = ComplianceResult.EncryptionProviderType.ToString();
MinPasswordLengthResult.Text = ComplianceResult.MinPasswordLengthResult.ToString();
DisallowConvenienceLogonResult.Text = ComplianceResult.DisallowConvenienceLogonResult.ToString();
MinPasswordComplexCharactersResult.Text = ComplianceResult.MinPasswordComplexCharactersResult.ToString();
PasswordExpirationResult.Text = ComplianceResult.PasswordExpirationResult.ToString();
PasswordHistoryResult.Text = ComplianceResult.PasswordHistoryResult.ToString();
MaxPasswordFailedAttemptsResult.Text = ComplianceResult.MaxPasswordFailedAttemptsResult.ToString();
MaxInactivityTimeLockResult.Text = ComplianceResult.MaxInactivityTimeLockResult.ToString();
}
catch (Exception Error)
{
rootPage.NotifyUser(Error.Message, NotifyType.ErrorMessage);
}
}
private void Reset_Click(object sender, RoutedEventArgs e)
{
RequireEncryptionValue.SelectedIndex = 0;
MinPasswordLengthValue.Text = "";
DisallowConvenienceLogonValue.SelectedIndex = 0;
MinPasswordComplexCharactersValue.Text = "";
PasswordExpirationValue.Text = "";
PasswordHistoryValue.Text = "";
MaxPasswordFailedAttemptsValue.Text = "";
MaxInactivityTimeLockValue.Text = "";
RequireEncryptionResult.Text = "";
EncryptionProviderTypeResult.Text = "";
MinPasswordLengthResult.Text = "";
DisallowConvenienceLogonResult.Text = "";
MinPasswordComplexCharactersResult.Text = "";
PasswordExpirationResult.Text = "";
PasswordHistoryResult.Text = "";
MaxPasswordFailedAttemptsResult.Text = "";
MaxInactivityTimeLockResult.Text = "";
}
}
}

Просмотреть файл

@ -1,113 +0,0 @@
<!--
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
-->
<Page
x:Class="EAS.Scenario3_ApplyEASPolicy"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:EAS"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
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">
This scenario provides an example how mail client setup a device with supplied EAS policies. Mail client can check if current device settings are compliant with EAS policies required by EAS server. If some non-compliance settings can be changed to be compliant, mail client can apply the policy settings to the device.
</TextBlock>
</StackPanel>
<ScrollViewer Grid.Row="1" VerticalScrollMode="Auto" VerticalScrollBarVisibility="Auto">
<StackPanel Orientation="Vertical" VerticalAlignment="Top">
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="RequireEncryption (True/False)" Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<ComboBox x:Name="RequireEncryptionValue" Margin="0,0,10,0" Width="115" SelectedIndex="0">
<ComboBoxItem Content="False"/>
<ComboBoxItem Content="True" />
</ComboBox>
<TextBox x:Name="RequireEncryptionResult" Width="155" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="MinPasswordLength (0-16) " Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<TextBox x:Name="MinPasswordLengthValue" Margin="0,0,10,0" Width="115"/>
<TextBox x:Name="MinPasswordLengthResult" Width="155" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="DisallowConvenienceLogon (True/False) " Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<ComboBox x:Name="DisallowConvenienceLogonValue" Margin="0,0,10,0" Width="115" SelectedIndex="0">
<ComboBoxItem Content="False"/>
<ComboBoxItem Content="True"/>
</ComboBox>
<TextBox x:Name="DisallowConvenienceLogonResult" Width="155" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="MinPasswordComplexCharacters (0-4) " Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<TextBox x:Name="MinPasswordComplexCharactersValue" Margin="0,0,10,0" Width="115"/>
<TextBox x:Name="MinPasswordComplexCharactersResult" Width="155" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="PasswordExpiration (0-999 days)" Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<TextBox x:Name="PasswordExpirationValue" Margin="0,0,10,0" Width="115"/>
<TextBox x:Name="PasswordExpirationResult" Width="155" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="PasswordHistory (0-24) " Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<TextBox x:Name="PasswordHistoryValue" Margin="0,0,10,0" Width="115"/>
<TextBox x:Name="PasswordHistoryResult" Width="155" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="MaxPasswordFailedAttempts (0, 4-999)" Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<TextBox x:Name="MaxPasswordFailedAttemptsValue" Margin="0,0,10,0" Width="115"/>
<TextBox x:Name="MaxPasswordFailedAttemptsResult" Width="155" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,10,0,0">
<TextBlock Text="MaxInactivityTimeLock (0-599940 secs)" Style="{StaticResource BasicTextStyle}"/>
<StackPanel Orientation="Horizontal">
<TextBox x:Name="MaxInactivityTimeLockValue" Margin="0,0,10,0" Width="115"/>
<TextBox x:Name="MaxInactivityTimeLockResult" Width="155" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,15,0,0">
<Button x:Name="Launch" Content="Launch" Margin="0,0,10,0" Width="115" Click="Launch_Click"/>
<Button x:Name="Reset" Content="Reset" Width="115" Click="Reset_Click"/>
</StackPanel>
</StackPanel>
</ScrollViewer>
<!-- 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>
</Page>

Просмотреть файл

@ -1,154 +0,0 @@
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using SDKTemplate;
using System;
using Windows.Security.ExchangeActiveSyncProvisioning;
namespace EAS
{
public sealed partial class Scenario3_ApplyEASPolicy : Page
{
MainPage rootPage = MainPage.Current;
public Scenario3_ApplyEASPolicy()
{
this.InitializeComponent();
}
private async void Launch_Click(object sender, RoutedEventArgs e)
{
try
{
EasClientSecurityPolicy RequestedPolicy = new EasClientSecurityPolicy();
if (RequireEncryptionValue == null)
{
RequestedPolicy.RequireEncryption = false;
}
else
{
if (RequireEncryptionValue.SelectedIndex == 1)
{
RequestedPolicy.RequireEncryption = true;
}
else
{
RequestedPolicy.RequireEncryption = false;
}
}
if (MinPasswordLengthValue == null || MinPasswordLengthValue.Text.Length == 0)
{
RequestedPolicy.MinPasswordLength = 0;
}
else
{
RequestedPolicy.MinPasswordLength = Convert.ToByte(MinPasswordLengthValue.Text);
}
if (DisallowConvenienceLogonValue == null)
{
RequestedPolicy.DisallowConvenienceLogon = false;
}
else
{
if (DisallowConvenienceLogonValue.SelectedIndex == 1)
RequestedPolicy.DisallowConvenienceLogon = true;
else
RequestedPolicy.DisallowConvenienceLogon = false;
}
if (MinPasswordComplexCharactersValue == null || MinPasswordComplexCharactersValue.Text.Length == 0)
{
RequestedPolicy.MinPasswordComplexCharacters = 0;
}
else
{
RequestedPolicy.MinPasswordComplexCharacters = Convert.ToByte(MinPasswordComplexCharactersValue.Text);
}
if (PasswordExpirationValue == null || PasswordExpirationValue.Text.Length == 0)
{
RequestedPolicy.PasswordExpiration = TimeSpan.Parse("0");
}
else
{
RequestedPolicy.PasswordExpiration = TimeSpan.FromDays(Convert.ToDouble(PasswordExpirationValue.Text));
}
if (PasswordHistoryValue == null || PasswordHistoryValue.Text.Length == 0)
{
RequestedPolicy.PasswordHistory = 0;
}
else
{
RequestedPolicy.PasswordHistory = Convert.ToByte(PasswordHistoryValue.Text);
}
if (MaxPasswordFailedAttemptsValue == null || MaxPasswordFailedAttemptsValue.Text.Length == 0)
{
RequestedPolicy.MaxPasswordFailedAttempts = 0;
}
else
{
RequestedPolicy.MaxPasswordFailedAttempts = Convert.ToByte(MaxPasswordFailedAttemptsValue.Text);
}
if (MaxInactivityTimeLockValue == null || MaxInactivityTimeLockValue.Text.Length == 0)
{
RequestedPolicy.MaxInactivityTimeLock = TimeSpan.Parse("0");
}
else
{
RequestedPolicy.MaxInactivityTimeLock = TimeSpan.FromSeconds(Convert.ToDouble(MaxInactivityTimeLockValue.Text));
}
EasComplianceResults ApplyResult = await RequestedPolicy.ApplyAsync();
RequireEncryptionResult.Text = ApplyResult.RequireEncryptionResult.ToString();
MinPasswordLengthResult.Text = ApplyResult.MinPasswordLengthResult.ToString();
DisallowConvenienceLogonResult.Text = ApplyResult.DisallowConvenienceLogonResult.ToString();
MinPasswordComplexCharactersResult.Text = ApplyResult.MinPasswordComplexCharactersResult.ToString();
PasswordExpirationResult.Text = ApplyResult.PasswordExpirationResult.ToString();
PasswordHistoryResult.Text = ApplyResult.PasswordHistoryResult.ToString();
MaxPasswordFailedAttemptsResult.Text = ApplyResult.MaxPasswordFailedAttemptsResult.ToString();
MaxInactivityTimeLockResult.Text = ApplyResult.MaxInactivityTimeLockResult.ToString();
}
catch (Exception Error)
{
rootPage.NotifyUser(Error.Message, NotifyType.ErrorMessage);
}
}
private void Reset_Click(object sender, RoutedEventArgs e)
{
RequireEncryptionValue.SelectedIndex = 0;
MinPasswordLengthValue.Text = "";
DisallowConvenienceLogonValue.SelectedIndex = 0;
MinPasswordComplexCharactersValue.Text = "";
PasswordExpirationValue.Text = "";
PasswordHistoryValue.Text = "";
MaxPasswordFailedAttemptsValue.Text = "";
MaxInactivityTimeLockValue.Text = "";
RequireEncryptionResult.Text = "";
MinPasswordLengthResult.Text = "";
DisallowConvenienceLogonResult.Text = "";
MinPasswordComplexCharactersResult.Text = "";
PasswordExpirationResult.Text = "";
PasswordHistoryResult.Text = "";
MaxPasswordFailedAttemptsResult.Text = "";
MaxInactivityTimeLockResult.Text = "";
}
}
}

Просмотреть файл

@ -1,150 +0,0 @@
<!--
Copyright (c) Microsoft Corporation. All rights reserved
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="/js/scenario2.js"></script>
</head>
<body class="win-type-body">
<div id="scenarioView">
<div>
<h2 id="sampleHeader" class="win-type-subheader">Description:</h2>
<div id="scenarioDescription">
<p>This scenario provides an example of how a mail client provisions a device with supplied EAS policies. The client can check if the current device settings are compliant with EAS policies required by the EAS server.</p>
</div>
</div>
<div id="scenarioContent">
<table class="InputTable">
<tr>
<td class="label" colspan="2">
<label for="RequireEncryption">RequireEncryption (True/False):</label>
</td>
</tr>
<tr>
<td class="input">
<input type="checkbox" size="30" id="RequireEncryptionValue" class="win-checkbox">
</td>
<td class="output">
<input type="text" size="30" id="RequireEncryptionComplianceResult" disabled="disabled" class="win-textbox">
</td>
</tr>
<tr>
<td class="label" colspan="2">
<label for="MinPasswordLength">MinPasswordLength (0-16):</label>
</td>
</tr>
<tr>
<td class="input">
<input type="text" size="30" id="MinPasswordLengthValue" class="win-textbox">
</td>
<td class="output">
<input type="text" size="30" id="MinPasswordLengthComplianceResult" disabled="disabled" class="win-textbox">
</td>
</tr>
<tr>
<td class="label" colspan="2">
<label for="DisallowConvenienceLogon">DisallowConvenienceLogon (True/False):</label>
</td>
</tr>
<tr>
<td class="input">
<input type="checkbox" size="30" id="DisallowConvenienceLogonValue" class="win-checkbox">
</td>
<td class="output">
<input type="text" size="30" id="DisallowConvenienceLogonComplianceResult" disabled="disabled" class="win-textbox">
</td>
</tr>
<tr>
<td class="label" colspan="2">
<label for="MinPasswordComplexCharacters">MinPasswordComplexCharacters (0-4):</label>
</td>
</tr>
<tr>
<td class="input">
<input type="text" size="30" id="MinPasswordComplexCharactersValue" class="win-textbox">
</td>
<td class="output">
<input type="text" size="30" id="MinPasswordComplexCharactersComplianceResult" disabled="disabled" class="win-textbox">
</td>
</tr>
<tr>
<td class="label" colspan="2">
<label for="PasswordExpiration">PasswordExpiration (0-999 days): </label>
</td>
</tr>
<tr>
<td class="input">
<input type="text" size="30" id="PasswordExpirationValue" class="win-textbox">
</td>
<td class="output">
<input type="text" size="30" id="PasswordExpirationComplianceResult" disabled="disabled" class="win-textbox">
</td>
</tr>
<tr>
<td class="label" colspan="2">
<label for="PasswordHistory">PasswordHistory (0-24): </label>
</td>
</tr>
<tr>
<td class="input">
<input type="text" size="30" id="PasswordHistoryValue" class="win-textbox">
</td>
<td class="output">
<input type="text" size="30" id="PasswordHistoryComplianceResult" disabled="disabled" class="win-textbox">
</td>
</tr>
<tr>
<td class="label" colspan="2">
<label for="MaxPasswordFailedAttempts">MaxPasswordFailedAttempts (0, 4-999): </label>
</td>
</tr>
<tr>
<td class="input">
<input type="text" size="30" id="MaxPasswordFailedAttemptsValue" class="win-textbox">
</td>
<td class="output">
<input type="text" size="30" id="MaxPasswordFailedAttemptsComplianceResult" disabled="disabled" class="win-textbox">
</td>
</tr>
<tr>
<td class="label" colspan="2">
<label for="MaxInactivityTimeLock">MaxInactivityTimeLock (0-599940 secs): </label>
</td>
</tr>
<tr>
<td class="input">
<input type="text" size="30" id="MaxInactivityTimeLockValue" class="win-textbox">
</td>
<td class="output">
<input type="text" size="30" id="MaxInactivityTimeLockComplianceResult" disabled="disabled" class="win-textbox">
</td>
</tr>
<tr>
<td class="label" colspan="2">
<label for="EncryptionProviderType">Encryption Provider Type:</label>
</td>
</tr>
<tr>
<td class="output" colspan="2">
<input type="text" size="60" id="EncryptionProviderTypeComplianceResult" disabled="disabled" class="win-textbox">
</td>
</tr>
<tr>
<td>
<button class="action win-button" id="CheckComplianceLaunch" style="width:100%">Check Compliance</button>
</td>
<td>
<button class="action win-button" id="CheckComplianceReset" style="width:100%">Reset</button>
</td>
</tr>
</table>
</div>
</div>
</body>
</html>

Просмотреть файл

@ -1,140 +0,0 @@
<!--
Copyright (c) Microsoft Corporation. All rights reserved
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="/js/scenario3.js"></script>
</head>
<body class="win-type-body">
<div id="scenarioView">
<div>
<h2 id="sampleHeader" class="win-type-subheader">Description:</h2>
<div id="scenarioDescription">
<p>This scenario provides an example of how a mail client sets up a device with supplied EAS policies. The client can check if the current device settings are compliant with EAS policies required by the EAS server.</p>
</div>
</div>
<div id="scenarioContent">
<table class="InputTable">
<tr>
<td class="label" colspan="2">
<label for="RequireEncryption">RequireEncryption (True/False):</label>
</td>
</tr>
<tr>
<td class="input">
<input type="checkbox" size="30" id="RequireEncryptionValue" class="win-checkbox">
</td>
<td class="output">
<input type="text" size="30" id="RequireEncryptionComplianceResult" disabled="disabled" class="win-textbox">
</td>
</tr>
<tr>
<td class="label" colspan="2">
<label for="MinPasswordLength">MinPasswordLength (0-16):</label>
</td>
</tr>
<tr>
<td class="input">
<input type="text" size="30" id="MinPasswordLengthValue" class="win-textbox">
</td>
<td class="output">
<input type="text" size="30" id="MinPasswordLengthComplianceResult" disabled="disabled" class="win-textbox">
</td>
</tr>
<tr>
<td class="label" colspan="2">
<label for="DisallowConvenienceLogon">DisallowConvenienceLogon (True/False):</label>
</td>
</tr>
<tr>
<td class="input">
<input type="checkbox" size="30" id="DisallowConvenienceLogonValue" class="win-checkbox">
</td>
<td class="output">
<input type="text" size="30" id="DisallowConvenienceLogonComplianceResult" disabled="disabled" class="win-textbox">
</td>
</tr>
<tr>
<td class="label" colspan="2">
<label for="MinPasswordComplexCharacters">MinPasswordComplexCharacters (0-4):</label>
</td>
</tr>
<tr>
<td class="input">
<input type="text" size="30" id="MinPasswordComplexCharactersValue" class="win-textbox">
</td>
<td class="output">
<input type="text" size="30" id="MinPasswordComplexCharactersComplianceResult" disabled="disabled" class="win-textbox">
</td>
</tr>
<tr>
<td class="label" colspan="2">
<label for="PasswordExpiration">PasswordExpiration (0-999 days): </label>
</td>
</tr>
<tr>
<td class="input">
<input type="text" size="30" id="PasswordExpirationValue" class="win-textbox">
</td>
<td class="output">
<input type="text" size="30" id="PasswordExpirationComplianceResult" disabled="disabled" class="win-textbox">
</td>
</tr>
<tr>
<td class="label" colspan="2">
<label for="PasswordHistory">PasswordHistory (0-24): </label>
</td>
</tr>
<tr>
<td class="input">
<input type="text" size="30" id="PasswordHistoryValue" class="win-textbox">
</td>
<td class="output">
<input type="text" size="30" id="PasswordHistoryComplianceResult" disabled="disabled" class="win-textbox">
</td>
</tr>
<tr>
<td class="label" colspan="2">
<label for="MaxPasswordFailedAttempts">MaxPasswordFailedAttempts (0, 4-999): </label>
</td>
</tr>
<tr>
<td class="input">
<input type="text" size="30" id="MaxPasswordFailedAttemptsValue" class="win-textbox">
</td>
<td class="output">
<input type="text" size="30" id="MaxPasswordFailedAttemptsComplianceResult" disabled="disabled" class="win-textbox">
</td>
</tr>
<tr>
<td class="label" colspan="2">
<label for="MaxInactivityTimeLock">MaxInactivityTimeLock (0-599940 secs): </label>
</td>
</tr>
<tr>
<td class="input">
<input type="text" size="30" id="MaxInactivityTimeLockValue" class="win-textbox">
</td>
<td class="output">
<input type="text" size="30" id="MaxInactivityTimeLockComplianceResult" disabled="disabled" class="win-textbox">
</td>
</tr>
<tr>
<td>
<button class="action win-button" id="ApplyAsyncLaunch" style="width:100%">Apply</button>
</td>
<td>
<button class="action win-button" id="ApplyAsyncReset" style="width:100%">Reset</button>
</td>
</tr>
</table>
</div>
</div>
</body>
</html>

Просмотреть файл

@ -1,120 +0,0 @@
//// Copyright (c) Microsoft Corporation. All rights reserved
(function () {
"use strict";
var page = WinJS.UI.Pages.define("/html/scenario2.html", {
ready: function (element, options) {
document.getElementById("CheckComplianceLaunch").addEventListener("click", checkCompliance, false);
document.getElementById("CheckComplianceReset").addEventListener("click", checkComplianceReset, false);
}
});
function checkCompliance() {
// Get all the parameters from the user
var requireEncryptionValue = document.getElementById("RequireEncryptionValue").checked;
if (!requireEncryptionValue) {
requireEncryptionValue = false;
}
var minPasswordLengthValue = document.getElementById("MinPasswordLengthValue").value;
if (minPasswordLengthValue === null || minPasswordLengthValue === "") {
minPasswordLengthValue = 0;
}
var disallowConvenienceLogonValue = document.getElementById("DisallowConvenienceLogonValue").checked;
if (!disallowConvenienceLogonValue) {
disallowConvenienceLogonValue = false;
}
var minPasswordComplexCharactersValue = document.getElementById("MinPasswordComplexCharactersValue").value;
if (minPasswordComplexCharactersValue === null || minPasswordComplexCharactersValue === "") {
minPasswordComplexCharactersValue = 0;
}
var passwordExpirationValue = document.getElementById("PasswordExpirationValue").value;
if (passwordExpirationValue === null || passwordExpirationValue === "") {
passwordExpirationValue = 0;
}
var passwordHistoryValue = document.getElementById("PasswordHistoryValue").value;
if (passwordHistoryValue === null || passwordHistoryValue === "") {
passwordHistoryValue = 0;
}
var maxPasswordFailedAttemptsValue = document.getElementById("MaxPasswordFailedAttemptsValue").value;
if (maxPasswordFailedAttemptsValue === null || maxPasswordFailedAttemptsValue === "") {
maxPasswordFailedAttemptsValue = 0;
}
var maxInactivityTimeLockValue = document.getElementById("MaxInactivityTimeLockValue").value;
if (maxInactivityTimeLockValue === null || maxInactivityTimeLockValue === "") {
maxInactivityTimeLockValue = 0;
}
try {
var requestedPolicy = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientSecurityPolicy();
requestedPolicy.requireEncryption = requireEncryptionValue;
requestedPolicy.minPasswordLength = parseInt(minPasswordLengthValue);
requestedPolicy.disallowConvenienceLogon = disallowConvenienceLogonValue;
requestedPolicy.minPasswordComplexCharacters = parseInt(minPasswordComplexCharactersValue);
requestedPolicy.passwordExpiration = parseInt(passwordExpirationValue) * 86400000;
requestedPolicy.maxPasswordFailedAttempts = parseInt(maxPasswordFailedAttemptsValue);
requestedPolicy.maxInactivityTimeLock = parseInt(maxInactivityTimeLockValue) * 1000;
var complianceResult = requestedPolicy.checkCompliance();
document.getElementById("RequireEncryptionComplianceResult").value = complianceResult.requireEncryptionResult;
document.getElementById("EncryptionProviderTypeComplianceResult").value = complianceResult.encryptionProviderType;
document.getElementById("MinPasswordLengthComplianceResult").value = complianceResult.minPasswordLengthResult;
document.getElementById("DisallowConvenienceLogonComplianceResult").value = complianceResult.disallowConvenienceLogonResult;
document.getElementById("MinPasswordComplexCharactersComplianceResult").value = complianceResult.minPasswordComplexCharactersResult;
document.getElementById("PasswordExpirationComplianceResult").value = complianceResult.passwordExpirationResult;
document.getElementById("PasswordHistoryComplianceResult").value = complianceResult.passwordHistoryResult;
document.getElementById("MaxPasswordFailedAttemptsComplianceResult").value = complianceResult.maxPasswordFailedAttemptsResult;
document.getElementById("MaxInactivityTimeLockComplianceResult").value = complianceResult.maxInactivityTimeLockResult;
} catch (err) {
WinJS.log("Error CheckCompliance: " + err.message, "EAS SDK Sample", "error");
return;
}
}
function checkComplianceReset() {
// Get all the result reset
try {
document.getElementById("RequireEncryptionValue").checked = false;
document.getElementById("MinPasswordLengthValue").value = "";
document.getElementById("DisallowConvenienceLogonValue").checked = false;
document.getElementById("MinPasswordComplexCharactersValue").value = "";
document.getElementById("PasswordExpirationValue").value = "";
document.getElementById("PasswordHistoryValue").value = "";
document.getElementById("MaxPasswordFailedAttemptsValue").value = "";
document.getElementById("MaxInactivityTimeLockValue").value = "";
document.getElementById("RequireEncryptionComplianceResult").value = "";
document.getElementById("EncryptionProviderTypeComplianceResult").value = "";
document.getElementById("MinPasswordLengthComplianceResult").value = "";
document.getElementById("DisallowConvenienceLogonComplianceResult").value = "";
document.getElementById("MinPasswordComplexCharactersComplianceResult").value = "";
document.getElementById("PasswordExpirationComplianceResult").value = "";
document.getElementById("PasswordHistoryComplianceResult").value = "";
document.getElementById("MaxPasswordFailedAttemptsComplianceResult").value = "";
document.getElementById("MaxInactivityTimeLockComplianceResult").value = "";
} catch (err) {
WinJS.log("Error reset CheckCompliance: " + err.message, "EAS SDK Sample", "error");
return;
}
}
})();

Просмотреть файл

@ -1,124 +0,0 @@
//// Copyright (c) Microsoft Corporation. All rights reserved
(function () {
"use strict";
var page = WinJS.UI.Pages.define("/html/scenario3.html", {
ready: function (element, options) {
document.getElementById("ApplyAsyncLaunch").addEventListener("click", applyPolicy, false);
document.getElementById("ApplyAsyncReset").addEventListener("click", applyReset, false);
}
});
function applyPolicy() {
// Get all the parameters from the user
var requireEncryptionValue = document.getElementById("RequireEncryptionValue").checked;
if (!requireEncryptionValue) {
requireEncryptionValue = false;
}
var minPasswordLengthValue = document.getElementById("MinPasswordLengthValue").value;
if (minPasswordLengthValue === null || minPasswordLengthValue === "") {
minPasswordLengthValue = 0;
}
var disallowConvenienceLogonValue = document.getElementById("DisallowConvenienceLogonValue").checked;
if (!disallowConvenienceLogonValue) {
disallowConvenienceLogonValue = false;
}
var minPasswordComplexCharactersValue = document.getElementById("MinPasswordComplexCharactersValue").value;
if (minPasswordComplexCharactersValue === null || minPasswordComplexCharactersValue === "") {
minPasswordComplexCharactersValue = 0;
}
var passwordExpirationValue = document.getElementById("PasswordExpirationValue").value;
if (passwordExpirationValue === null || passwordExpirationValue === "") {
passwordExpirationValue = 0;
}
var passwordHistoryValue = document.getElementById("PasswordHistoryValue").value;
if (passwordHistoryValue === null || passwordHistoryValue === "") {
passwordHistoryValue = 0;
}
var maxPasswordFailedAttemptsValue = document.getElementById("MaxPasswordFailedAttemptsValue").value;
if (maxPasswordFailedAttemptsValue === null || maxPasswordFailedAttemptsValue === "") {
maxPasswordFailedAttemptsValue = 0;
}
var maxInactivityTimeLockValue = document.getElementById("MaxInactivityTimeLockValue").value;
if (maxInactivityTimeLockValue === null || maxInactivityTimeLockValue === "") {
maxInactivityTimeLockValue = 0;
}
try {
var requestedPolicy = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientSecurityPolicy();
requestedPolicy.requireEncryption = requireEncryptionValue;
requestedPolicy.minPasswordLength = parseInt(minPasswordLengthValue);
requestedPolicy.disallowConvenienceLogon = disallowConvenienceLogonValue;
requestedPolicy.minPasswordComplexCharacters = parseInt(minPasswordComplexCharactersValue);
requestedPolicy.passwordExpiration = parseInt(passwordExpirationValue) * 86400000;
requestedPolicy.passwordHistory = parseInt(passwordHistoryValue);
requestedPolicy.maxPasswordFailedAttempts = parseInt(maxPasswordFailedAttemptsValue);
requestedPolicy.maxInactivityTimeLock = parseInt(maxInactivityTimeLockValue) * 1000;
requestedPolicy.applyAsync().done(callbackApply, callbackApplyError);
} catch (err) {
WinJS.log("Error CheckCompliance: " + err.message, "EAS SDK Sample", "error");
return;
}
}
function callbackApply(result) {
document.getElementById("RequireEncryptionComplianceResult").value = result.requireEncryptionResult;
document.getElementById("MinPasswordLengthComplianceResult").value = result.minPasswordLengthResult;
document.getElementById("DisallowConvenienceLogonComplianceResult").value = result.disallowConvenienceLogonResult;
document.getElementById("MinPasswordComplexCharactersComplianceResult").value = result.minPasswordComplexCharactersResult;
document.getElementById("PasswordExpirationComplianceResult").value = result.passwordExpirationResult;
document.getElementById("PasswordHistoryComplianceResult").value = result.passwordHistoryResult;
document.getElementById("MaxPasswordFailedAttemptsComplianceResult").value = result.maxPasswordFailedAttemptsResult;
document.getElementById("MaxInactivityTimeLockComplianceResult").value = result.maxInactivityTimeLockResult;
}
function callbackApplyError(err) {
WinJS.log("Error returned by EAS ApplyAsync: " + err.message, "EAS SDK Sample", "error");
}
function applyReset() {
// Get all the result reset
try {
document.getElementById("RequireEncryptionValue").checked = false;
document.getElementById("MinPasswordLengthValue").value = "";
document.getElementById("DisallowConvenienceLogonValue").checked = false;
document.getElementById("MinPasswordComplexCharactersValue").value = "";
document.getElementById("PasswordExpirationValue").value = "";
document.getElementById("PasswordHistoryValue").value = "";
document.getElementById("MaxPasswordFailedAttemptsValue").value = "";
document.getElementById("MaxInactivityTimeLockValue").value = "";
document.getElementById("RequireEncryptionComplianceResult").value = "";
document.getElementById("MinPasswordLengthComplianceResult").value = "";
document.getElementById("DisallowConvenienceLogonComplianceResult").value = "";
document.getElementById("MinPasswordComplexCharactersComplianceResult").value = "";
document.getElementById("PasswordExpirationComplianceResult").value = "";
document.getElementById("PasswordHistoryComplianceResult").value = "";
document.getElementById("MaxPasswordFailedAttemptsComplianceResult").value = "";
document.getElementById("MaxInactivityTimeLockComplianceResult").value = "";
} catch (err) {
WinJS.log("Error reset CheckCompliance: " + err.message, "EAS SDK Sample", "error");
return;
}
}
})();

Просмотреть файл

@ -225,14 +225,6 @@
<Link>Images\windows-sdk.png</Link>
</Content>
</ItemGroup>
<ItemGroup>
<SDKReference Include="WindowsDesktop, Version=10.0.10240.0">
<Name>Microsoft Desktop Extension SDK for Universal App Platform</Name>
</SDKReference>
<SDKReference Include="WindowsMobile, Version=10.0.10240.0">
<Name>Microsoft Mobile Extension SDK for Universal App Platform</Name>
</SDKReference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>

Просмотреть файл

@ -176,9 +176,6 @@
<SDKReference Include="WindowsDesktop, Version=10.0.10240.0">
<Name>Microsoft Desktop Extension SDK for Universal App Platform</Name>
</SDKReference>
<SDKReference Include="WindowsMobile, Version=10.0.10240.0">
<Name>Microsoft Mobile Extension SDK for Universal App Platform</Name>
</SDKReference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>

Просмотреть файл

@ -87,27 +87,21 @@
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props')" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props')" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props')" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props')" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props')" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props')" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
@ -392,9 +386,6 @@
<SubType>Designer</SubType>
</AppxManifest>
</ItemGroup>
<ItemGroup>
<SDKReference Include="WindowsMobile, Version=10.0.10240.0" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="$(VSINSTALLDIR)\Common7\IDE\Extensions\Microsoft\VsGraphics\ImageContentTask.targets" />

Просмотреть файл

@ -87,27 +87,21 @@
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props')" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props')" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props')" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props')" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props')" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=10.0.10240.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props')" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
@ -442,9 +436,6 @@
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<SDKReference Include="WindowsMobile, Version=10.0.10240.0" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="$(VSINSTALLDIR)\Common7\IDE\Extensions\Microsoft\VsGraphics\ImageContentTask.targets" />

Просмотреть файл

@ -40,7 +40,7 @@ namespace SplashScreenSample
// This is important to ensure that the extended splash screen is formatted properly in response to snapping, unsnapping, rotation, etc...
Window.Current.SizeChanged += new WindowSizeChangedEventHandler(ExtendedSplash_OnResize);
ScaleFactor = (double)DisplayInformation.GetForCurrentView().ResolutionScale / 100;
ScaleFactor = DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel;
splash = splashscreen;

Просмотреть файл

@ -316,6 +316,11 @@ namespace AnimatedGif
disposeRectangle = previousFrameProperties.Rect;
}
}
else
{
disposeRectangle = new Rect(0, 0, _imageProperties.PixelWidth, _imageProperties.PixelHeight);
}
// Compose and display the frame
try
@ -428,7 +433,7 @@ namespace AnimatedGif
var imageRectangle = new Rect(new Point(), _canvasImageSource.Size);
updateRectangle.Intersect(imageRectangle);
using (var drawingSession = _canvasImageSource.CreateDrawingSession(Colors.Transparent, updateRectangle))
using (var drawingSession = _canvasImageSource.CreateDrawingSession(Colors.Transparent))
{
drawingSession.DrawImage(_accumulationRenderTarget); // Render target has the composed frame
}

Просмотреть файл

@ -147,7 +147,7 @@ namespace AppUIBasics
private async void ShowDisclaimer()
{
ResourceLoader resourceLoader = new ResourceLoader();
ResourceLoader resourceLoader = ResourceLoader.GetForCurrentView();
var roamingSettings = ApplicationData.Current.RoamingSettings;
// Show disclaimer regardless of how the app has been activated

Просмотреть файл

@ -305,14 +305,14 @@
<Link>Assets\SplashScreen.png</Link>
</Content>
<Content Include="..\..\..\..\SharedContent\media\smalltile-sdk.png">
<Link>Assets\smalltile-sdk.png</Link>
<Link>Assets\smalltile-sdk.png</Link>
</Content>
<Content Include="Assets\SplitView.png" />
<Content Include="..\..\..\..\SharedContent\media\Samples\treetops.jpg">
<Link>Assets\treetops.jpg</Link>
</Content>
<Content Include="..\..\..\..\SharedContent\media\storelogo-sdk.png">
<Link>Assets\storelogo-sdk.png</Link>
<Link>Assets\storelogo-sdk.png</Link>
</Content>
<Content Include="DataModel\ControlInfoData.json" />
<PRIResource Include="Strings\en-US\Resources.resw" />
@ -619,11 +619,6 @@
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<SDKReference Include="WindowsMobile, Version=10.0.10240.0">
<Name>Microsoft Mobile Extension SDK for Universal App Platform</Name>
</SDKReference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>

Просмотреть файл

@ -76,7 +76,7 @@ namespace AppUIBasics
Item = item;
// Load control page into frame.
var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
var loader = Windows.ApplicationModel.Resources.ResourceLoader.GetForCurrentView();
string pageRoot = loader.GetString("PageStringRoot");
@ -132,7 +132,7 @@ namespace AppUIBasics
private void ShowHelp()
{
var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
var loader = Windows.ApplicationModel.Resources.ResourceLoader.GetForCurrentView();
string HTMLOpenTags = loader.GetString("HTMLOpenTags");
string HTMLCloseTags = loader.GetString("HTMLCloseTags");

Просмотреть файл

@ -23,7 +23,6 @@ using namespace Windows::UI;
using namespace Windows::Foundation;
using namespace Windows::Devices::Input;
using namespace Windows::Gaming::Input;
using namespace Windows::Phone::UI::Input;
using namespace Windows::System;
// Analog control deadzone definitions. Tune these values to adjust the size of the deadzone.
@ -92,12 +91,8 @@ void MoveLookController::InitWindow(_In_ CoreWindow^ window)
MouseDevice::GetForCurrentView()->MouseMoved +=
ref new TypedEventHandler<MouseDevice^, MouseEventArgs^>(this, &MoveLookController::OnMouseMoved);
// Hardware back button is only available on some device families such as Phone.
if (Windows::Foundation::Metadata::ApiInformation::IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
{
HardwareButtons::BackPressed +=
ref new EventHandler<BackPressedEventArgs^>(this, &MoveLookController::OnHardwareBackButtonPressed);
}
SystemNavigationManager::GetForCurrentView()->BackRequested +=
ref new EventHandler<BackRequestedEventArgs^>(this, &MoveLookController::OnBackRequested);
// Detect gamepad connection and disconnection events.
Gamepad::GamepadAdded +=
@ -1077,9 +1072,9 @@ void MoveLookController::Update()
//----------------------------------------------------------------------
void MoveLookController::OnHardwareBackButtonPressed(
void MoveLookController::OnBackRequested(
_In_ Platform::Object^ sender,
_In_ BackPressedEventArgs^ args
_In_ BackRequestedEventArgs^ args
)
{
if (m_state == MoveLookControllerState::Active)

Просмотреть файл

@ -189,10 +189,9 @@ private:
_In_ Windows::Devices::Input::MouseDevice^ mouseDevice,
_In_ Windows::Devices::Input::MouseEventArgs^ args
);
// Hardware back button is only present on some device families such as Phone.
void OnHardwareBackButtonPressed(
void OnBackRequested(
_In_ Platform::Object^ sender,
_In_ Windows::Phone::UI::Input::BackPressedEventArgs^ args
_In_ Windows::UI::Core::BackRequestedEventArgs^ args
);
void OnGamepadAdded(
_In_ Platform::Object^ sender,

Просмотреть файл

@ -8,9 +8,9 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTitle("SDKTemplate")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SDKTemplate")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyProduct("Windows Samples")]
[assembly: AssemblyCopyright("Copyright © Microsoft Corporation")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]