Commit 553e38ce authored by Ghislain MARY's avatar Ghislain MARY

Add missing files.

parent fe078e79
//*********************************************************
//
// 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.
//
//*********************************************************
#include <wrl\module.h>
#include <roapi.h>
#include <Windows.ApplicationModel.Core.h>
using namespace ABI::Windows::ApplicationModel::Core;
using namespace Microsoft::WRL;
class ExeServerGetActivationFactory : public RuntimeClass<
ABI::Windows::Foundation::IGetActivationFactory,
FtmBase>
{
public:
IFACEMETHODIMP GetActivationFactory(_In_ HSTRING activatableClassId, _COM_Outptr_ IInspectable **factory)
{
*factory = nullptr;
ComPtr<IActivationFactory> activationFactory;
auto &module = Microsoft::WRL::Module<Microsoft::WRL::InProc>::GetModule();
HRESULT hr = module.GetActivationFactory(activatableClassId, &activationFactory);
if (SUCCEEDED(hr))
{
*factory = activationFactory.Detach();
}
return hr;
}
};
int CALLBACK WinMain(_In_ HINSTANCE, _In_ HINSTANCE, _In_ LPSTR, _In_ int)
{
HRESULT hr = Windows::Foundation::Initialize(RO_INIT_MULTITHREADED);
if (SUCCEEDED(hr))
{
// Scoping for smart pointers
{
ComPtr<ICoreApplication> spApplicationFactory;
hr = Windows::Foundation::GetActivationFactory(Wrappers::HStringReference(RuntimeClass_Windows_ApplicationModel_Core_CoreApplication).Get(), &spApplicationFactory);
if (SUCCEEDED(hr))
{
ComPtr<ABI::Windows::Foundation::IGetActivationFactory> spGetActivationFactory = Make<ExeServerGetActivationFactory>();
spApplicationFactory->RunWithActivationFactories(spGetActivationFactory.Get());
}
}
Windows::Foundation::Uninitialize();
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="MS2TesterHost.cpp" />
</ItemGroup>
<ItemGroup>
<AppxManifest Include="..\Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\submodules\mswinrtvid\MSWinRTVideo.vcxproj">
<Project>{2d0e44c4-e51d-4911-b876-345d1e5e5209}</Project>
</ProjectReference>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{8a1a89b3-f2db-4428-a571-f0dff2e1eec1}</ProjectGuid>
<Keyword>WindowsRuntimeComponent</Keyword>
<ProjectName>MS2TesterHost</ProjectName>
<RootNamespace>MS2TesterHost</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<AppContainerApplication>true</AppContainerApplication>
<ApplicationType>Windows Store</ApplicationType>
<WindowsTargetPlatformVersion>10.0.10240.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.10240.0</WindowsTargetPlatformMinVersion>
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<PropertyGroup>
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PreprocessorDefinitions>_WINRT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>28204</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PreprocessorDefinitions>_WINRT_DLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>28204</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.ApplicationModel.AppService;
using Windows.ApplicationModel.Background;
using Windows.Foundation.Collections;
namespace MS2TesterTasks
{
public sealed class AppService : IBackgroundTask
{
public void Run(IBackgroundTaskInstance taskInstance)
{
AppServiceTriggerDetails triggerDetail = taskInstance.TriggerDetails as AppServiceTriggerDetails;
_deferral = taskInstance.GetDeferral();
// Register for Task Cancel callback
taskInstance.Canceled += TaskInstance_Canceled;
AppServiceConnection connection = triggerDetail.AppServiceConnection;
_connection = connection;
connection.RequestReceived += Connection_RequestReceived;
}
private async void Connection_RequestReceived(AppServiceConnection sender, AppServiceRequestReceivedEventArgs args)
{
var deferral = args.GetDeferral();
var response = new ValueSet();
response[BackgroundOperation.Result] = (int)OperationResult.Failed;
bool stop = false;
try
{
var message = args.Request.Message;
if (message.ContainsKey(BackgroundOperation.NewBackgroundRequest))
{
switch ((BackgroundRequest)message[BackgroundOperation.NewBackgroundRequest])
{
case BackgroundRequest.InitVideo:
CurrentOperation.AppRequest = args.Request;
CurrentOperation.Request = BackgroundRequest.InitVideo;
CurrentOperation.AppRequestDeferral = deferral;
CurrentOperation.InitVideo();
response[BackgroundOperation.Result] = (int)OperationResult.Succeeded;
break;
case BackgroundRequest.UninitVideo:
CurrentOperation.AppRequest = args.Request;
CurrentOperation.Request = BackgroundRequest.UninitVideo;
CurrentOperation.AppRequestDeferral = deferral;
CurrentOperation.UninitVideo();
response[BackgroundOperation.Result] = (int)OperationResult.Succeeded;
break;
case BackgroundRequest.GetVideoDevices:
CurrentOperation.AppRequest = args.Request;
CurrentOperation.Request = BackgroundRequest.GetVideoDevices;
CurrentOperation.AppRequestDeferral = deferral;
response[BackgroundOperation.ReturnValue] = CurrentOperation.GetVideoDevices().ToArray();
response[BackgroundOperation.Result] = (int)OperationResult.Succeeded;
break;
case BackgroundRequest.StartVideoStream:
CurrentOperation.AppRequest = args.Request;
CurrentOperation.Request = BackgroundRequest.StartVideoStream;
CurrentOperation.AppRequestDeferral = deferral;
CurrentOperation.StartVideoStream(
message[StartVideoStreamArguments.VideoSwapChainPanelName.ToString()] as String,
message[StartVideoStreamArguments.PreviewSwapChainPanelName.ToString()] as String,
message[StartVideoStreamArguments.Camera.ToString()] as String,
message[StartVideoStreamArguments.Codec.ToString()] as String,
message[StartVideoStreamArguments.VideoSize.ToString()] as String,
Convert.ToUInt32(message[StartVideoStreamArguments.FrameRate.ToString()]),
Convert.ToUInt32(message[StartVideoStreamArguments.BitRate.ToString()]));
response[BackgroundOperation.Result] = (int)OperationResult.Succeeded;
break;
case BackgroundRequest.StopVideoStream:
CurrentOperation.AppRequest = args.Request;
CurrentOperation.Request = BackgroundRequest.StopVideoStream;
CurrentOperation.AppRequestDeferral = deferral;
CurrentOperation.StopVideoStream();
response[BackgroundOperation.Result] = (int)OperationResult.Succeeded;
break;
case BackgroundRequest.ChangeCamera:
CurrentOperation.AppRequest = args.Request;
CurrentOperation.Request = BackgroundRequest.ChangeCamera;
CurrentOperation.AppRequestDeferral = deferral;
CurrentOperation.ChangeCamera(message[ChangeCameraArguments.Camera.ToString()] as String);
response[BackgroundOperation.Result] = (int)OperationResult.Succeeded;
break;
case BackgroundRequest.GetOrientation:
CurrentOperation.AppRequest = args.Request;
CurrentOperation.Request = BackgroundRequest.GetOrientation;
CurrentOperation.AppRequestDeferral = deferral;
response[BackgroundOperation.ReturnValue] = CurrentOperation.GetOrientation();
response[BackgroundOperation.Result] = (int)OperationResult.Succeeded;
break;
case BackgroundRequest.SetOrientation:
CurrentOperation.AppRequest = args.Request;
CurrentOperation.Request = BackgroundRequest.SetOrientation;
CurrentOperation.AppRequestDeferral = deferral;
CurrentOperation.SetOrientation(Convert.ToInt32(message[SetOrientationArguments.Degrees.ToString()]));
response[BackgroundOperation.Result] = (int)OperationResult.Succeeded;
break;
default:
stop = true;
break;
}
}
}
finally
{
if (stop)
{
_deferral.Complete();
} else
{
await args.Request.SendResponseAsync(response);
}
}
}
private void TaskInstance_Canceled(IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason)
{
if (_deferral != null)
{
_deferral.Complete();
}
}
private AppServiceConnection _connection;
private BackgroundTaskDeferral _deferral;
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MS2TesterTasks
{
public enum BackgroundRequest
{
InitVideo,
UninitVideo,
GetVideoDevices,
StartVideoStream,
StopVideoStream,
ChangeCamera,
GetOrientation,
SetOrientation,
// Always keep this as the last option
InValid
}
public enum StartVideoStreamArguments
{
VideoSwapChainPanelName,
PreviewSwapChainPanelName,
Camera,
Codec,
VideoSize,
FrameRate,
BitRate
}
public enum ChangeCameraArguments
{
Camera
}
public enum SetOrientationArguments
{
Degrees
}
public enum OperationResult
{
Succeeded,
Failed
}
public static class BackgroundOperation
{
public static String AppServiceName
{
get { return _appServiceName; }
}
public static String NewBackgroundRequest
{
get { return _newBackgroundRequest; }
}
public static String Result
{
get { return _result; }
}
public static String ReturnValue
{
get { return _returnValue; }
}
const String _appServiceName = "MS2TesterTasks.AppService";
const String _newBackgroundRequest = "NewBackgroundRequest";
const String _result = "Result";
const String _returnValue = "ReturnValue";
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.ApplicationModel.AppService;
using Windows.ApplicationModel.Background;
using BelledonneCommunications.Mediastreamer2.Tester;
namespace MS2TesterTasks
{
static class CurrentOperation
{
public static AppServiceRequest AppRequest
{
set
{
lock (_lock)
{
_appRequest = value;
}
}
get
{
lock (_lock)
{
return _appRequest;
}
}
}
public static BackgroundRequest Request
{
set
{
lock (_lock)
{
_request = value;
}
}
get
{
lock (_lock)
{
return _request;
}
}
}
public static AppServiceDeferral AppRequestDeferral
{
set
{
lock (_lock)
{
_appDeferral = value;
}
}
get
{
lock (_lock)
{
return _appDeferral;
}
}
}
public static BackgroundTaskDeferral PhoneCallTaskDeferral
{
set
{
lock (_lock)
{
_phoneCallTaskDeferral = value;
}
}
get
{
lock (_lock)
{
return _phoneCallTaskDeferral;
}
}
}
public static void InitVideo()
{
lock (_lock)
{
NativeTester.Instance.initVideo();
}
}
public static void UninitVideo()
{
lock (_lock)
{
NativeTester.Instance.uninitVideo();
}
}
public static List<String> GetVideoDevices()
{
lock (_lock)
{
return NativeTester.Instance.VideoDevices.ToList<String>();
}
}
public static void StartVideoStream(String videoSwapChainPanelName, String previewSwapChainPanelName, String camera, String codec, String videoSize, UInt32 frameRate, UInt32 bitRate)
{
lock (_lock)
{
NativeTester.Instance.startVideoStream(videoSwapChainPanelName, previewSwapChainPanelName, camera, codec, videoSize, frameRate, bitRate);
}
}
public static void StopVideoStream()
{
lock (_lock)
{
NativeTester.Instance.stopVideoStream();
}
}
public static void ChangeCamera(String camera)
{
lock (_lock)
{
NativeTester.Instance.changeCamera(camera);
}
}
public static int GetOrientation()
{
lock (_lock)
{
return NativeTester.Instance.getOrientation();
}
}
public static void SetOrientation(int degrees)
{
lock (_lock)
{
NativeTester.Instance.setOrientation(degrees);
}
}
private static Object _lock = new Object();
private static AppServiceRequest _appRequest = null;
private static AppServiceDeferral _appDeferral = null;
private static BackgroundTaskDeferral _phoneCallTaskDeferral = null;
private static BackgroundRequest _request = BackgroundRequest.InValid;
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{1BA81D48-5FC4-47FC-8A08-524C4B2859DD}</ProjectGuid>
<OutputType>winmdobj</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MS2TesterTasks</RootNamespace>
<AssemblyName>MS2TesterTasks</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.10586.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<AllowCrossPlatformRetargeting>false</AllowCrossPlatformRetargeting>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<PlatformTarget>ARM</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\ARM\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
<PlatformTarget>ARM</PlatformTarget>
<OutputPath>bin\ARM\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<PlatformTarget>x64</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<PlatformTarget>x64</PlatformTarget>
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<PlatformTarget>x86</PlatformTarget>
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
<None Include="project.json" />
</ItemGroup>
<ItemGroup>
<Compile Include="AppService.cs" />
<Compile Include="BackgroundOperation.cs" />
<Compile Include="CurrentOperation.cs" />
<Compile Include="PhoneCallTask.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<SDKReference Include="WindowsMobile, Version=10.0.10240.0">
<Name>Windows Mobile Extensions for the UWP</Name>
</SDKReference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.ApplicationModel.Background;
namespace MS2TesterTasks
{
public sealed class PhoneCallTask : IBackgroundTask
{
private BackgroundTaskDeferral mDeferral;
public void Run(IBackgroundTaskInstance taskInstance)
{
mDeferral = taskInstance.GetDeferral();
CurrentOperation.PhoneCallTaskDeferral = mDeferral;
taskInstance.Canceled += TaskInstance_Canceled;
}
private void TaskInstance_Canceled(IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason)
{
if (mDeferral != null)
{
mDeferral.Complete();
}
CurrentOperation.PhoneCallTaskDeferral = null;
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("MS2TesterTasks")]