diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2cf8f08f..fe716ce1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -80,6 +80,7 @@ When creating a new NuGet and GitHub release, the following steps should be take 2. Merge from Master to Release, with a PR appropriately named ("v1.2.3 release") 3. Squash and merge commits, leaving major feature entries and fixes in the description. 4. Compile release builds of the .NET and UWP libraries, sign them, and upload to NuGet + a. We now have a CI server for this that builds, signs, and packages the NuGet package [here](https://microsoft.visualstudio.com/DefaultCollection/OS/_build/index?path=%5C&definitionId=14239). 5. Cut a new release on GitHub using the same version number ("v1.2.3") and attach the signed libraries to the release. 6. Update code documentation. diff --git a/WindowsDevicePortalWrapper/UnitTestProject/Core/PerformanceDataTests.cs b/WindowsDevicePortalWrapper/UnitTestProject/Core/PerformanceDataTests.cs index f1e470d5..1ef7ce75 100644 --- a/WindowsDevicePortalWrapper/UnitTestProject/Core/PerformanceDataTests.cs +++ b/WindowsDevicePortalWrapper/UnitTestProject/Core/PerformanceDataTests.cs @@ -145,14 +145,14 @@ private static void ValidateRunningProcessesAsync(RunningProcesses runningProces Assert.AreEqual(systemIdleprocess.Name, "System Idle Process"); Assert.IsNull(systemIdleprocess.PackageFullName); Assert.AreEqual(systemIdleprocess.PageFile, 0U); - Assert.AreEqual(systemIdleprocess.PrivateWorkingSet, 4096); - Assert.AreEqual(systemIdleprocess.ProcessId, 0); + Assert.AreEqual(systemIdleprocess.PrivateWorkingSet, 4096U); + Assert.AreEqual(systemIdleprocess.ProcessId, 0U); Assert.IsNull(systemIdleprocess.Publisher); Assert.AreEqual(systemIdleprocess.SessionId, 0U); - Assert.AreEqual(systemIdleprocess.TotalCommit, 0); + Assert.AreEqual(systemIdleprocess.TotalCommit, 0U); Assert.AreEqual(systemIdleprocess.UserName, "NT AUTHORITY\\SYSTEM"); Assert.IsNull(systemIdleprocess.Version); - Assert.AreEqual(systemIdleprocess.VirtualSize, 65536); + Assert.AreEqual(systemIdleprocess.VirtualSize, 65536U); Assert.AreEqual(systemIdleprocess.WorkingSet, 4096U); DeviceProcessInfo devHomeProcess = processes[1]; @@ -163,14 +163,14 @@ private static void ValidateRunningProcessesAsync(RunningProcesses runningProces Assert.AreEqual(devHomeProcess.Name, "svchost.exe"); Assert.IsNull(devHomeProcess.PackageFullName); Assert.AreEqual(devHomeProcess.PageFile, 5472256U); - Assert.AreEqual(devHomeProcess.PrivateWorkingSet, 4755456); - Assert.AreEqual(devHomeProcess.ProcessId, 892); + Assert.AreEqual(devHomeProcess.PrivateWorkingSet, 4755456U); + Assert.AreEqual(devHomeProcess.ProcessId, 892U); Assert.IsNull(devHomeProcess.Publisher); Assert.AreEqual(devHomeProcess.SessionId, 0U); - Assert.AreEqual(devHomeProcess.TotalCommit, 5914624); + Assert.AreEqual(devHomeProcess.TotalCommit, 5914624U); Assert.AreEqual(devHomeProcess.UserName, "NT AUTHORITY\\SYSTEM"); Assert.IsNull(devHomeProcess.Version); - Assert.AreEqual(devHomeProcess.VirtualSize, 2203387539456); + Assert.AreEqual(devHomeProcess.VirtualSize, 2203387539456U); Assert.AreEqual(devHomeProcess.WorkingSet, 17285120U); } @@ -181,18 +181,18 @@ private static void ValidateRunningProcessesAsync(RunningProcesses runningProces private static void ValidateSystemPerm(SystemPerformanceInformation systemPerfInfo) { // Check some known things about this response. - Assert.AreEqual(systemPerfInfo.AvailablePages, 369054); - Assert.AreEqual(systemPerfInfo.CommitLimit, 784851); - Assert.AreEqual(systemPerfInfo.CommittedPages, 322627); - Assert.AreEqual(systemPerfInfo.CpuLoad, 1); - Assert.AreEqual(systemPerfInfo.IoOtherSpeed, 3692); - Assert.AreEqual(systemPerfInfo.IoReadSpeed, 36); - Assert.AreEqual(systemPerfInfo.IoWriteSpeed, 6480); - Assert.AreEqual(systemPerfInfo.NonPagedPoolPages, 42504); - Assert.AreEqual(systemPerfInfo.PageSize, 4096); - Assert.AreEqual(systemPerfInfo.PagedPoolPages, 30697); - Assert.AreEqual(systemPerfInfo.TotalInstalledKb, 1048592); - Assert.AreEqual(systemPerfInfo.TotalPages, 655360); + Assert.AreEqual(systemPerfInfo.AvailablePages, 369054U); + Assert.AreEqual(systemPerfInfo.CommitLimit, 784851U); + Assert.AreEqual(systemPerfInfo.CommittedPages, 322627U); + Assert.AreEqual(systemPerfInfo.CpuLoad, 1U); + Assert.AreEqual(systemPerfInfo.IoOtherSpeed, 3692U); + Assert.AreEqual(systemPerfInfo.IoReadSpeed, 36U); + Assert.AreEqual(systemPerfInfo.IoWriteSpeed, 6480U); + Assert.AreEqual(systemPerfInfo.NonPagedPoolPages, 42504U); + Assert.AreEqual(systemPerfInfo.PageSize, 4096U); + Assert.AreEqual(systemPerfInfo.PagedPoolPages, 30697U); + Assert.AreEqual(systemPerfInfo.TotalInstalledKb, 1048592U); + Assert.AreEqual(systemPerfInfo.TotalPages, 655360U); Assert.AreEqual(systemPerfInfo.GpuData.Adapters.Count, 1); GpuAdapter gpuAdapter = systemPerfInfo.GpuData.Adapters[0]; @@ -204,11 +204,11 @@ private static void ValidateSystemPerm(SystemPerformanceInformation systemPerfIn Assert.AreEqual(gpuAdapter.EnginesUtilization.Count, 7); double enguineUtilization = gpuAdapter.EnginesUtilization[0]; - Assert.AreEqual(enguineUtilization, 0.0011459999950602651); + Assert.AreEqual(enguineUtilization, 0.001146); NetworkPerformanceData networkPerformanceData = systemPerfInfo.NetworkData; - Assert.AreEqual(networkPerformanceData.BytesIn, 15000); - Assert.AreEqual(networkPerformanceData.BytesOut, 0); + Assert.AreEqual(networkPerformanceData.BytesIn, 15000U); + Assert.AreEqual(networkPerformanceData.BytesOut, 0U); } } } diff --git a/WindowsDevicePortalWrapper/UnitTestProject/Device-VersionTests/HoloLens/HoloLensHelpers.cs b/WindowsDevicePortalWrapper/UnitTestProject/Device-VersionTests/HoloLens/HoloLensHelpers.cs index 41e980fc..08a97f1a 100644 --- a/WindowsDevicePortalWrapper/UnitTestProject/Device-VersionTests/HoloLens/HoloLensHelpers.cs +++ b/WindowsDevicePortalWrapper/UnitTestProject/Device-VersionTests/HoloLens/HoloLensHelpers.cs @@ -22,18 +22,18 @@ public static class HoloLensHelpers internal static void ValidateSystemPerfAsync(SystemPerformanceInformation systemPerfInfo) { // Check some known things about this response. - Assert.AreEqual(275897, systemPerfInfo.AvailablePages); - Assert.AreEqual(764290, systemPerfInfo.CommitLimit); - Assert.AreEqual(225486, systemPerfInfo.CommittedPages); - Assert.AreEqual(20, systemPerfInfo.CpuLoad); - Assert.AreEqual(4337544, systemPerfInfo.IoOtherSpeed); - Assert.AreEqual(1717438, systemPerfInfo.IoReadSpeed); - Assert.AreEqual(788621, systemPerfInfo.IoWriteSpeed); - Assert.AreEqual(15470, systemPerfInfo.NonPagedPoolPages); - Assert.AreEqual(4096, systemPerfInfo.PageSize); - Assert.AreEqual(18894, systemPerfInfo.PagedPoolPages); - Assert.AreEqual(2097152, systemPerfInfo.TotalInstalledKb); - Assert.AreEqual(502146, systemPerfInfo.TotalPages); + Assert.AreEqual(275897U, systemPerfInfo.AvailablePages); + Assert.AreEqual(764290U, systemPerfInfo.CommitLimit); + Assert.AreEqual(225486U, systemPerfInfo.CommittedPages); + Assert.AreEqual(20U, systemPerfInfo.CpuLoad); + Assert.AreEqual(4337544U, systemPerfInfo.IoOtherSpeed); + Assert.AreEqual(1717438U, systemPerfInfo.IoReadSpeed); + Assert.AreEqual(788621U, systemPerfInfo.IoWriteSpeed); + Assert.AreEqual(15470U, systemPerfInfo.NonPagedPoolPages); + Assert.AreEqual(4096U, systemPerfInfo.PageSize); + Assert.AreEqual(18894U, systemPerfInfo.PagedPoolPages); + Assert.AreEqual(2097152U, systemPerfInfo.TotalInstalledKb); + Assert.AreEqual(502146U, systemPerfInfo.TotalPages); Assert.AreEqual(systemPerfInfo.GpuData.Adapters.Count, 1); GpuAdapter gpuAdapter = systemPerfInfo.GpuData.Adapters[0]; @@ -47,8 +47,8 @@ internal static void ValidateSystemPerfAsync(SystemPerformanceInformation system Assert.AreEqual("7.098184", gpuAdapter.EnginesUtilization[0].ToString("n6")); NetworkPerformanceData networkPerformanceData = systemPerfInfo.NetworkData; - Assert.AreEqual(0, networkPerformanceData.BytesIn); - Assert.AreEqual(0, networkPerformanceData.BytesOut); + Assert.AreEqual(0U, networkPerformanceData.BytesIn); + Assert.AreEqual(0U, networkPerformanceData.BytesOut); } /// diff --git a/WindowsDevicePortalWrapper/UnitTestProject/Device-VersionTests/XboxOne/XboxOne_rs1_xbox_rel_1608.cs b/WindowsDevicePortalWrapper/UnitTestProject/Device-VersionTests/XboxOne/XboxOne_rs1_xbox_rel_1608.cs index 91c2335f..11174f74 100644 --- a/WindowsDevicePortalWrapper/UnitTestProject/Device-VersionTests/XboxOne/XboxOne_rs1_xbox_rel_1608.cs +++ b/WindowsDevicePortalWrapper/UnitTestProject/Device-VersionTests/XboxOne/XboxOne_rs1_xbox_rel_1608.cs @@ -682,14 +682,14 @@ private static void ValidateRunningProcessesAsync(RunningProcesses runningProces Assert.AreEqual(systemIdleprocess.Name, "System Idle Process"); Assert.IsNull(systemIdleprocess.PackageFullName); Assert.AreEqual(systemIdleprocess.PageFile, 0U); - Assert.AreEqual(systemIdleprocess.PrivateWorkingSet, 4096); - Assert.AreEqual(systemIdleprocess.ProcessId, 0); + Assert.AreEqual(systemIdleprocess.PrivateWorkingSet, 4096U); + Assert.AreEqual(systemIdleprocess.ProcessId, 0U); Assert.IsNull(systemIdleprocess.Publisher); Assert.AreEqual(systemIdleprocess.SessionId, 0U); - Assert.AreEqual(systemIdleprocess.TotalCommit, 0); + Assert.AreEqual(systemIdleprocess.TotalCommit, 0U); Assert.AreEqual(systemIdleprocess.UserName, "NT AUTHORITY\\SYSTEM"); Assert.IsNull(systemIdleprocess.Version); - Assert.AreEqual(systemIdleprocess.VirtualSize, 65536); + Assert.AreEqual(systemIdleprocess.VirtualSize, 65536U); Assert.AreEqual(systemIdleprocess.WorkingSet, 4096U); DeviceProcessInfo devHomeProcess = processes[56]; @@ -700,18 +700,18 @@ private static void ValidateRunningProcessesAsync(RunningProcesses runningProces Assert.AreEqual(devHomeProcess.Name, "WWAHost.exe"); Assert.AreEqual(devHomeProcess.PackageFullName, "Microsoft.Xbox.DevHome_100.1607.9000.0_x64__8wekyb3d8bbwe"); Assert.AreEqual(devHomeProcess.PageFile, 47067136U); - Assert.AreEqual(devHomeProcess.PrivateWorkingSet, 32796672); - Assert.AreEqual(devHomeProcess.ProcessId, 3424); + Assert.AreEqual(devHomeProcess.PrivateWorkingSet, 32796672U); + Assert.AreEqual(devHomeProcess.ProcessId, 3424U); Assert.AreEqual(devHomeProcess.Publisher, "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"); Assert.AreEqual(devHomeProcess.SessionId, 0U); - Assert.AreEqual(devHomeProcess.TotalCommit, 49213440); + Assert.AreEqual(devHomeProcess.TotalCommit, 49213440U); Assert.AreEqual(devHomeProcess.UserName, "TESTXBOX\\DefaultAccount"); Assert.AreEqual(devHomeProcess.Version.Build, 9000U); Assert.AreEqual(devHomeProcess.Version.Major, 100U); Assert.AreEqual(devHomeProcess.Version.Minor, 1607U); Assert.AreEqual(devHomeProcess.Version.Revision, 0U); - Assert.AreEqual(devHomeProcess.VirtualSize, 2234032066560); + Assert.AreEqual(devHomeProcess.VirtualSize, 2234032066560U); Assert.AreEqual(devHomeProcess.WorkingSet, 79466496U); } @@ -722,18 +722,18 @@ private static void ValidateRunningProcessesAsync(RunningProcesses runningProces private static void ValidateSystemPerm(SystemPerformanceInformation systemPerfInfo) { // Check some known things about this response. - Assert.AreEqual(systemPerfInfo.AvailablePages, 369054); - Assert.AreEqual(systemPerfInfo.CommitLimit, 784851); - Assert.AreEqual(systemPerfInfo.CommittedPages, 322627); - Assert.AreEqual(systemPerfInfo.CpuLoad, 1); - Assert.AreEqual(systemPerfInfo.IoOtherSpeed, 3692); - Assert.AreEqual(systemPerfInfo.IoReadSpeed, 36); - Assert.AreEqual(systemPerfInfo.IoWriteSpeed, 6480); - Assert.AreEqual(systemPerfInfo.NonPagedPoolPages, 42504); - Assert.AreEqual(systemPerfInfo.PageSize, 4096); - Assert.AreEqual(systemPerfInfo.PagedPoolPages, 30697); - Assert.AreEqual(systemPerfInfo.TotalInstalledKb, 1048592); - Assert.AreEqual(systemPerfInfo.TotalPages, 655360); + Assert.AreEqual(systemPerfInfo.AvailablePages, 369054U); + Assert.AreEqual(systemPerfInfo.CommitLimit, 784851U); + Assert.AreEqual(systemPerfInfo.CommittedPages, 322627U); + Assert.AreEqual(systemPerfInfo.CpuLoad, 1U); + Assert.AreEqual(systemPerfInfo.IoOtherSpeed, 3692U); + Assert.AreEqual(systemPerfInfo.IoReadSpeed, 36U); + Assert.AreEqual(systemPerfInfo.IoWriteSpeed, 6480U); + Assert.AreEqual(systemPerfInfo.NonPagedPoolPages, 42504U); + Assert.AreEqual(systemPerfInfo.PageSize, 4096U); + Assert.AreEqual(systemPerfInfo.PagedPoolPages, 30697U); + Assert.AreEqual(systemPerfInfo.TotalInstalledKb, 1048592U); + Assert.AreEqual(systemPerfInfo.TotalPages, 655360U); Assert.AreEqual(systemPerfInfo.GpuData.Adapters.Count, 1); GpuAdapter gpuAdapter = systemPerfInfo.GpuData.Adapters[0]; @@ -745,11 +745,11 @@ private static void ValidateSystemPerm(SystemPerformanceInformation systemPerfIn Assert.AreEqual(gpuAdapter.EnginesUtilization.Count, 7); double enguineUtilization = gpuAdapter.EnginesUtilization[0]; - Assert.AreEqual(enguineUtilization, 0.0011459999950602651); + Assert.AreEqual(enguineUtilization, 0.001146); NetworkPerformanceData networkPerformanceData = systemPerfInfo.NetworkData; - Assert.AreEqual(networkPerformanceData.BytesIn, 15000); - Assert.AreEqual(networkPerformanceData.BytesOut, 0); + Assert.AreEqual(networkPerformanceData.BytesIn, 15000U); + Assert.AreEqual(networkPerformanceData.BytesOut, 0U); } } } \ No newline at end of file diff --git a/WindowsDevicePortalWrapper/Utilities/WindowsDevicePortalWrapper.nuspec b/WindowsDevicePortalWrapper/Utilities/WindowsDevicePortalWrapper.nuspec new file mode 100644 index 00000000..c35b7d20 --- /dev/null +++ b/WindowsDevicePortalWrapper/Utilities/WindowsDevicePortalWrapper.nuspec @@ -0,0 +1,30 @@ + + + + WindowsDevicePortalWrapper + 0.0.0.0 + Windows Device Portal Wrapper + Windows Device Portal + Microsoft; Windows Device Portal + https://github.com/Microsoft/WindowsDevicePortalWrapper/blob/master/License.txt + https://github.com/microsoft/windowsdeviceportalwrapper + false + The Device Portal Wrapper is a library that allows a client application to connect to a Device Portal instance on a Windows 10 device and call the REST APIs presented. This allows an application to e.g. install apps, reboot the device, or get performance metrics. + +See the GitHub repo at https://github.com/microsoft/windowsdeviceportalwrapper + Remote control of Windows 10 device for developers and device labs. + [FILL IN BEFORE RELEASE] + Microsoft Corp + + WDP Windows 10 Device Portal + + + + + + + + + + + diff --git a/WindowsDevicePortalWrapper/Utilities/signConfig.xml b/WindowsDevicePortalWrapper/Utilities/signConfig.xml new file mode 100644 index 00000000..71121c05 --- /dev/null +++ b/WindowsDevicePortalWrapper/Utilities/signConfig.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/PerformanceData.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/PerformanceData.cs index e14fcf1c..35b519c7 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/PerformanceData.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/PerformanceData.cs @@ -233,7 +233,7 @@ public class DeviceProcessInfo /// Gets the process id (pid) /// [DataMember(Name = "ProcessId")] - public int ProcessId { get; private set; } + public uint ProcessId { get; private set; } /// /// Gets the user the process is running as. @@ -248,22 +248,22 @@ public class DeviceProcessInfo public string PackageFullName { get; private set; } /// - /// Gets the Page file usage info + /// Gets the Page file usage info, in bytes /// [DataMember(Name = "PageFileUsage")] - public uint PageFile { get; private set; } + public ulong PageFile { get; private set; } /// - /// Gets the working set size + /// Gets the working set size, in bytes /// [DataMember(Name = "WorkingSetSize")] - public uint WorkingSet { get; private set; } + public ulong WorkingSet { get; private set; } /// - /// Gets package working set + /// Gets package working set, in bytes /// [DataMember(Name = "PrivateWorkingSet")] - public double PrivateWorkingSet { get; private set; } + public ulong PrivateWorkingSet { get; private set; } /// /// Gets session id @@ -272,16 +272,16 @@ public class DeviceProcessInfo public uint SessionId { get; private set; } /// - /// Gets total commit in bytes + /// Gets total commit, in bytes /// [DataMember(Name = "TotalCommit")] - public double TotalCommit { get; private set; } + public ulong TotalCommit { get; private set; } /// - /// Gets virtual size in bytes + /// Gets virtual size, in bytes /// [DataMember(Name = "VirtualSize")] - public double VirtualSize { get; private set; } + public ulong VirtualSize { get; private set; } /// /// Gets a value indicating whether or not the app is running @@ -329,13 +329,13 @@ public class GpuAdapter /// Gets total Dedicated memory in bytes /// [DataMember(Name = "DedicatedMemory")] - public uint DedicatedMemory { get; private set; } + public ulong DedicatedMemory { get; private set; } /// /// Gets used Dedicated memory in bytes /// [DataMember(Name = "DedicatedMemoryUsed")] - public uint DedicatedMemoryUsed { get; private set; } + public ulong DedicatedMemoryUsed { get; private set; } /// /// Gets description @@ -347,19 +347,19 @@ public class GpuAdapter /// Gets system memory in bytes /// [DataMember(Name = "SystemMemory")] - public uint SystemMemory { get; private set; } + public ulong SystemMemory { get; private set; } /// /// Gets memory used in bytes /// [DataMember(Name = "SystemMemoryUsed")] - public uint SystemMemoryUsed { get; private set; } + public ulong SystemMemoryUsed { get; private set; } /// /// Gets engines utilization as percent of maximum. /// [DataMember(Name = "EnginesUtilization")] - public List EnginesUtilization { get; private set; } + public List EnginesUtilization { get; private set; } } /// @@ -385,13 +385,13 @@ public class NetworkPerformanceData /// Gets current download speed in bytes per second /// [DataMember(Name = "NetworkInBytes")] - public int BytesIn { get; private set; } + public ulong BytesIn { get; private set; } /// /// Gets current upload speed in bytes per second /// [DataMember(Name = "NetworkOutBytes")] - public int BytesOut { get; private set; } + public ulong BytesOut { get; private set; } } /// @@ -463,73 +463,73 @@ public class SystemPerformanceInformation /// Gets available pages /// [DataMember(Name = "AvailablePages")] - public int AvailablePages { get; private set; } + public ulong AvailablePages { get; private set; } /// /// Gets commit limit in bytes /// [DataMember(Name = "CommitLimit")] - public int CommitLimit { get; private set; } + public uint CommitLimit { get; private set; } /// /// Gets committed pages /// [DataMember(Name = "CommittedPages")] - public int CommittedPages { get; private set; } + public uint CommittedPages { get; private set; } /// /// Gets CPU load as percent of maximum (0 - 100) /// [DataMember(Name = "CpuLoad")] - public int CpuLoad { get; private set; } + public uint CpuLoad { get; private set; } /// /// Gets IO Other Speed in bytes per second /// [DataMember(Name = "IOOtherSpeed")] - public int IoOtherSpeed { get; private set; } + public ulong IoOtherSpeed { get; private set; } /// /// Gets IO Read speed in bytes per second. /// [DataMember(Name = "IOReadSpeed")] - public int IoReadSpeed { get; private set; } + public ulong IoReadSpeed { get; private set; } /// /// Gets IO write speed in bytes per second /// [DataMember(Name = "IOWriteSpeed")] - public int IoWriteSpeed { get; private set; } + public ulong IoWriteSpeed { get; private set; } /// /// Gets Non paged pool pages /// [DataMember(Name = "NonPagedPoolPages")] - public int NonPagedPoolPages { get; private set; } + public uint NonPagedPoolPages { get; private set; } /// /// Gets page size /// [DataMember(Name = "PageSize")] - public int PageSize { get; private set; } + public uint PageSize { get; private set; } /// /// Gets paged pool pages /// [DataMember(Name = "PagedPoolPages")] - public int PagedPoolPages { get; private set; } + public uint PagedPoolPages { get; private set; } /// /// Gets total installed in KB /// [DataMember(Name = "TotalInstalledInKb")] - public int TotalInstalledKb { get; private set; } + public ulong TotalInstalledKb { get; private set; } /// /// Gets total pages /// [DataMember(Name = "TotalPages")] - public int TotalPages { get; private set; } + public uint TotalPages { get; private set; } /// /// Gets GPU data diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/Power.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/Power.cs index da87fa63..8d9890c9 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/Power.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/Power.cs @@ -130,7 +130,7 @@ public class BatteryState public int DefaultAlert2 { get; private set; } /// - /// Gets estimated battery time. + /// Gets estimated battery time left in seconds. /// [DataMember(Name = "EstimatedTime")] public uint EstimatedTimeRaw { get; private set; } @@ -163,6 +163,19 @@ public float Level return 100.0f * ((float)this.RemainingCapacity / this.MaximumCapacity); } } + + /// + /// Gets the remaining battery time left, as a TimeSpan. + /// Will be 0 if the device has no battery. + /// Will be 0xFFFF,FFFF (around 138 years) if the device is charging. + /// + public TimeSpan EstimatedTime + { + get + { + return new TimeSpan(0,0,(int)EstimatedTimeRaw); + } + } } /// diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/TaskManager.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/TaskManager.cs index 1344de63..54af85a3 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/TaskManager.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/TaskManager.cs @@ -24,7 +24,7 @@ public partial class DevicePortal /// Application ID /// The name of the application package. /// Process identifier for the application instance. - public async Task LaunchApplicationAsync( + public async Task LaunchApplicationAsync( string appid, string packageName) { @@ -39,7 +39,7 @@ await this.PostAsync( RunningProcesses runningApps = await this.GetRunningProcessesAsync(); - int processId = 0; + uint processId = 0; foreach (DeviceProcessInfo process in runningApps.Processes) { if (string.Compare(process.PackageFullName, packageName) == 0) diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/DevicePortal.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/DevicePortal.cs index 41403c5e..d997598d 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/DevicePortal.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/DevicePortal.cs @@ -175,6 +175,7 @@ public string PlatformName } } + /// /// Connects to the device pointed to by IDevicePortalConnection provided in the constructor. /// diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Exceptions/DevicePortalException.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Exceptions/DevicePortalException.cs index 11eea2a5..7ecba034 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Exceptions/DevicePortalException.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Exceptions/DevicePortalException.cs @@ -151,9 +151,7 @@ public static async Task CreateAsync( if (dataStream != null) { - DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(HttpErrorResponse)); - - HttpErrorResponse errorResponse = (HttpErrorResponse)serializer.ReadObject(dataStream); + HttpErrorResponse errorResponse = DevicePortal.ReadJsonStream(dataStream); error.HResult = errorResponse.ErrorCode; error.Reason = errorResponse.ErrorMessage; @@ -168,8 +166,6 @@ public static async Task CreateAsync( { error.Reason = errorResponse.Reason; } - - dataStream.Dispose(); } } } diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/ResponseHelpers.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/ResponseHelpers.cs index 627df38f..9e1282a9 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/ResponseHelpers.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/ResponseHelpers.cs @@ -4,7 +4,12 @@ // //---------------------------------------------------------------------------------------------- +using System; +using System.Diagnostics; +using System.IO; using System.Runtime.Serialization; +using System.Runtime.Serialization.Json; +using System.Text.RegularExpressions; namespace Microsoft.Tools.WindowsDevicePortal { @@ -13,6 +18,86 @@ namespace Microsoft.Tools.WindowsDevicePortal /// public partial class DevicePortal { + // + /// The prefix for the JSON formatting error. + /// + private static readonly string SysPerfInfoErrorPrefix = "{\"Reason\" : \""; + + /// + /// The postfix for the JSON formatting error. + /// + private static readonly string SysPerfInfoErrorPostfix = "\"}"; + + /// + /// Checks the JSON for any known formatting errors and fixes them. + /// + /// Return type for the JSON message + /// The stream that contains the JSON message to be checked. + private static void JsonFormatCheck(Stream jsonStream) + { + if (typeof(T) == typeof(SystemPerformanceInformation)) + { + StreamReader read = new StreamReader(jsonStream); + string rawJsonString = read.ReadToEnd(); + + // Recover from an error in which SystemPerformanceInformation is returned with an incorrect prefix, postfix and the message converted into JSON a second time. + if (rawJsonString.StartsWith(SysPerfInfoErrorPrefix, StringComparison.OrdinalIgnoreCase) && rawJsonString.EndsWith(SysPerfInfoErrorPostfix, StringComparison.OrdinalIgnoreCase)) + { + // Remove the incorrect prefix and postfix from the JSON message. + rawJsonString = rawJsonString.Substring(SysPerfInfoErrorPrefix.Length, rawJsonString.Length - SysPerfInfoErrorPrefix.Length - SysPerfInfoErrorPostfix.Length); + + // Undo the second JSON conversion. + rawJsonString = Regex.Replace(rawJsonString, "\\\\\"", "\"", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); + rawJsonString = Regex.Replace(rawJsonString, "\\\\\\\\", "\\", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); + + // Overwrite the stream with the fixed JSON. + jsonStream.SetLength(0); + var sw = new StreamWriter(jsonStream); + sw.Write(rawJsonString); + sw.Flush(); + } + + jsonStream.Seek(0, SeekOrigin.Begin); + } + } + + /// + /// Reads dataStream as T. + /// + /// Return type for the JSON message + /// The stream that contains the JSON message to be checked. + /// Optional settings for JSON serialization. + public static T ReadJsonStream(Stream dataStream, DataContractJsonSerializerSettings settings = null) + { + T data = default(T); + object response = null; + DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(T), settings); + + using (dataStream) + { + if ((dataStream != null) && + (dataStream.Length != 0)) + { + JsonFormatCheck(dataStream); + + try + { + response = serializer.ReadObject(dataStream); + } + catch (SerializationException) + { + // Assert on serialization failure. + Debug.Assert(false); + throw; + } + + data = (T)response; + } + } + + return data; + } + #region Data contract /// diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/RestDelete.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/RestDelete.cs index 15d907aa..71045e74 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/RestDelete.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/RestDelete.cs @@ -24,7 +24,7 @@ public partial class DevicePortal /// The relative portion of the uri path that specifies the API to call. /// The query string portion of the uri path that provides the parameterized data. /// Task tracking the HTTP completion. - private async Task DeleteAsync( + public async Task DeleteAsync( string apiPath, string payload = null) { @@ -38,32 +38,16 @@ private async Task DeleteAsync( /// The relative portion of the uri path that specifies the API to call. /// The query string portion of the uri path that provides the parameterized data. /// Task tracking the HTTP completion. - private async Task DeleteAsync( + public async Task DeleteAsync( string apiPath, string payload = null) where T : new() { - T data = default(T); - Uri uri = Utilities.BuildEndpoint( this.deviceConnection.Connection, apiPath, payload); - DataContractJsonSerializer deserializer = new DataContractJsonSerializer(typeof(T)); - - using (Stream dataStream = await this.DeleteAsync(uri)) - { - if ((dataStream != null) && - (dataStream.Length != 0)) - { - JsonFormatCheck(dataStream); - - object response = deserializer.ReadObject(dataStream); - data = (T)response; - } - } - - return data; + return ReadJsonStream(await this.DeleteAsync(uri)); } } } diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/RestGet.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/RestGet.cs index 8f5b4c31..85aeb315 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/RestGet.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/RestGet.cs @@ -20,49 +20,6 @@ namespace Microsoft.Tools.WindowsDevicePortal /// public partial class DevicePortal { - /// - /// The prefix for the JSON formatting error. - /// - private static readonly string SysPerfInfoErrorPrefix = "{\"Reason\" : \""; - - /// - /// The postfix for the JSON formatting error. - /// - private static readonly string SysPerfInfoErrorPostfix = "\"}"; - - /// - /// Checks the JSON for any known formatting errors and fixes them. - /// - /// Return type for the JSON message - /// The stream that contains the JSON message to be checked. - private static void JsonFormatCheck(Stream jsonStream) - { - if (typeof(T) == typeof(SystemPerformanceInformation)) - { - StreamReader read = new StreamReader(jsonStream); - string rawJsonString = read.ReadToEnd(); - - // Recover from an error in which SystemPerformanceInformation is returned with an incorrect prefix, postfix and the message converted into JSON a second time. - if (rawJsonString.StartsWith(SysPerfInfoErrorPrefix, StringComparison.OrdinalIgnoreCase) && rawJsonString.EndsWith(SysPerfInfoErrorPostfix, StringComparison.OrdinalIgnoreCase)) - { - // Remove the incorrect prefix and postfix from the JSON message. - rawJsonString = rawJsonString.Substring(SysPerfInfoErrorPrefix.Length, rawJsonString.Length - SysPerfInfoErrorPrefix.Length - SysPerfInfoErrorPostfix.Length); - - // Undo the second JSON conversion. - rawJsonString = Regex.Replace(rawJsonString, "\\\\\"", "\"", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); - rawJsonString = Regex.Replace(rawJsonString, "\\\\\\\\", "\\", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); - - // Overwrite the stream with the fixed JSON. - jsonStream.SetLength(0); - var sw = new StreamWriter(jsonStream); - sw.Write(rawJsonString); - sw.Flush(); - } - - jsonStream.Seek(0, SeekOrigin.Begin); - } - } - /// /// Calls the specified API with the provided payload. /// @@ -70,32 +27,16 @@ private static void JsonFormatCheck(Stream jsonStream) /// The relative portion of the uri path that specifies the API to call. /// The query string portion of the uri path that provides the parameterized data. /// An object of the specified type containing the data returned by the request. - private async Task GetAsync( + public async Task GetAsync( string apiPath, string payload = null) where T : new() { - T data = default(T); - Uri uri = Utilities.BuildEndpoint( this.deviceConnection.Connection, apiPath, payload); - DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(T)); - - using (Stream dataStream = await this.GetAsync(uri).ConfigureAwait(false)) - { - if ((dataStream != null) && - (dataStream.Length != 0)) - { - JsonFormatCheck(dataStream); - - object response = serializer.ReadObject(dataStream); - data = (T)response; - } - } - - return data; + return ReadJsonStream(await this.GetAsync(uri).ConfigureAwait(false)); } } } diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/RestPost.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/RestPost.cs index 9b8439e2..4c66c990 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/RestPost.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/RestPost.cs @@ -27,7 +27,7 @@ public partial class DevicePortal /// List of files that we want to include in the post request. /// The query string portion of the uri path that provides the parameterized data. /// Task tracking the POST completion. - private async Task PostAsync( + public async Task PostAsync( string apiPath, List files, string payload = null) @@ -65,7 +65,7 @@ private async Task PostAsync( /// The relative portion of the uri path that specifies the API to call. /// The query string portion of the uri path that provides the parameterized data. /// Task tracking the POST completion. - private async Task PostAsync( + public async Task PostAsync( string apiPath, string payload = null) { @@ -81,34 +81,18 @@ private async Task PostAsync( /// Optional stream containing data for the request body. /// The type of that request body data. /// Task tracking the POST completion. - private async Task PostAsync( + public async Task PostAsync( string apiPath, string payload = null, Stream requestStream = null, string requestStreamContentType = null) where T : new() { - T data = default(T); - Uri uri = Utilities.BuildEndpoint( this.deviceConnection.Connection, apiPath, payload); - DataContractJsonSerializer deserializer = new DataContractJsonSerializer(typeof(T)); - - using (Stream dataStream = await this.PostAsync(uri, requestStream, requestStreamContentType)) - { - if ((dataStream != null) && - (dataStream.Length != 0)) - { - JsonFormatCheck(dataStream); - - object response = deserializer.ReadObject(dataStream); - data = (T)response; - } - } - - return data; + return ReadJsonStream(await this.PostAsync(uri, requestStream, requestStreamContentType)); } } } diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/RestPut.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/RestPut.cs index 4cc6490a..b9759cfa 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/RestPut.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/RestPut.cs @@ -41,7 +41,7 @@ public partial class DevicePortal /// The data to be used for the HTTP request body. /// The query string portion of the uri path that provides the parameterized data. /// Task tracking the PUT completion. - private async Task PutAsync( + public async Task PutAsync( string apiPath, K bodyData, string payload = null) where K : class @@ -58,14 +58,12 @@ private async Task PutAsync( /// The data to be used for the HTTP request body. /// The query string portion of the uri path that provides the parameterized data. /// Task tracking the PUT completion, optional response body. - private async Task PutAsync( + public async Task PutAsync( string apiPath, K bodyData = null, string payload = null) where T : new() where K : class { - T data = default(T); - Uri uri = Utilities.BuildEndpoint( this.deviceConnection.Connection, apiPath, @@ -94,21 +92,7 @@ private async Task PutAsync( #endif // WINDOWS_UWP } - DataContractJsonSerializer deserializer = new DataContractJsonSerializer(typeof(T)); - - using (Stream dataStream = await this.PutAsync(uri, streamContent)) - { - if ((dataStream != null) && - (dataStream.Length != 0)) - { - JsonFormatCheck(dataStream); - - object response = deserializer.ReadObject(dataStream); - data = (T)response; - } - } - - return data; + return ReadJsonStream(await this.PutAsync(uri, streamContent)); } } } diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/WebSocket.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/WebSocket.cs index 1a49e754..8328e0c1 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/WebSocket.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/WebSocket.cs @@ -5,7 +5,9 @@ //---------------------------------------------------------------------------------------------- using System; +using System.Diagnostics; using System.IO; +using System.Runtime.Serialization; using System.Runtime.Serialization.Json; using System.Threading.Tasks; @@ -151,20 +153,16 @@ private void ConvertStreamToMessage(Stream stream) } else { - using (stream) + DataContractJsonSerializerSettings settings = new DataContractJsonSerializerSettings() { - DataContractJsonSerializerSettings settings = new DataContractJsonSerializerSettings() - { - UseSimpleDictionaryFormat = true - }; - DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(T), settings); + UseSimpleDictionaryFormat = true + }; - T message = (T)serializer.ReadObject(stream); + T message = DevicePortal.ReadJsonStream(stream, settings); - this.WebSocketMessageReceived?.Invoke( - this, - new WebSocketMessageReceivedEventArgs(message)); - } + this.WebSocketMessageReceived?.Invoke( + this, + new WebSocketMessageReceivedEventArgs(message)); } } } diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Xbox/XboxSettings.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Xbox/XboxSettings.cs index 8af1abb9..ff648150 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Xbox/XboxSettings.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Xbox/XboxSettings.cs @@ -9,6 +9,7 @@ using System.IO; using System.Runtime.Serialization; using System.Threading.Tasks; +using static Microsoft.Tools.WindowsDevicePortal.DevicePortal; namespace Microsoft.Tools.WindowsDevicePortal { diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/Core/AppDeployment.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/Core/AppDeployment.cs index 759ed2da..2a1ec603 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/Core/AppDeployment.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/Core/AppDeployment.cs @@ -76,9 +76,7 @@ public async Task GetInstallStatusAsync() if (dataStream != null) { - DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(HttpErrorResponse)); - - HttpErrorResponse errorResponse = (HttpErrorResponse)serializer.ReadObject(dataStream); + HttpErrorResponse errorResponse = DevicePortal.ReadJsonStream(dataStream); if (errorResponse.Success) { diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/DevicePortalWrapperUniversal.snk b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/DevicePortalWrapperUniversal.snk new file mode 100644 index 00000000..7ebbdab2 Binary files /dev/null and b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/DevicePortalWrapperUniversal.snk differ diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/HttpRest/RestDelete.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/HttpRest/RestDelete.cs index 08e16f73..3d098c7e 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/HttpRest/RestDelete.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/HttpRest/RestDelete.cs @@ -28,7 +28,7 @@ public partial class DevicePortal /// The uri to which the delete request will be issued. /// Task tracking HTTP completion #pragma warning disable 1998 - private async Task DeleteAsync(Uri uri) + public async Task DeleteAsync(Uri uri) { IBuffer dataBuffer = null; diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/HttpRest/RestGet.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/HttpRest/RestGet.cs index 394b93cc..353eaa57 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/HttpRest/RestGet.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/HttpRest/RestGet.cs @@ -28,7 +28,7 @@ public partial class DevicePortal /// The uri to which the get request will be issued. /// Response data as a stream. #pragma warning disable 1998 - private async Task GetAsync(Uri uri) + public async Task GetAsync(Uri uri) { IBuffer dataBuffer = null; diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/HttpRest/RestPost.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/HttpRest/RestPost.cs index 291422c1..fb7bd4b5 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/HttpRest/RestPost.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/HttpRest/RestPost.cs @@ -30,7 +30,7 @@ public partial class DevicePortal /// The type of that request body data. /// Task tracking the completion of the POST request #pragma warning disable 1998 - private async Task PostAsync( + public async Task PostAsync( Uri uri, Stream requestStream = null, string requestStreamContentType = null) diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/HttpRest/RestPut.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/HttpRest/RestPut.cs index 6b785769..486f3af3 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/HttpRest/RestPut.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/HttpRest/RestPut.cs @@ -29,7 +29,7 @@ public partial class DevicePortal /// The HTTP content comprising the body of the request. /// Task tracking the PUT completion. #pragma warning disable 1998 - private async Task PutAsync( + public async Task PutAsync( Uri uri, IHttpContent body = null) { diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/Properties/AssemblyInfo.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/Properties/AssemblyInfo.cs index d500d05c..4f10e5b1 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/Properties/AssemblyInfo.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/Properties/AssemblyInfo.cs @@ -29,6 +29,6 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.9.4.0")] -[assembly: AssemblyFileVersion("0.9.4.0")] +[assembly: AssemblyVersion("0.9.5.0")] +[assembly: AssemblyFileVersion("0.9.5.0")] [assembly: ComVisible(false)] \ No newline at end of file diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/WindowsDevicePortalWrapper.UniversalWindows.csproj b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/WindowsDevicePortalWrapper.UniversalWindows.csproj index ffe721e5..c3efac3b 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/WindowsDevicePortalWrapper.UniversalWindows.csproj +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/WindowsDevicePortalWrapper.UniversalWindows.csproj @@ -28,8 +28,6 @@ DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP prompt 4 - - AnyCPU @@ -107,8 +105,18 @@ false prompt + + true + + + false + + + DevicePortalWrapperUniversal.snk + + @@ -138,4 +146,4 @@ --> - \ No newline at end of file + diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.sln b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.sln index 969b2ad9..e1e9ea56 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.sln +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 +# Visual Studio 15 +VisualStudioVersion = 15.0.26403.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsDevicePortalWrapper", "WindowsDevicePortalWrapper\WindowsDevicePortalWrapper.csproj", "{6A9E862E-5CDA-4A8A-BBC0-56E9EA921E39}" EndProject @@ -25,6 +25,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XboxWdpDriver", "..\Samples EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleWdpClient", "..\Samples\SampleWdpClient\SampleWdpClient.csproj", "{7E0481EB-514A-4292-AD1D-3A3EAF38D359}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utilities", "Utilities", "{0A85BE2B-52BE-4ACD-A332-991B3B81ED49}" + ProjectSection(SolutionItems) = preProject + Utilities\signConfig.xml = Utilities\signConfig.xml + Utilities\WindowsDevicePortalWrapper.nuspec = Utilities\WindowsDevicePortalWrapper.nuspec + EndProjectSection +EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution WindowsDevicePortalWrapper.Shared\WindowsDevicePortalWrapper.Shared.projitems*{4fc7c762-adbe-4a0a-882d-10771cd8bd55}*SharedItemsImports = 4 diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper/DevicePortalWrapperNet.snk b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper/DevicePortalWrapperNet.snk new file mode 100644 index 00000000..d731e9f8 Binary files /dev/null and b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper/DevicePortalWrapperNet.snk differ diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper/HttpRest/RestDelete.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper/HttpRest/RestDelete.cs index c04905d4..12e85497 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper/HttpRest/RestDelete.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper/HttpRest/RestDelete.cs @@ -22,7 +22,7 @@ public partial class DevicePortal /// /// The uri to which the delete request will be issued. /// Task tracking HTTP completion - private async Task DeleteAsync(Uri uri) + public async Task DeleteAsync(Uri uri) { MemoryStream dataStream = null; diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper/HttpRest/RestGet.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper/HttpRest/RestGet.cs index d4b29e43..78dc22a7 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper/HttpRest/RestGet.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper/HttpRest/RestGet.cs @@ -21,7 +21,7 @@ public partial class DevicePortal /// /// The uri to which the get request will be issued. /// Response data as a stream. - private async Task GetAsync( + public async Task GetAsync( Uri uri) { MemoryStream dataStream = null; diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper/HttpRest/RestPost.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper/HttpRest/RestPost.cs index ad0679ca..069c77fb 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper/HttpRest/RestPost.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper/HttpRest/RestPost.cs @@ -24,7 +24,7 @@ public partial class DevicePortal /// Optional stream containing data for the request body. /// The type of that request body data. /// Task tracking the completion of the POST request - private async Task PostAsync( + public async Task PostAsync( Uri uri, Stream requestStream = null, string requestStreamContentType = null) diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper/HttpRest/RestPut.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper/HttpRest/RestPut.cs index ee58a4e8..a85ed32b 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper/HttpRest/RestPut.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper/HttpRest/RestPut.cs @@ -23,7 +23,7 @@ public partial class DevicePortal /// The uri to which the put request will be issued. /// The HTTP content comprising the body of the request. /// Task tracking the PUT completion. - private async Task PutAsync( + public async Task PutAsync( Uri uri, HttpContent body = null) { diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper/Properties/AssemblyInfo.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper/Properties/AssemblyInfo.cs index b4e48d18..26a5510e 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper/Properties/AssemblyInfo.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper/Properties/AssemblyInfo.cs @@ -37,5 +37,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.9.4.0")] -[assembly: AssemblyFileVersion("0.9.4.0")] \ No newline at end of file +[assembly: AssemblyVersion("0.9.5.0")] +[assembly: AssemblyFileVersion("0.9.5.0")] \ No newline at end of file diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.csproj b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.csproj index 8395aaee..8b614814 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.csproj +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.csproj @@ -22,8 +22,6 @@ DEBUG;TRACE prompt 4 - - pdbonly @@ -32,7 +30,16 @@ TRACE prompt 4 - bin\Release\WindowsDevicePortalWrapper.xml + bin\Release\WindowsDevicePortalWrapper.xml + + + true + + + DevicePortalWrapperNet.snk + + + false @@ -57,7 +64,9 @@ - + + + @@ -68,4 +77,4 @@ --> - \ No newline at end of file +