From d2a3ca8f4eea828ca63f6c44beae0ed83df51541 Mon Sep 17 00:00:00 2001 From: Hirsch Singhal Date: Mon, 10 Oct 2016 17:18:35 -0700 Subject: [PATCH 1/2] Breaking Change: Updating async methods to follow C# async naming conventions And updating version number. --- .../MainPage.xaml.cs | 14 +-- Samples/SampleWdpClient/MainWindow.xaml.cs | 12 +-- .../XboxWdpDriver/Operations/AppOperation.cs | 8 +- .../Operations/ConfigOperation.cs | 6 +- .../Operations/FiddlerOperation.cs | 6 +- .../XboxWdpDriver/Operations/FileOperation.cs | 12 +-- .../Operations/InstallOperation.cs | 12 +-- .../Operations/ListProcessesOperation.cs | 6 +- .../Operations/SandboxOperation.cs | 6 +- .../Operations/ScreenshotOperation.cs | 2 +- .../Operations/SystemPerfOperation.cs | 6 +- .../XboxWdpDriver/Operations/UserOperation.cs | 4 +- Samples/XboxWdpDriver/Program.cs | 6 +- .../MockDataGenerator/Program.cs | 10 +- .../Core/AppFileExplorerTests.cs | 14 +-- .../Core/OsInformationTests.cs | 2 +- .../Core/PerformanceDataTests.cs | 18 ++-- .../HoloLens/HoloLensHelpers.cs | 4 +- .../HoloLens/HoloLens_rs1_release.cs | 18 ++-- .../IoT/IoT_rs1_release.cs | 94 +++++++++---------- .../XboxOne/XboxHelpers.cs | 2 +- .../XboxOne/XboxOne_rs1_xbox_rel_1608.cs | 52 +++++----- .../UnitTestProject/TestHelpers.cs | 2 +- .../WDPMockImplementations/AppDeployment.cs | 2 +- .../WDPMockImplementations/RestDelete.cs | 4 +- .../WDPMockImplementations/RestGet.cs | 4 +- .../WDPMockImplementations/RestPost.cs | 4 +- .../WDPMockImplementations/RestPut.cs | 2 +- .../WDPMockImplementations/WebSocket.cs | 4 +- .../Core/AppDeployment.cs | 18 ++-- .../Core/AppFileExplorer.cs | 24 ++--- .../Core/DeviceManager.cs | 4 +- .../Core/Dns-Sd.cs | 20 ++-- .../Core/Networking.cs | 4 +- .../Core/OsInformation.cs | 16 ++-- .../Core/PerformanceData.cs | 24 ++--- .../Core/Power.cs | 12 +-- .../Core/RemoteControl.cs | 8 +- .../Core/TaskManager.cs | 10 +- .../Core/WiFiManagement.cs | 12 +-- .../DevicePortal.cs | 28 +++--- .../HoloLens/HolographicOs.cs | 16 ++-- .../HoloLens/HolographicPerception.cs | 8 +- .../HoloLens/HolographicThermal.cs | 4 +- .../HoloLens/MixedRealityCapture.cs | 34 +++---- .../HoloLens/PerceptionSimulationPlayback.cs | 16 ++-- .../HoloLens/PerceptionSimulationRecording.cs | 12 +-- .../HttpRest/RestDelete.cs | 8 +- .../HttpRest/RestGet.cs | 4 +- .../HttpRest/RestPost.cs | 12 +-- .../HttpRest/RestPut.cs | 8 +- .../HttpRest/WebSocket.cs | 9 +- .../IoT/ApplicationManager.cs | 24 ++--- .../IoT/AudioDevices.cs | 12 +-- .../IoT/BluetoothConnectivity.cs | 40 ++++---- .../IoT/DeviceInfo.cs | 52 +++++----- .../IoT/IcsManager.cs | 12 +-- .../IoT/IoTOnboarding.cs | 16 ++-- .../IoT/Limpet.cs | 28 +++--- .../IoT/ProcessManagement.cs | 8 +- .../IoT/RemoteSettings.cs | 12 +-- .../IoT/WindowsUpdate.cs | 8 +- .../Xbox/FiddlerSetup.cs | 10 +- .../Xbox/SmbShare.cs | 4 +- .../Xbox/UserManagement.cs | 10 +- .../Xbox/XboxAppDeployment.cs | 10 +- .../Xbox/XboxLiveSandbox.cs | 8 +- .../Xbox/XboxMediaCapture.cs | 4 +- .../Xbox/XboxSettings.cs | 12 +-- .../CertificateHandling.cs | 2 +- .../Core/AppDeployment.cs | 2 +- .../HttpRest/RestDelete.cs | 4 +- .../HttpRest/RestGet.cs | 4 +- .../HttpRest/RestPost.cs | 4 +- .../HttpRest/RestPut.cs | 4 +- .../HttpRest/WebSocket.cs | 4 +- .../Properties/AssemblyInfo.cs | 4 +- ...evicePortalWrapper.UniversalWindows.csproj | 4 +- .../CertificateHandling.cs | 4 +- .../Core/AppDeployment.cs | 2 +- .../HttpRest/RestDelete.cs | 4 +- .../HttpRest/RestGet.cs | 4 +- .../HttpRest/RestPost.cs | 4 +- .../HttpRest/RestPut.cs | 4 +- .../HttpRest/WebSocket.cs | 12 +-- .../Properties/AssemblyInfo.cs | 4 +- 86 files changed, 493 insertions(+), 494 deletions(-) diff --git a/Samples/SampleWdpClient.UniversalWindows/MainPage.xaml.cs b/Samples/SampleWdpClient.UniversalWindows/MainPage.xaml.cs index dfbd7364..fca8e65a 100644 --- a/Samples/SampleWdpClient.UniversalWindows/MainPage.xaml.cs +++ b/Samples/SampleWdpClient.UniversalWindows/MainPage.xaml.cs @@ -113,9 +113,9 @@ private void ConnectToDevice_Click(object sender, RoutedEventArgs e) // remainder of this session. if (allowUntrusted) { - this.certificate = await portal.GetRootDeviceCertificate(true); + this.certificate = await portal.GetRootDeviceCertificateAsync(true); } - await portal.Connect(manualCertificate: this.certificate); + await portal.ConnectAsync(manualCertificate: this.certificate); } catch (Exception exception) { @@ -195,7 +195,7 @@ private void GetIPConfig_Click(object sender, RoutedEventArgs e) try { - IpConfiguration ipconfig = await portal.GetIpConfig(); + IpConfiguration ipconfig = await portal.GetIpConfigAsync(); foreach (NetworkAdapterInfo adapterInfo in ipconfig.Adapters) { @@ -251,7 +251,7 @@ private void GetWifiInfo_Click(object sender, RoutedEventArgs e) try { - WifiInterfaces wifiInterfaces = await portal.GetWifiInterfaces(); + WifiInterfaces wifiInterfaces = await portal.GetWifiInterfacesAsync(); sb.AppendLine("WiFi Interfaces:"); foreach (WifiInterface wifiInterface in wifiInterfaces.Interfaces) { @@ -260,7 +260,7 @@ private void GetWifiInfo_Click(object sender, RoutedEventArgs e) sb.Append(" GUID: "); sb.AppendLine(wifiInterface.Guid.ToString()); - WifiNetworks wifiNetworks = await portal.GetWifiNetworks(wifiInterface.Guid); + WifiNetworks wifiNetworks = await portal.GetWifiNetworksAsync(wifiInterface.Guid); sb.AppendLine(" Networks:"); foreach (WifiNetworkInfo network in wifiNetworks.AvailableNetworks) { @@ -394,7 +394,7 @@ private void RebootDevice_Click(object sender, RoutedEventArgs e) try { - await portal.Reboot(); + await portal.RebootAsync(); } catch (Exception ex) { @@ -438,7 +438,7 @@ private void ShutdownDevice_Click(object sender, RoutedEventArgs e) try { - await portal.Shutdown(); + await portal.ShutdownAsync(); } catch (Exception ex) { diff --git a/Samples/SampleWdpClient/MainWindow.xaml.cs b/Samples/SampleWdpClient/MainWindow.xaml.cs index 7c5c8ed0..3bb0ca3c 100644 --- a/Samples/SampleWdpClient/MainWindow.xaml.cs +++ b/Samples/SampleWdpClient/MainWindow.xaml.cs @@ -115,7 +115,7 @@ private void ConnectToDevice_Click(object sender, RoutedEventArgs e) } }; - await portal.Connect(); + await portal.ConnectAsync(); this.MarshalUpdateCommandOutput(sb.ToString()); }); @@ -190,7 +190,7 @@ private void GetIPConfig_Click(object sender, RoutedEventArgs e) try { - IpConfiguration ipconfig = await portal.GetIpConfig(); + IpConfiguration ipconfig = await portal.GetIpConfigAsync(); foreach (NetworkAdapterInfo adapterInfo in ipconfig.Adapters) { @@ -247,7 +247,7 @@ private void GetWifiInfo_Click(object sender, RoutedEventArgs e) try { - WifiInterfaces wifiInterfaces = await portal.GetWifiInterfaces(); + WifiInterfaces wifiInterfaces = await portal.GetWifiInterfacesAsync(); sb.AppendLine("WiFi Interfaces:"); foreach (WifiInterface wifiInterface in wifiInterfaces.Interfaces) { @@ -256,7 +256,7 @@ private void GetWifiInfo_Click(object sender, RoutedEventArgs e) sb.Append(" GUID: "); sb.AppendLine(wifiInterface.Guid.ToString()); - WifiNetworks wifiNetworks = await portal.GetWifiNetworks(wifiInterface.Guid); + WifiNetworks wifiNetworks = await portal.GetWifiNetworksAsync(wifiInterface.Guid); sb.AppendLine(" Networks:"); foreach (WifiNetworkInfo network in wifiNetworks.AvailableNetworks) { @@ -387,7 +387,7 @@ private void RebootDevice_Click(object sender, RoutedEventArgs e) try { - await this.portal.Reboot(); + await this.portal.RebootAsync(); } catch(Exception ex) { @@ -432,7 +432,7 @@ private void ShutdownDevice_Click(object sender, RoutedEventArgs e) try { - await this.portal.Shutdown(); + await this.portal.ShutdownAsync(); } catch(Exception ex) { diff --git a/Samples/XboxWdpDriver/Operations/AppOperation.cs b/Samples/XboxWdpDriver/Operations/AppOperation.cs index 73c31e70..4b9a6067 100644 --- a/Samples/XboxWdpDriver/Operations/AppOperation.cs +++ b/Samples/XboxWdpDriver/Operations/AppOperation.cs @@ -65,7 +65,7 @@ public static void HandleOperation(DevicePortal portal, ParameterHelper paramete { if (operationType.Equals("list")) { - Task packagesTask = portal.GetInstalledAppPackages(); + Task packagesTask = portal.GetInstalledAppPackagesAsync(); packagesTask.Wait(); Console.WriteLine(packagesTask.Result); @@ -101,21 +101,21 @@ public static void HandleOperation(DevicePortal portal, ParameterHelper paramete return; } - Task launchTask = portal.LaunchApplication(aumid, packageFullName); + Task launchTask = portal.LaunchApplicationAsync(aumid, packageFullName); launchTask.Wait(); Console.WriteLine("Application launched."); } else if (operationType.Equals("terminate")) { - Task terminateTask = portal.TerminateApplication(packageFullName); + Task terminateTask = portal.TerminateApplicationAsync(packageFullName); terminateTask.Wait(); Console.WriteLine("Application terminated."); } else if (operationType.Equals("uninstall")) { - Task uninstallTask = portal.UninstallApplication(packageFullName); + Task uninstallTask = portal.UninstallApplicationAsync(packageFullName); uninstallTask.Wait(); Console.WriteLine("Application uninstalled."); diff --git a/Samples/XboxWdpDriver/Operations/ConfigOperation.cs b/Samples/XboxWdpDriver/Operations/ConfigOperation.cs index cf3739b9..a1d32034 100644 --- a/Samples/XboxWdpDriver/Operations/ConfigOperation.cs +++ b/Samples/XboxWdpDriver/Operations/ConfigOperation.cs @@ -46,7 +46,7 @@ public static void HandleOperation(DevicePortal portal, ParameterHelper paramete // Determine if this is for all settings or a single setting. if (string.IsNullOrWhiteSpace(desiredSetting)) { - Task getSettingsTask = portal.GetXboxSettings(); + Task getSettingsTask = portal.GetXboxSettingsAsync(); getSettingsTask.Wait(); Console.WriteLine(getSettingsTask.Result); @@ -55,7 +55,7 @@ public static void HandleOperation(DevicePortal portal, ParameterHelper paramete { if (string.IsNullOrWhiteSpace(desiredValue)) { - Task getSettingTask = portal.GetXboxSetting(desiredSetting); + Task getSettingTask = portal.GetXboxSettingAsync(desiredSetting); getSettingTask.Wait(); Console.WriteLine(getSettingTask.Result); @@ -66,7 +66,7 @@ public static void HandleOperation(DevicePortal portal, ParameterHelper paramete setting.Name = desiredSetting; setting.Value = desiredValue; - Task setSettingTask = portal.UpdateXboxSetting(setting); + Task setSettingTask = portal.UpdateXboxSettingAsync(setting); setSettingTask.Wait(); Console.WriteLine(setSettingTask.Result); diff --git a/Samples/XboxWdpDriver/Operations/FiddlerOperation.cs b/Samples/XboxWdpDriver/Operations/FiddlerOperation.cs index 6a8d0474..ef226f48 100644 --- a/Samples/XboxWdpDriver/Operations/FiddlerOperation.cs +++ b/Samples/XboxWdpDriver/Operations/FiddlerOperation.cs @@ -65,13 +65,13 @@ public static void HandleOperation(DevicePortal portal, ParameterHelper paramete return; } - Task fiddlerEnableTask = portal.EnableFiddlerTracing(proxyAddress, proxyPort, parameters.GetParameterValue("certpath")); + Task fiddlerEnableTask = portal.EnableFiddlerTracingAsync(proxyAddress, proxyPort, parameters.GetParameterValue("certpath")); fiddlerEnableTask.Wait(); Console.WriteLine("Fiddler enabled."); } else if (string.Equals(state, "off", StringComparison.OrdinalIgnoreCase)) { - Task fiddlerDisableTask = portal.DisableFiddlerTracing(); + Task fiddlerDisableTask = portal.DisableFiddlerTracingAsync(); fiddlerDisableTask.Wait(); Console.WriteLine("Fiddler disabled."); } @@ -85,7 +85,7 @@ public static void HandleOperation(DevicePortal portal, ParameterHelper paramete if (parameters.HasFlag("reboot")) { - Task rebootTask = portal.Reboot(); + Task rebootTask = portal.RebootAsync(); rebootTask.Wait(); Console.WriteLine("Console rebooting..."); } diff --git a/Samples/XboxWdpDriver/Operations/FileOperation.cs b/Samples/XboxWdpDriver/Operations/FileOperation.cs index 8b0363ef..34c5c585 100644 --- a/Samples/XboxWdpDriver/Operations/FileOperation.cs +++ b/Samples/XboxWdpDriver/Operations/FileOperation.cs @@ -67,7 +67,7 @@ public static void HandleOperation(DevicePortal portal, ParameterHelper paramete { if (operationType.Equals("knownfolders")) { - Task getKnownFoldersTask = portal.GetKnownFolders(); + Task getKnownFoldersTask = portal.GetKnownFoldersAsync(); getKnownFoldersTask.Wait(); Console.WriteLine(getKnownFoldersTask.Result); @@ -84,7 +84,7 @@ public static void HandleOperation(DevicePortal portal, ParameterHelper paramete if (operationType.Equals("dir")) { - Task getDirectoryContents = portal.GetFolderContents(knownFolderId, subPath, packageFullName); + Task getDirectoryContents = portal.GetFolderContentsAsync(knownFolderId, subPath, packageFullName); getDirectoryContents.Wait(); Console.WriteLine(getDirectoryContents.Result); @@ -101,7 +101,7 @@ public static void HandleOperation(DevicePortal portal, ParameterHelper paramete return; } - Task uploadFileTask = portal.UploadFile(knownFolderId, filepath, subPath, packageFullName); + Task uploadFileTask = portal.UploadFileAsync(knownFolderId, filepath, subPath, packageFullName); uploadFileTask.Wait(); Console.WriteLine(string.Format("{0} uploaded.", filepath)); @@ -132,7 +132,7 @@ public static void HandleOperation(DevicePortal portal, ParameterHelper paramete destination += "/" + filename; - Task getFile = portal.GetFile(knownFolderId, filename, subPath, packageFullName); + Task getFile = portal.GetFileAsync(knownFolderId, filename, subPath, packageFullName); getFile.Wait(); @@ -155,14 +155,14 @@ public static void HandleOperation(DevicePortal portal, ParameterHelper paramete return; } - Task renameFileTask = portal.RenameFile(knownFolderId, filename, newfilename, subPath, packageFullName); + Task renameFileTask = portal.RenameFileAsync(knownFolderId, filename, newfilename, subPath, packageFullName); renameFileTask.Wait(); Console.WriteLine(string.Format("Renamed {0} to {1}.", filename, newfilename)); } else if (operationType.Equals("delete")) { - Task deleteFileTask = portal.DeleteFile(knownFolderId, filename, subPath, packageFullName); + Task deleteFileTask = portal.DeleteFileAsync(knownFolderId, filename, subPath, packageFullName); deleteFileTask.Wait(); Console.WriteLine(string.Format("Deleted {0}.", filename)); diff --git a/Samples/XboxWdpDriver/Operations/InstallOperation.cs b/Samples/XboxWdpDriver/Operations/InstallOperation.cs index 3d399a72..74ddc562 100644 --- a/Samples/XboxWdpDriver/Operations/InstallOperation.cs +++ b/Samples/XboxWdpDriver/Operations/InstallOperation.cs @@ -104,7 +104,7 @@ public static void HandleOperation(DevicePortal portal, ParameterHelper paramete if (!string.IsNullOrEmpty(appxFile)) { operation.mreAppInstall.Reset(); - Task installTask = portal.InstallApplication(null, appxFile, dependencies, certificate); + Task installTask = portal.InstallApplicationAsync(null, appxFile, dependencies, certificate); operation.mreAppInstall.WaitOne(); if (operation.installResults.Status == ApplicationInstallStatus.Completed) @@ -122,7 +122,7 @@ public static void HandleOperation(DevicePortal portal, ParameterHelper paramete foreach (string dependency in dependencies) { operation.mreAppInstall.Reset(); - Task installTask = portal.InstallApplication(null, dependency, new List()); + Task installTask = portal.InstallApplicationAsync(null, dependency, new List()); operation.mreAppInstall.WaitOne(); if (operation.installResults.Status != ApplicationInstallStatus.Completed) @@ -171,7 +171,7 @@ public static void HandleOperation(DevicePortal portal, ParameterHelper paramete { if (e.HResult == ErrorLogonFailureHresult) { - Task smbTask = portal.GetSmbShareInfo(); + Task smbTask = portal.GetSmbShareInfoAsync(); smbTask.Wait(); // Set the username/password for accessing the share. @@ -205,14 +205,14 @@ public static void HandleOperation(DevicePortal portal, ParameterHelper paramete return; } - Task registerTask = portal.RegisterApplication(destinationFolderName); + Task registerTask = portal.RegisterApplicationAsync(destinationFolderName); registerTask.Wait(); Console.WriteLine("Install complete."); } else if (!string.IsNullOrEmpty(registerPath)) { - Task registerTask = portal.RegisterApplication(registerPath); + Task registerTask = portal.RegisterApplicationAsync(registerPath); registerTask.Wait(); Console.WriteLine("Registration complete."); @@ -275,7 +275,7 @@ protected virtual void Dispose(bool disposing) /// The relative destination directory. private void UploadDirectoryOverHttp(string folderPath, string relativeDestination) { - Task uploadTask = this.portal.UploadPackageFolder(folderPath, relativeDestination); + Task uploadTask = this.portal.UploadPackageFolderAsync(folderPath, relativeDestination); uploadTask.Wait(); foreach (string subDir in Directory.GetDirectories(folderPath)) diff --git a/Samples/XboxWdpDriver/Operations/ListProcessesOperation.cs b/Samples/XboxWdpDriver/Operations/ListProcessesOperation.cs index f673d33c..a6688a62 100644 --- a/Samples/XboxWdpDriver/Operations/ListProcessesOperation.cs +++ b/Samples/XboxWdpDriver/Operations/ListProcessesOperation.cs @@ -41,19 +41,19 @@ public static void HandleOperation(DevicePortal portal, ParameterHelper paramete portal.RunningProcessesMessageReceived += runningProcessesReceivedHandler; - Task startListeningForProcessesTask = portal.StartListeningForRunningProcesses(); + Task startListeningForProcessesTask = portal.StartListeningForRunningProcessesAsync(); startListeningForProcessesTask.Wait(); runningProcessesReceived.WaitOne(); - Task stopListeningForProcessesTask = portal.StopListeningForRunningProcesses(); + Task stopListeningForProcessesTask = portal.StopListeningForRunningProcessesAsync(); stopListeningForProcessesTask.Wait(); portal.RunningProcessesMessageReceived -= runningProcessesReceivedHandler; } else { - Task getRunningProcessesTask = portal.GetRunningProcesses(); + Task getRunningProcessesTask = portal.GetRunningProcessesAsync(); runningProcesses = getRunningProcessesTask.Result; } diff --git a/Samples/XboxWdpDriver/Operations/SandboxOperation.cs b/Samples/XboxWdpDriver/Operations/SandboxOperation.cs index 4c39a463..6f9daef7 100644 --- a/Samples/XboxWdpDriver/Operations/SandboxOperation.cs +++ b/Samples/XboxWdpDriver/Operations/SandboxOperation.cs @@ -42,21 +42,21 @@ public static void HandleOperation(DevicePortal portal, ParameterHelper paramete if (string.IsNullOrEmpty(desiredValue)) { - Task getSandboxTask = portal.GetXboxLiveSandbox(); + Task getSandboxTask = portal.GetXboxLiveSandboxAsync(); getSandboxTask.Wait(); Console.WriteLine(getSandboxTask.Result); } else { - Task setSandboxTask = portal.SetXboxLiveSandbox(desiredValue); + Task setSandboxTask = portal.SetXboxLiveSandboxAsync(desiredValue); setSandboxTask.Wait(); Console.WriteLine("{0} -> {1}", setSandboxTask.Result, desiredValue); if (parameters.HasFlag("reboot")) { - Task rebootTask = portal.Reboot(); + Task rebootTask = portal.RebootAsync(); rebootTask.Wait(); Console.WriteLine("Console rebooting..."); } diff --git a/Samples/XboxWdpDriver/Operations/ScreenshotOperation.cs b/Samples/XboxWdpDriver/Operations/ScreenshotOperation.cs index 026ba8f4..afe929f7 100644 --- a/Samples/XboxWdpDriver/Operations/ScreenshotOperation.cs +++ b/Samples/XboxWdpDriver/Operations/ScreenshotOperation.cs @@ -53,7 +53,7 @@ public static void HandleOperation(DevicePortal portal, ParameterHelper paramete } else { - Task screenshotTask = portal.TakeXboxScreenshot(); + Task screenshotTask = portal.TakeXboxScreenshotAsync(); screenshotTask.Wait(); using (var fileStream = new FileStream(filepath, FileMode.Create)) diff --git a/Samples/XboxWdpDriver/Operations/SystemPerfOperation.cs b/Samples/XboxWdpDriver/Operations/SystemPerfOperation.cs index d983e5a4..3a620dcf 100644 --- a/Samples/XboxWdpDriver/Operations/SystemPerfOperation.cs +++ b/Samples/XboxWdpDriver/Operations/SystemPerfOperation.cs @@ -41,19 +41,19 @@ public static void HandleOperation(DevicePortal portal, ParameterHelper paramete portal.SystemPerfMessageReceived += systemPerfReceivedHandler; - Task startListeningForSystemPerfTask = portal.StartListeningForSystemPerf(); + Task startListeningForSystemPerfTask = portal.StartListeningForSystemPerfAsync(); startListeningForSystemPerfTask.Wait(); systemPerfReceived.WaitOne(); - Task stopListeningForSystemPerfTask = portal.StopListeningForRunningProcesses(); + Task stopListeningForSystemPerfTask = portal.StopListeningForRunningProcessesAsync(); stopListeningForSystemPerfTask.Wait(); portal.SystemPerfMessageReceived -= systemPerfReceivedHandler; } else { - Task getRunningProcessesTask = portal.GetSystemPerf(); + Task getRunningProcessesTask = portal.GetSystemPerfAsync(); systemPerformanceInformation = getRunningProcessesTask.Result; } diff --git a/Samples/XboxWdpDriver/Operations/UserOperation.cs b/Samples/XboxWdpDriver/Operations/UserOperation.cs index c52c5051..bd6b3f9d 100644 --- a/Samples/XboxWdpDriver/Operations/UserOperation.cs +++ b/Samples/XboxWdpDriver/Operations/UserOperation.cs @@ -60,7 +60,7 @@ public static void HandleOperation(DevicePortal portal, ParameterHelper paramete if (operationType.Equals("list")) { - Task getUsers = portal.GetXboxLiveUsers(); + Task getUsers = portal.GetXboxLiveUsersAsync(); getUsers.Wait(); Console.WriteLine(getUsers.Result); @@ -162,7 +162,7 @@ private static void UpdateXboxLiveUsers(DevicePortal portal, UserList userList) { try { - Task updateUsers = portal.UpdateXboxLiveUsers(userList); + Task updateUsers = portal.UpdateXboxLiveUsersAsync(userList); updateUsers.Wait(); } catch (AggregateException e) diff --git a/Samples/XboxWdpDriver/Program.cs b/Samples/XboxWdpDriver/Program.cs index 41083dc9..d438187d 100644 --- a/Samples/XboxWdpDriver/Program.cs +++ b/Samples/XboxWdpDriver/Program.cs @@ -259,7 +259,7 @@ public static void Main(string[] args) } } - Task connectTask = portal.Connect(updateConnection: false, manualCertificate: cert); + Task connectTask = portal.ConnectAsync(updateConnection: false, manualCertificate: cert); connectTask.Wait(); if (portal.ConnectionHttpStatusCode != HttpStatusCode.OK) @@ -332,7 +332,7 @@ public static void Main(string[] args) Console.WriteLine("OS version: " + portal.OperatingSystemVersion); Console.WriteLine("Platform: " + portal.PlatformName + " (" + portal.Platform.ToString() + ")"); - Task getNameTask = portal.GetDeviceName(); + Task getNameTask = portal.GetDeviceNameAsync(); getNameTask.Wait(); Console.WriteLine("Device name: " + getNameTask.Result); break; @@ -349,7 +349,7 @@ public static void Main(string[] args) break; case OperationType.RebootOperation: - Task rebootTask = portal.Reboot(); + Task rebootTask = portal.RebootAsync(); rebootTask.Wait(); Console.WriteLine("Rebooting device."); break; diff --git a/WindowsDevicePortalWrapper/MockDataGenerator/Program.cs b/WindowsDevicePortalWrapper/MockDataGenerator/Program.cs index 222c781f..fdf35088 100644 --- a/WindowsDevicePortalWrapper/MockDataGenerator/Program.cs +++ b/WindowsDevicePortalWrapper/MockDataGenerator/Program.cs @@ -103,7 +103,7 @@ public static void Main(string[] args) IDevicePortalConnection connection = new DefaultDevicePortalConnection(parameters.GetParameterValue(ParameterHelper.FullAddress), parameters.GetParameterValue(ParameterHelper.WdpUser), parameters.GetParameterValue(ParameterHelper.WdpPassword)); DevicePortal portal = new DevicePortal(connection); - Task connectTask = portal.Connect(updateConnection: false); + Task connectTask = portal.ConnectAsync(updateConnection: false); connectTask.Wait(); if (portal.ConnectionHttpStatusCode != HttpStatusCode.OK) @@ -170,7 +170,7 @@ public static void Main(string[] args) dataStream.Position = 0; string contentType = string.Format("multipart/form-data; boundary={0}", boundaryString); - Task saveResponseTask = portal.SaveEndpointResponseToFile(endpoint, directory, httpMethod, dataStream, contentType); + Task saveResponseTask = portal.SaveEndpointResponseToFileAsync(endpoint, directory, httpMethod, dataStream, contentType); saveResponseTask.Wait(); } } @@ -178,13 +178,13 @@ public static void Main(string[] args) { Stream fileStream = new FileStream(requestBodyFile, FileMode.Open); - Task saveResponseTask = portal.SaveEndpointResponseToFile(endpoint, directory, httpMethod, fileStream, "application/json"); + Task saveResponseTask = portal.SaveEndpointResponseToFileAsync(endpoint, directory, httpMethod, fileStream, "application/json"); saveResponseTask.Wait(); } } else { - Task saveResponseTask = portal.SaveEndpointResponseToFile(endpoint, directory, httpMethod); + Task saveResponseTask = portal.SaveEndpointResponseToFileAsync(endpoint, directory, httpMethod); saveResponseTask.Wait(); } } @@ -197,7 +197,7 @@ public static void Main(string[] args) try { - Task saveResponseTask = portal.SaveEndpointResponseToFile(finalEndpoint, directory, httpMethod); + Task saveResponseTask = portal.SaveEndpointResponseToFileAsync(finalEndpoint, directory, httpMethod); saveResponseTask.Wait(); } catch (Exception e) diff --git a/WindowsDevicePortalWrapper/UnitTestProject/Core/AppFileExplorerTests.cs b/WindowsDevicePortalWrapper/UnitTestProject/Core/AppFileExplorerTests.cs index 311966e3..3cfe687d 100644 --- a/WindowsDevicePortalWrapper/UnitTestProject/Core/AppFileExplorerTests.cs +++ b/WindowsDevicePortalWrapper/UnitTestProject/Core/AppFileExplorerTests.cs @@ -38,7 +38,7 @@ public void AppFileExplorerGetKnownFolderTest() TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.KnownFoldersApi, response, HttpMethods.Get); - Task getKnownFoldersTask = TestHelpers.Portal.GetKnownFolders(); + Task getKnownFoldersTask = TestHelpers.Portal.GetKnownFoldersAsync(); getKnownFoldersTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getKnownFoldersTask.Status); @@ -71,7 +71,7 @@ public void AppFileExplorerGetFolderContentsTest() TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.GetFilesApi, response, HttpMethods.Get); - Task getFolderContentsTask = TestHelpers.Portal.GetFolderContents("KnownFolderOne"); + Task getFolderContentsTask = TestHelpers.Portal.GetFolderContentsAsync("KnownFolderOne"); getFolderContentsTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getFolderContentsTask.Status); @@ -119,7 +119,7 @@ public void AppFileExplorerDownloadFileTest() TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.GetFileApi, response, HttpMethods.Get); - Task getFileTask = TestHelpers.Portal.GetFile("knownfolder", "FileToDownload.txt", "SubFolder\\SubFolder2"); + Task getFileTask = TestHelpers.Portal.GetFileAsync("knownfolder", "FileToDownload.txt", "SubFolder\\SubFolder2"); getFileTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getFileTask.Status); @@ -137,7 +137,7 @@ public void AppFileExplorerUploadFileTest() TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.GetFileApi, response, HttpMethods.Post); - Task uploadFileTask = TestHelpers.Portal.UploadFile("knownfolder", "MockData\\Defaults\\api_os_devicefamily_Default.dat", "SubFolder\\SubFolder2"); + Task uploadFileTask = TestHelpers.Portal.UploadFileAsync("knownfolder", "MockData\\Defaults\\api_os_devicefamily_Default.dat", "SubFolder\\SubFolder2"); uploadFileTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, uploadFileTask.Status); @@ -156,7 +156,7 @@ public void AppFileExplorerUploadFileTest_Failure() try { - Task uploadFileTask = TestHelpers.Portal.UploadFile("knownfolder", "NonExistentFilePath\\NonExistentFile.txt", "SubFolder\\SubFolder2"); + Task uploadFileTask = TestHelpers.Portal.UploadFileAsync("knownfolder", "NonExistentFilePath\\NonExistentFile.txt", "SubFolder\\SubFolder2"); uploadFileTask.Wait(); Assert.Fail("Should not have succeeded if uploading a file which doesn't exist."); @@ -177,7 +177,7 @@ public void AppFileExplorerDeleteFileTest() TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.GetFileApi, response, HttpMethods.Delete); - Task deleteFileTask = TestHelpers.Portal.DeleteFile("knownfolder", "FileToDelete.txt", "SubFolder\\SubFolder2"); + Task deleteFileTask = TestHelpers.Portal.DeleteFileAsync("knownfolder", "FileToDelete.txt", "SubFolder\\SubFolder2"); deleteFileTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, deleteFileTask.Status); @@ -193,7 +193,7 @@ public void AppFileExplorerRenameFileTest() TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.RenameFileApi, response, HttpMethods.Post); - Task renameFileTask = TestHelpers.Portal.RenameFile("knownfolder", "FileToRename.txt", "NewFileName.txt", "SubFolder\\SubFolder2"); + Task renameFileTask = TestHelpers.Portal.RenameFileAsync("knownfolder", "FileToRename.txt", "NewFileName.txt", "SubFolder\\SubFolder2"); renameFileTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, renameFileTask.Status); diff --git a/WindowsDevicePortalWrapper/UnitTestProject/Core/OsInformationTests.cs b/WindowsDevicePortalWrapper/UnitTestProject/Core/OsInformationTests.cs index 163bce66..a26c2d62 100644 --- a/WindowsDevicePortalWrapper/UnitTestProject/Core/OsInformationTests.cs +++ b/WindowsDevicePortalWrapper/UnitTestProject/Core/OsInformationTests.cs @@ -25,7 +25,7 @@ public void OsInformationTest() { TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.MachineNameApi, HttpMethods.Get); - Task getNameTask = TestHelpers.Portal.GetDeviceName(); + Task getNameTask = TestHelpers.Portal.GetDeviceNameAsync(); getNameTask.Wait(); Assert.IsNotNull(TestHelpers.Portal.OperatingSystemVersion); diff --git a/WindowsDevicePortalWrapper/UnitTestProject/Core/PerformanceDataTests.cs b/WindowsDevicePortalWrapper/UnitTestProject/Core/PerformanceDataTests.cs index b8e587ea..5101c52a 100644 --- a/WindowsDevicePortalWrapper/UnitTestProject/Core/PerformanceDataTests.cs +++ b/WindowsDevicePortalWrapper/UnitTestProject/Core/PerformanceDataTests.cs @@ -26,12 +26,12 @@ public void GetRunningProcessesTest() { TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.RunningProcessApi, HttpMethods.Get); - Task getRunningProcessesTask = TestHelpers.Portal.GetRunningProcesses(); + Task getRunningProcessesTask = TestHelpers.Portal.GetRunningProcessesAsync(); getRunningProcessesTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getRunningProcessesTask.Status); - ValidateRunningProcesses(getRunningProcessesTask.Result); + ValidateRunningProcessesAsync(getRunningProcessesTask.Result); } /// @@ -57,19 +57,19 @@ public void GetRunningProcessesWebSocketTest() TestHelpers.Portal.RunningProcessesMessageReceived += runningProcessesReceivedHandler; - Task startListeningForProcessesTask = TestHelpers.Portal.StartListeningForRunningProcesses(); + Task startListeningForProcessesTask = TestHelpers.Portal.StartListeningForRunningProcessesAsync(); startListeningForProcessesTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, startListeningForProcessesTask.Status); runningProcessesReceived.WaitOne(); - Task stopListeningForProcessesTask = TestHelpers.Portal.StopListeningForRunningProcesses(); + Task stopListeningForProcessesTask = TestHelpers.Portal.StopListeningForRunningProcessesAsync(); stopListeningForProcessesTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, stopListeningForProcessesTask.Status); TestHelpers.Portal.RunningProcessesMessageReceived -= runningProcessesReceivedHandler; - ValidateRunningProcesses(runningProcesses); + ValidateRunningProcessesAsync(runningProcesses); } /// @@ -80,7 +80,7 @@ public void GetSystemPerfTest() { TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.SystemPerfApi, HttpMethods.Get); - Task getSystemPerfTask = TestHelpers.Portal.GetSystemPerf(); + Task getSystemPerfTask = TestHelpers.Portal.GetSystemPerfAsync(); getSystemPerfTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getSystemPerfTask.Status); @@ -111,13 +111,13 @@ public void GetSystemPerfWebSocketTest() TestHelpers.Portal.SystemPerfMessageReceived += systemPerfReceivedHandler; - Task startListeningForSystemPerfTask = TestHelpers.Portal.StartListeningForSystemPerf(); + Task startListeningForSystemPerfTask = TestHelpers.Portal.StartListeningForSystemPerfAsync(); startListeningForSystemPerfTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, startListeningForSystemPerfTask.Status); systemPerfReceived.WaitOne(); - Task stopListeningForSystemPerf = TestHelpers.Portal.StopListeningForSystemPerf(); + Task stopListeningForSystemPerf = TestHelpers.Portal.StopListeningForSystemPerfAsync(); stopListeningForSystemPerf.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, stopListeningForSystemPerf.Status); @@ -130,7 +130,7 @@ public void GetSystemPerfWebSocketTest() /// Validate the returned from the tests. /// /// The to validate. - private static void ValidateRunningProcesses(RunningProcesses runningProcesses) + private static void ValidateRunningProcessesAsync(RunningProcesses runningProcesses) { List processes = new List(runningProcesses.Processes); diff --git a/WindowsDevicePortalWrapper/UnitTestProject/Device-VersionTests/HoloLens/HoloLensHelpers.cs b/WindowsDevicePortalWrapper/UnitTestProject/Device-VersionTests/HoloLens/HoloLensHelpers.cs index 2be144ce..41e980fc 100644 --- a/WindowsDevicePortalWrapper/UnitTestProject/Device-VersionTests/HoloLens/HoloLensHelpers.cs +++ b/WindowsDevicePortalWrapper/UnitTestProject/Device-VersionTests/HoloLens/HoloLensHelpers.cs @@ -19,7 +19,7 @@ public static class HoloLensHelpers /// Validate the returned from the HoloLens tests. /// /// The to validate. - internal static void ValidateSystemPerf(SystemPerformanceInformation systemPerfInfo) + internal static void ValidateSystemPerfAsync(SystemPerformanceInformation systemPerfInfo) { // Check some known things about this response. Assert.AreEqual(275897, systemPerfInfo.AvailablePages); @@ -66,7 +66,7 @@ internal static void VerifyOsInformation( friendlyOperatingSystemVersion, HttpMethods.Get); - Task getNameTask = TestHelpers.Portal.GetDeviceName(); + Task getNameTask = TestHelpers.Portal.GetDeviceNameAsync(); getNameTask.Wait(); Assert.AreEqual(operatingSystemVersion, TestHelpers.Portal.OperatingSystemVersion); diff --git a/WindowsDevicePortalWrapper/UnitTestProject/Device-VersionTests/HoloLens/HoloLens_rs1_release.cs b/WindowsDevicePortalWrapper/UnitTestProject/Device-VersionTests/HoloLens/HoloLens_rs1_release.cs index e973265f..010448bf 100644 --- a/WindowsDevicePortalWrapper/UnitTestProject/Device-VersionTests/HoloLens/HoloLens_rs1_release.cs +++ b/WindowsDevicePortalWrapper/UnitTestProject/Device-VersionTests/HoloLens/HoloLens_rs1_release.cs @@ -62,7 +62,7 @@ public void GetBatteryState_HoloLens_1607() this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getTask = TestHelpers.Portal.GetBatteryState(); + Task getTask = TestHelpers.Portal.GetBatteryStateAsync(); getTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); @@ -88,7 +88,7 @@ public void GetDeviceName_HoloLens_1607() this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getTask = TestHelpers.Portal.GetDeviceName(); + Task getTask = TestHelpers.Portal.GetDeviceNameAsync(); getTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); @@ -109,7 +109,7 @@ public void GetIpConfig_HoloLens_1607() this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getTask = TestHelpers.Portal.GetIpConfig(); + Task getTask = TestHelpers.Portal.GetIpConfigAsync(); getTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); @@ -141,7 +141,7 @@ public void GetIpd_HoloLens_1607() this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getTask = TestHelpers.Portal.GetInterPupilaryDistance(); + Task getTask = TestHelpers.Portal.GetInterPupilaryDistanceAsync(); getTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); @@ -162,7 +162,7 @@ public void GetMrcFileList_HoloLens_1607() this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getTask = TestHelpers.Portal.GetMrcFileList(); + Task getTask = TestHelpers.Portal.GetMrcFileListAsync(); getTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); @@ -187,7 +187,7 @@ public void GetMrcStatus_HoloLens_1607() this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getTask = TestHelpers.Portal.GetMrcStatus(); + Task getTask = TestHelpers.Portal.GetMrcStatusAsync(); getTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); @@ -209,7 +209,7 @@ public void GetPowerState_HoloLens_1607() this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getTask = TestHelpers.Portal.GetPowerState(); + Task getTask = TestHelpers.Portal.GetPowerStateAsync(); getTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); @@ -232,12 +232,12 @@ public void GetSystemPerf_HoloLens_1607() this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getSystemPerfTask = TestHelpers.Portal.GetSystemPerf(); + Task getSystemPerfTask = TestHelpers.Portal.GetSystemPerfAsync(); getSystemPerfTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getSystemPerfTask.Status); - HoloLensHelpers.ValidateSystemPerf(getSystemPerfTask.Result); + HoloLensHelpers.ValidateSystemPerfAsync(getSystemPerfTask.Result); } /// diff --git a/WindowsDevicePortalWrapper/UnitTestProject/Device-VersionTests/IoT/IoT_rs1_release.cs b/WindowsDevicePortalWrapper/UnitTestProject/Device-VersionTests/IoT/IoT_rs1_release.cs index 908486bb..a225de96 100644 --- a/WindowsDevicePortalWrapper/UnitTestProject/Device-VersionTests/IoT/IoT_rs1_release.cs +++ b/WindowsDevicePortalWrapper/UnitTestProject/Device-VersionTests/IoT/IoT_rs1_release.cs @@ -63,7 +63,7 @@ public void GetBatteryState_IoT() this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getTask = TestHelpers.Portal.GetBatteryState(); + Task getTask = TestHelpers.Portal.GetBatteryStateAsync(); getTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); @@ -89,7 +89,7 @@ public void GetDeviceName_IoT() this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getTask = TestHelpers.Portal.GetDeviceName(); + Task getTask = TestHelpers.Portal.GetDeviceNameAsync(); getTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); @@ -110,7 +110,7 @@ public void GetIpConfig_IoT() this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getTask = TestHelpers.Portal.GetIpConfig(); + Task getTask = TestHelpers.Portal.GetIpConfigAsync(); getTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); @@ -138,7 +138,7 @@ public void GetControllerDriverInfo_IoT() this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getTask = TestHelpers.Portal.GetControllerDriverInfo(); + Task getTask = TestHelpers.Portal.GetControllerDriverInfoAsync(); getTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); @@ -161,7 +161,7 @@ public void GetCurrentDateTimeInfo_IoT() this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getTask = TestHelpers.Portal.GetDateTimeInfo(); + Task getTask = TestHelpers.Portal.GetDateTimeInfoAsync(); getTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); @@ -183,7 +183,7 @@ public void GetTimezoneInfo_IoT() this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getTask = TestHelpers.Portal.GetTimezoneInfo(); + Task getTask = TestHelpers.Portal.GetTimezoneInfoAsync(); getTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); @@ -206,7 +206,7 @@ public void GetDisplayResolutionInfo_IoT() this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getTask = TestHelpers.Portal.GetDisplayResolutionInfo(); + Task getTask = TestHelpers.Portal.GetDisplayResolutionInfoAsync(); getTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); @@ -228,7 +228,7 @@ public void GetDisplayOrientationInfo_IoT() this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getTask = TestHelpers.Portal.GetDisplayOrientationInfo(); + Task getTask = TestHelpers.Portal.GetDisplayOrientationInfoAsync(); getTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); @@ -250,7 +250,7 @@ public void GetDeviceInfo_IoT() this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getTask = TestHelpers.Portal.GetIoTOSInfo(); + Task getTask = TestHelpers.Portal.GetIoTOSInfoAsync(); getTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); @@ -274,7 +274,7 @@ public void GetStatusInfo_IoT() this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getTask = TestHelpers.Portal.GetStatusInfo(); + Task getTask = TestHelpers.Portal.GetStatusInfoAsync(); getTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); @@ -298,7 +298,7 @@ public void GetUpdateInstallTime_IoT() this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getTask = TestHelpers.Portal.GetUpdateInstallTime(); + Task getTask = TestHelpers.Portal.GetUpdateInstallTimeAsync(); getTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); @@ -321,7 +321,7 @@ public void GetRemoteSettingsStatus_IoT() this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getTask = TestHelpers.Portal.GetRemoteSettingsStatusInfo(); + Task getTask = TestHelpers.Portal.GetRemoteSettingsStatusInfoAsync(); getTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); @@ -344,7 +344,7 @@ public void GetSoftAPSettings_IoT() this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getTask = TestHelpers.Portal.GetSoftAPSettingsInfo(); + Task getTask = TestHelpers.Portal.GetSoftAPSettingsInfoAsync(); getTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); @@ -367,7 +367,7 @@ public void GetAllJoynSettings_IoT() this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getTask = TestHelpers.Portal.GetAllJoynSettingsInfo(); + Task getTask = TestHelpers.Portal.GetAllJoynSettingsInfoAsync(); getTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); @@ -389,7 +389,7 @@ public void SetDeviceNameTest_IoT() HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent); TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.DeviceNameApi, response, HttpMethods.Post); - Task setIoTDeviceName = TestHelpers.Portal.SetIoTDeviceName(deviceName); + Task setIoTDeviceName = TestHelpers.Portal.SetIoTDeviceNameAsync(deviceName); setIoTDeviceName.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, setIoTDeviceName.Status); @@ -409,7 +409,7 @@ public void SetSoftApSettingsTest_IoT() HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent); TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.SoftAPSettingsApi, response, HttpMethods.Post); - Task setSoftApSettings = TestHelpers.Portal.SetSoftApSettings(SoftApEnabled, SoftApSsid, SoftApPassword); + Task setSoftApSettings = TestHelpers.Portal.SetSoftApSettingsAsync(SoftApEnabled, SoftApSsid, SoftApPassword); setSoftApSettings.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, setSoftApSettings.Status); @@ -429,7 +429,7 @@ public void SetAllJoynSettingsTest_IoT() HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent); TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.AllJoynSettingsApi, response, HttpMethods.Post); - Task setAllJoynSettings = TestHelpers.Portal.SetAllJoynSettings(allJoynStatus, allJoynDescription, allJoynManufacturer, allJoynModelNumber); + Task setAllJoynSettings = TestHelpers.Portal.SetAllJoynSettingsAsync(allJoynStatus, allJoynDescription, allJoynManufacturer, allJoynModelNumber); setAllJoynSettings.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, setAllJoynSettings.Status); @@ -451,7 +451,7 @@ public void SetNewPasswordTest_IoT() TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.ResetPasswordApi, response, HttpMethods.Post); - Task setIoTNewPassword = TestHelpers.Portal.SetNewPassword(oldPassword, newPassword); + Task setIoTNewPassword = TestHelpers.Portal.SetNewPasswordAsync(oldPassword, newPassword); setIoTNewPassword.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, setIoTNewPassword.Status); @@ -470,7 +470,7 @@ public void SetNewRemoteDebuggingPinTest_IoT() HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent); TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.NewRemoteDebuggingPinApi, response, HttpMethods.Post); - Task setIoTNewRemoteDebuggingPin = TestHelpers.Portal.SetNewRemoteDebuggingPin(newPin); + Task setIoTNewRemoteDebuggingPin = TestHelpers.Portal.SetNewRemoteDebuggingPinAsync(newPin); setIoTNewRemoteDebuggingPin.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, setIoTNewRemoteDebuggingPin.Status); @@ -490,7 +490,7 @@ public void SetControllersDriversTest_IoT() TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.ControllerDriverApi, response, HttpMethods.Post); - Task setIoTControllersDrivers = TestHelpers.Portal.SetControllersDrivers(newDriver); + Task setIoTControllersDrivers = TestHelpers.Portal.SetControllersDriversAsync(newDriver); setIoTControllersDrivers.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, setIoTControllersDrivers.Status); @@ -508,7 +508,7 @@ public void SetTimeZoneTest_IoT() HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent); TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.SetTimeZoneApi, response, HttpMethods.Post); - Task setIoTTimeZone = TestHelpers.Portal.SetTimeZone(index); + Task setIoTTimeZone = TestHelpers.Portal.SetTimeZoneAsync(index); setIoTTimeZone.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, setIoTTimeZone.Status); @@ -525,7 +525,7 @@ public void SetDisplayResolutionTest_IoT() HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent); TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.DisplayResolutionApi, response, HttpMethods.Post); - Task setDisplayResolution = TestHelpers.Portal.SetDisplayResolution(displayResolution); + Task setDisplayResolution = TestHelpers.Portal.SetDisplayResolutionAsync(displayResolution); setDisplayResolution.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, setDisplayResolution.Status); @@ -542,7 +542,7 @@ public void SetDisplayOrientationTest_IoT() HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent); TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.DisplayOrientationApi, response, HttpMethods.Post); - Task setIoTDisplayOrientation = TestHelpers.Portal.SetDisplayOrientation(displayOrientation); + Task setIoTDisplayOrientation = TestHelpers.Portal.SetDisplayOrientationAsync(displayOrientation); setIoTDisplayOrientation.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, setIoTDisplayOrientation.Status); @@ -560,7 +560,7 @@ public void GetAppsListInfo_IoT() this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getTask = TestHelpers.Portal.GetAppsListInfo(); + Task getTask = TestHelpers.Portal.GetAppsListInfoAsync(); getTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); @@ -582,7 +582,7 @@ public void GetHeadlessAppsListInfo_IoT() this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getTask = TestHelpers.Portal.GetHeadlessAppsListInfo(); + Task getTask = TestHelpers.Portal.GetHeadlessAppsListInfoAsync(); getTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); @@ -603,7 +603,7 @@ public void UpdateStartupAppTest_IoT() HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent); TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.AppsListApi, response, HttpMethods.Post); - Task setIoTStartupApp = TestHelpers.Portal.UpdateStartupApp(startupApp); + Task setIoTStartupApp = TestHelpers.Portal.UpdateStartupAppAsync(startupApp); setIoTStartupApp.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, setIoTStartupApp.Status); @@ -620,7 +620,7 @@ public void UpdateHeadlessStartupAppTest_IoT() HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent); TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.HeadlessStartupAppApi, response, HttpMethods.Post); - Task setIoTHeadlessStartupApp = TestHelpers.Portal.UpdateHeadlessStartupApp(startupApp); + Task setIoTHeadlessStartupApp = TestHelpers.Portal.UpdateHeadlessStartupAppAsync(startupApp); setIoTHeadlessStartupApp.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, setIoTHeadlessStartupApp.Status); @@ -637,7 +637,7 @@ public void RemoveHeadlessStartupAppTest_IoT() HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent); TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.HeadlessStartupAppApi, response, HttpMethods.Delete); - Task removeIoTHeadlessStartupApp = TestHelpers.Portal.RemoveHeadlessStartupApp(startupApp); + Task removeIoTHeadlessStartupApp = TestHelpers.Portal.RemoveHeadlessStartupAppAsync(startupApp); removeIoTHeadlessStartupApp.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, removeIoTHeadlessStartupApp.Status); @@ -654,7 +654,7 @@ public void ActivatePackageTest_IoT() HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent); TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.ActivatePackageApi, response, HttpMethods.Post); - Task activatePackage = TestHelpers.Portal.ActivatePackage(appId); + Task activatePackage = TestHelpers.Portal.ActivatePackageAsync(appId); activatePackage.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, activatePackage.Status); @@ -672,7 +672,7 @@ public void GetAudioDeviceListInfo_IoT() this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getTask = TestHelpers.Portal.GetAudioDeviceListInfo(); + Task getTask = TestHelpers.Portal.GetAudioDeviceListInfoAsync(); getTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); @@ -693,7 +693,7 @@ public void SetRenderVolumeTest_IoT() HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent); TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.SetRenderVolumeApi, response, HttpMethods.Post); - Task RenderVolume = TestHelpers.Portal.SetRenderVolume(renderVolume); + Task RenderVolume = TestHelpers.Portal.SetRenderVolumeAsync(renderVolume); RenderVolume.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, RenderVolume.Status); @@ -710,7 +710,7 @@ public void SetCaptureVolumeTest_IoT() HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent); TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.SetCaptureVolumeApi, response, HttpMethods.Post); - Task CaptureVolume = TestHelpers.Portal.SetCaptureVolume(captureVolume); + Task CaptureVolume = TestHelpers.Portal.SetCaptureVolumeAsync(captureVolume); CaptureVolume.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, CaptureVolume.Status); @@ -728,7 +728,7 @@ public void IcSharingStartTest_IoT() HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent); TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.IcSharingApi, response, HttpMethods.Post); - Task IcsStart = TestHelpers.Portal.IcSharingStart(privateInterfaceIndex, publicInterfaceIndex); + Task IcsStart = TestHelpers.Portal.IcSharingStartAsync(privateInterfaceIndex, publicInterfaceIndex); IcsStart.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, IcsStart.Status); @@ -746,7 +746,7 @@ public void IcSharingStopTest_IoT() HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent); TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.IcSharingApi, response, HttpMethods.Delete); - Task IcsStop = TestHelpers.Portal.IcSharingStop(privateInterfaceIndex, publicInterfaceIndex); + Task IcsStop = TestHelpers.Portal.IcSharingStopAsync(privateInterfaceIndex, publicInterfaceIndex); IcsStop.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, IcsStop.Status); @@ -764,7 +764,7 @@ public void GetIcsInterfacesInfo_IoT() this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getTask = TestHelpers.Portal.GetIcsInterfacesInfo(); + Task getTask = TestHelpers.Portal.GetIcsInterfacesInfoAsync(); getTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); @@ -786,7 +786,7 @@ public void SetRunCommandTest_IoT() HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent); TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.RunCommandApi, response, HttpMethods.Post); - Task runCommand = TestHelpers.Portal.RunCommand(command, runAsDefaultAccount); + Task runCommand = TestHelpers.Portal.RunCommandAsync(command, runAsDefaultAccount); runCommand.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, runCommand.Status); @@ -807,7 +807,7 @@ public void SetRunCommandWithoutOutputTest_IoT() TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.RunCommandWithoutOutputApi, response, HttpMethods.Post); - Task runCommandWithoutOutput = TestHelpers.Portal.RunCommandWithoutOutput(command, runAsDefaultAccount, timeout); + Task runCommandWithoutOutput = TestHelpers.Portal.RunCommandWithoutOutputAsync(command, runAsDefaultAccount, timeout); runCommandWithoutOutput.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, runCommandWithoutOutput.Status); @@ -825,7 +825,7 @@ public void GetRemoteSettingsStatusInfo_IoT() this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getTask = TestHelpers.Portal.GetRemoteSettingsStatusInfo(); + Task getTask = TestHelpers.Portal.GetRemoteSettingsStatusInfoAsync(); getTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); @@ -848,7 +848,7 @@ public void RemoteSettingsEnableTest_IoT() TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.RemoteSettingsEnableApi, response, HttpMethods.Post); - Task remoteSettingsEnable = TestHelpers.Portal.RemoteSettingsEnable(); + Task remoteSettingsEnable = TestHelpers.Portal.RemoteSettingsEnableAsync(); remoteSettingsEnable.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, remoteSettingsEnable.Status); @@ -867,7 +867,7 @@ public void RemoteSettingsDisableTest_IoT() TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.RemoteSettingsDisableApi, response, HttpMethods.Post); - Task remoteSettingsDisable = TestHelpers.Portal.RemoteSettingsDisable(); + Task remoteSettingsDisable = TestHelpers.Portal.RemoteSettingsDisableAsync(); remoteSettingsDisable.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, remoteSettingsDisable.Status); @@ -885,7 +885,7 @@ public void GetTpmSettingsInfo_IoT() this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getTask = TestHelpers.Portal.GetTpmSettingsInfo(); + Task getTask = TestHelpers.Portal.GetTpmSettingsInfoAsync(); getTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); @@ -907,7 +907,7 @@ public void GetTpmAcpiTablesInfo_IoT() this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getTask = TestHelpers.Portal.GetTpmAcpiTablesInfo(); + Task getTask = TestHelpers.Portal.GetTpmAcpiTablesInfoAsync(); getTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); @@ -931,7 +931,7 @@ public void GetTpmLogicalDeviceSettingsInfo_IoT() this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getTask = TestHelpers.Portal.GetTpmLogicalDeviceSettingsInfo(logicalDeviceId); + Task getTask = TestHelpers.Portal.GetTpmLogicalDeviceSettingsInfoAsync(logicalDeviceId); getTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); @@ -952,7 +952,7 @@ public void SetTpmAcpiTablesTest_IoT() HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent); TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.TpmAcpiTablesApi, response, HttpMethods.Post); - Task tpmAcpiTables = TestHelpers.Portal.SetTpmAcpiTablesInfo(acpiTableIndex); + Task tpmAcpiTables = TestHelpers.Portal.SetTpmAcpiTablesInfoAsync(acpiTableIndex); tpmAcpiTables.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, tpmAcpiTables.Status); @@ -971,7 +971,7 @@ public void SetTpmLogicalDeviceSettingsTest_IoT() HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent); TestHelpers.MockHttpResponder.AddMockResponse(string.Format("{0}/{1}", DevicePortal.TpmSettingsApi, logicalDeviceId), response, HttpMethods.Post); - Task tpmLogicalDeviceSettings = TestHelpers.Portal.SetTpmLogicalDeviceSettingsInfo(logicalDeviceId, azureUri, azureKey); + Task tpmLogicalDeviceSettings = TestHelpers.Portal.SetTpmLogicalDeviceSettingsInfoAsync(logicalDeviceId, azureUri, azureKey); tpmLogicalDeviceSettings.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, tpmLogicalDeviceSettings.Status); @@ -988,7 +988,7 @@ public void ResetTpmLogicalDeviceSettingsTest_IoT() HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent); TestHelpers.MockHttpResponder.AddMockResponse(string.Format("{0}/{1}", DevicePortal.TpmSettingsApi, logicalDeviceId), response, HttpMethods.Delete); - Task tpmLogicalDeviceSettings = TestHelpers.Portal.ResetTpmLogicalDeviceSettingsInfo(logicalDeviceId); + Task tpmLogicalDeviceSettings = TestHelpers.Portal.ResetTpmLogicalDeviceSettingsInfoAsync(logicalDeviceId); tpmLogicalDeviceSettings.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, tpmLogicalDeviceSettings.Status); @@ -1009,7 +1009,7 @@ public void GetTpmAzureTokenInfo_IoT() this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getTask = TestHelpers.Portal.GetTpmAzureTokenInfo(logicalDeviceId, validity); + Task getTask = TestHelpers.Portal.GetTpmAzureTokenInfoAsync(logicalDeviceId, validity); getTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getTask.Status); diff --git a/WindowsDevicePortalWrapper/UnitTestProject/Device-VersionTests/XboxOne/XboxHelpers.cs b/WindowsDevicePortalWrapper/UnitTestProject/Device-VersionTests/XboxOne/XboxHelpers.cs index ec806722..44fb4654 100644 --- a/WindowsDevicePortalWrapper/UnitTestProject/Device-VersionTests/XboxOne/XboxHelpers.cs +++ b/WindowsDevicePortalWrapper/UnitTestProject/Device-VersionTests/XboxOne/XboxHelpers.cs @@ -24,7 +24,7 @@ public static void VerifyOsInformation(string friendlyOperatingSystemVersion, st { TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.MachineNameApi, DevicePortalPlatforms.XboxOne, friendlyOperatingSystemVersion, HttpMethods.Get); - Task getNameTask = TestHelpers.Portal.GetDeviceName(); + Task getNameTask = TestHelpers.Portal.GetDeviceNameAsync(); getNameTask.Wait(); Assert.AreEqual(operatingSystemVersion, TestHelpers.Portal.OperatingSystemVersion); 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 2537325a..bfb97c82 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 @@ -65,7 +65,7 @@ public void GetXboxLiveUserListTest_XboxOne_1608() { TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.XboxLiveUserApi, this.PlatformType, this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getUserTask = TestHelpers.Portal.GetXboxLiveUsers(); + Task getUserTask = TestHelpers.Portal.GetXboxLiveUsersAsync(); getUserTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getUserTask.Status); @@ -102,7 +102,7 @@ public void GetXboxSettingsTest_XboxOne_1608() { TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.XboxSettingsApi, this.PlatformType, this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getSettingsTask = TestHelpers.Portal.GetXboxSettings(); + Task getSettingsTask = TestHelpers.Portal.GetXboxSettingsAsync(); getSettingsTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getSettingsTask.Status); @@ -137,7 +137,7 @@ public void AppFileExplorerGetKnownFolderTest_XboxOne_1608() { TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.KnownFoldersApi, this.PlatformType, this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getKnownFoldersTask = TestHelpers.Portal.GetKnownFolders(); + Task getKnownFoldersTask = TestHelpers.Portal.GetKnownFoldersAsync(); getKnownFoldersTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getKnownFoldersTask.Status); @@ -159,7 +159,7 @@ public void AppFileExplorerGetFolderContentsTest_XboxOne_1608() { TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.GetFilesApi, this.PlatformType, this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getFolderContentsTask = TestHelpers.Portal.GetFolderContents("DevelopmentFiles"); + Task getFolderContentsTask = TestHelpers.Portal.GetFolderContentsAsync("DevelopmentFiles"); getFolderContentsTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getFolderContentsTask.Status); @@ -262,12 +262,12 @@ public void GetRunningProcessesTest_XboxOne_1608() { TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.RunningProcessApi, this.PlatformType, this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getRunningProcessesTask = TestHelpers.Portal.GetRunningProcesses(); + Task getRunningProcessesTask = TestHelpers.Portal.GetRunningProcessesAsync(); getRunningProcessesTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getRunningProcessesTask.Status); - ValidateRunningProcesses(getRunningProcessesTask.Result); + ValidateRunningProcessesAsync(getRunningProcessesTask.Result); } /// @@ -294,19 +294,19 @@ public void GetRunningProcessesWebSocketTest_XboxOne_1608() TestHelpers.Portal.RunningProcessesMessageReceived += runningProcessesReceivedHandler; - Task startListeningForProcessesTask = TestHelpers.Portal.StartListeningForRunningProcesses(); + Task startListeningForProcessesTask = TestHelpers.Portal.StartListeningForRunningProcessesAsync(); startListeningForProcessesTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, startListeningForProcessesTask.Status); runningProcessesReceived.WaitOne(); - Task stopListeningForProcessesTask = TestHelpers.Portal.StopListeningForRunningProcesses(); + Task stopListeningForProcessesTask = TestHelpers.Portal.StopListeningForRunningProcessesAsync(); stopListeningForProcessesTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, stopListeningForProcessesTask.Status); TestHelpers.Portal.RunningProcessesMessageReceived -= runningProcessesReceivedHandler; - ValidateRunningProcesses(runningProcesses); + ValidateRunningProcessesAsync(runningProcesses); } /// @@ -319,7 +319,7 @@ public void GetSystemPerfTest_XboxOne_1608() { TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.SystemPerfApi, this.PlatformType, this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getSystemPerfTask = TestHelpers.Portal.GetSystemPerf(); + Task getSystemPerfTask = TestHelpers.Portal.GetSystemPerfAsync(); getSystemPerfTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getSystemPerfTask.Status); @@ -351,13 +351,13 @@ public void GetSystemPerfWebSocketTest_XboxOne_1608() TestHelpers.Portal.SystemPerfMessageReceived += systemPerfReceivedHandler; - Task startListeningForSystemPerfTask = TestHelpers.Portal.StartListeningForSystemPerf(); + Task startListeningForSystemPerfTask = TestHelpers.Portal.StartListeningForSystemPerfAsync(); startListeningForSystemPerfTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, startListeningForSystemPerfTask.Status); systemPerfReceived.WaitOne(); - Task stopListeningForSystemPerf = TestHelpers.Portal.StopListeningForSystemPerf(); + Task stopListeningForSystemPerf = TestHelpers.Portal.StopListeningForSystemPerfAsync(); stopListeningForSystemPerf.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, stopListeningForSystemPerf.Status); @@ -375,7 +375,7 @@ public void XboxAppRegisterTest() TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.RegisterPackageApi, HttpMethods.Post); TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.InstallStateApi, HttpMethods.Post); - Task registerTask = TestHelpers.Portal.RegisterApplication("SomeLooseFolder"); + Task registerTask = TestHelpers.Portal.RegisterApplicationAsync("SomeLooseFolder"); registerTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, registerTask.Status); @@ -389,7 +389,7 @@ public void XboxAppUploadFolderTest() { TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.UploadPackageFolderApi, HttpMethods.Post); - Task uploadTask = TestHelpers.Portal.UploadPackageFolder("MockData\\XboxOne", "DestinationLooseFolder"); + Task uploadTask = TestHelpers.Portal.UploadPackageFolderAsync("MockData\\XboxOne", "DestinationLooseFolder"); uploadTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, uploadTask.Status); @@ -405,7 +405,7 @@ public void GetXboxLiveUserListTest() { TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.XboxLiveUserApi, HttpMethods.Get); - Task getUserTask = TestHelpers.Portal.GetXboxLiveUsers(); + Task getUserTask = TestHelpers.Portal.GetXboxLiveUsersAsync(); getUserTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getUserTask.Status); @@ -447,7 +447,7 @@ public void UpdateXboxLiveUsersTest() user.SignedIn = true; users.Add(user); - Task updateUsersTask = TestHelpers.Portal.UpdateXboxLiveUsers(users); + Task updateUsersTask = TestHelpers.Portal.UpdateXboxLiveUsersAsync(users); updateUsersTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, updateUsersTask.Status); @@ -477,7 +477,7 @@ public void AddSponsoredUserTest_Failure() try { - Task updateUsersTask = TestHelpers.Portal.UpdateXboxLiveUsers(users); + Task updateUsersTask = TestHelpers.Portal.UpdateXboxLiveUsersAsync(users); updateUsersTask.Wait(); Assert.Fail("Expected an exception due to mock responder returning failure HRESULT."); @@ -505,7 +505,7 @@ public void GetXboxSettingsTest() { TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.XboxSettingsApi, HttpMethods.Get); - Task getSettingsTask = TestHelpers.Portal.GetXboxSettings(); + Task getSettingsTask = TestHelpers.Portal.GetXboxSettingsAsync(); getSettingsTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getSettingsTask.Status); @@ -541,7 +541,7 @@ public void GetSingleXboxSettingTest() string settingName = "TVResolution"; TestHelpers.MockHttpResponder.AddMockResponse(Path.Combine(DevicePortal.XboxSettingsApi, settingName), HttpMethods.Get); - Task getSettingTask = TestHelpers.Portal.GetXboxSetting(settingName); + Task getSettingTask = TestHelpers.Portal.GetXboxSettingAsync(settingName); getSettingTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getSettingTask.Status); @@ -569,7 +569,7 @@ public void UpdateXboxSettingsTest() HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent); TestHelpers.MockHttpResponder.AddMockResponse(Path.Combine(DevicePortal.XboxSettingsApi, setting.Name), HttpMethods.Put); - Task updateSettingsTask = TestHelpers.Portal.UpdateXboxSetting(setting); + Task updateSettingsTask = TestHelpers.Portal.UpdateXboxSettingAsync(setting); updateSettingsTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, updateSettingsTask.Status); @@ -595,7 +595,7 @@ public void XboxScreenshotTest() TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.GetXboxScreenshotApi, response, HttpMethods.Get); - Task screenshotTask = TestHelpers.Portal.TakeXboxScreenshot(); + Task screenshotTask = TestHelpers.Portal.TakeXboxScreenshotAsync(); screenshotTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, screenshotTask.Status); @@ -610,7 +610,7 @@ public void EnableFiddlerTest() HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK); TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.FiddlerSetupApi, response, HttpMethods.Post); - Task fiddlerEnableTask = TestHelpers.Portal.EnableFiddlerTracing("localhost", "8888"); + Task fiddlerEnableTask = TestHelpers.Portal.EnableFiddlerTracingAsync("localhost", "8888"); fiddlerEnableTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, fiddlerEnableTask.Status); @@ -618,7 +618,7 @@ public void EnableFiddlerTest() response = new HttpResponseMessage(HttpStatusCode.OK); TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.FiddlerSetupApi, response, HttpMethods.Delete); - Task fiddlerDisableTask = TestHelpers.Portal.DisableFiddlerTracing(); + Task fiddlerDisableTask = TestHelpers.Portal.DisableFiddlerTracingAsync(); fiddlerDisableTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, fiddlerDisableTask.Status); @@ -634,7 +634,7 @@ public void GetXboxLiveSandboxTest() TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.XboxLiveSandboxApi, this.PlatformType, this.FriendlyOperatingSystemVersion, HttpMethods.Get); - Task getSandboxTask = TestHelpers.Portal.GetXboxLiveSandbox(); + Task getSandboxTask = TestHelpers.Portal.GetXboxLiveSandboxAsync(); getSandboxTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, getSandboxTask.Status); @@ -655,7 +655,7 @@ public void SetXboxLiveSandboxTest() TestHelpers.MockHttpResponder.AddMockResponse(DevicePortal.XboxLiveSandboxApi, response, HttpMethods.Put); - Task setSandboxTask = TestHelpers.Portal.SetXboxLiveSandbox(sandboxValue); + Task setSandboxTask = TestHelpers.Portal.SetXboxLiveSandboxAsync(sandboxValue); setSandboxTask.Wait(); Assert.AreEqual(TaskStatus.RanToCompletion, setSandboxTask.Status); @@ -667,7 +667,7 @@ public void SetXboxLiveSandboxTest() /// Validate the returned from the tests. /// /// The to validate. - private static void ValidateRunningProcesses(RunningProcesses runningProcesses) + private static void ValidateRunningProcessesAsync(RunningProcesses runningProcesses) { List processes = new List(runningProcesses.Processes); diff --git a/WindowsDevicePortalWrapper/UnitTestProject/TestHelpers.cs b/WindowsDevicePortalWrapper/UnitTestProject/TestHelpers.cs index d9a6cb85..e049d179 100644 --- a/WindowsDevicePortalWrapper/UnitTestProject/TestHelpers.cs +++ b/WindowsDevicePortalWrapper/UnitTestProject/TestHelpers.cs @@ -47,7 +47,7 @@ public static void EstablishMockConnection(DevicePortalPlatforms platform, strin TestHelpers.Portal = new DevicePortal(new MockDevicePortalConnection()); - Task connectTask = TestHelpers.Portal.Connect(updateConnection: false); + Task connectTask = TestHelpers.Portal.ConnectAsync(updateConnection: false); connectTask.Wait(); Assert.AreEqual(HttpStatusCode.OK, TestHelpers.Portal.ConnectionHttpStatusCode); diff --git a/WindowsDevicePortalWrapper/UnitTestProject/WDPMockImplementations/AppDeployment.cs b/WindowsDevicePortalWrapper/UnitTestProject/WDPMockImplementations/AppDeployment.cs index 7383a745..50b44dfc 100644 --- a/WindowsDevicePortalWrapper/UnitTestProject/WDPMockImplementations/AppDeployment.cs +++ b/WindowsDevicePortalWrapper/UnitTestProject/WDPMockImplementations/AppDeployment.cs @@ -21,7 +21,7 @@ public partial class DevicePortal /// API for getting installation status. /// /// The status - public async Task GetInstallStatus() + public async Task GetInstallStatusAsync() { ApplicationInstallStatus status = ApplicationInstallStatus.Completed; diff --git a/WindowsDevicePortalWrapper/UnitTestProject/WDPMockImplementations/RestDelete.cs b/WindowsDevicePortalWrapper/UnitTestProject/WDPMockImplementations/RestDelete.cs index 3b03cf70..773180df 100644 --- a/WindowsDevicePortalWrapper/UnitTestProject/WDPMockImplementations/RestDelete.cs +++ b/WindowsDevicePortalWrapper/UnitTestProject/WDPMockImplementations/RestDelete.cs @@ -13,7 +13,7 @@ namespace Microsoft.Tools.WindowsDevicePortal { /// - /// MOCK implementation of HTTP Delete + /// MOCK implementation of HTTP DeleteAsync /// public partial class DevicePortal { @@ -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 Delete(Uri uri) + private async Task DeleteAsync(Uri uri) { MemoryStream dataStream = null; diff --git a/WindowsDevicePortalWrapper/UnitTestProject/WDPMockImplementations/RestGet.cs b/WindowsDevicePortalWrapper/UnitTestProject/WDPMockImplementations/RestGet.cs index c2f13c0c..bca5ee88 100644 --- a/WindowsDevicePortalWrapper/UnitTestProject/WDPMockImplementations/RestGet.cs +++ b/WindowsDevicePortalWrapper/UnitTestProject/WDPMockImplementations/RestGet.cs @@ -13,7 +13,7 @@ namespace Microsoft.Tools.WindowsDevicePortal { /// - /// MOCK implementation of HTTP Get + /// MOCK implementation of HTTP GetAsync /// public partial class DevicePortal { @@ -22,7 +22,7 @@ public partial class DevicePortal /// /// The uri to which the get request will be issued. /// Response data as a stream. - private async Task Get( + private async Task GetAsync( Uri uri) { MemoryStream dataStream = null; diff --git a/WindowsDevicePortalWrapper/UnitTestProject/WDPMockImplementations/RestPost.cs b/WindowsDevicePortalWrapper/UnitTestProject/WDPMockImplementations/RestPost.cs index 887123f0..6fa1755e 100644 --- a/WindowsDevicePortalWrapper/UnitTestProject/WDPMockImplementations/RestPost.cs +++ b/WindowsDevicePortalWrapper/UnitTestProject/WDPMockImplementations/RestPost.cs @@ -13,7 +13,7 @@ namespace Microsoft.Tools.WindowsDevicePortal { /// - /// MOCK implementation of HTTP Post + /// MOCK implementation of HTTP PostAsync /// public partial class DevicePortal { @@ -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 Post( + private async Task PostAsync( Uri uri, Stream requestStream = null, string requestStreamContentType = null) diff --git a/WindowsDevicePortalWrapper/UnitTestProject/WDPMockImplementations/RestPut.cs b/WindowsDevicePortalWrapper/UnitTestProject/WDPMockImplementations/RestPut.cs index 12abe99e..d0f89aab 100644 --- a/WindowsDevicePortalWrapper/UnitTestProject/WDPMockImplementations/RestPut.cs +++ b/WindowsDevicePortalWrapper/UnitTestProject/WDPMockImplementations/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 Put( + private async Task PutAsync( Uri uri, HttpContent body = null) { diff --git a/WindowsDevicePortalWrapper/UnitTestProject/WDPMockImplementations/WebSocket.cs b/WindowsDevicePortalWrapper/UnitTestProject/WDPMockImplementations/WebSocket.cs index 00dedef7..8a499e7c 100644 --- a/WindowsDevicePortalWrapper/UnitTestProject/WDPMockImplementations/WebSocket.cs +++ b/WindowsDevicePortalWrapper/UnitTestProject/WDPMockImplementations/WebSocket.cs @@ -55,7 +55,7 @@ public WebSocket(IDevicePortalConnection connection, Func /// The task of closing the websocket connection. #pragma warning disable 1998 - private async Task StopListeningForMessagesInternal() + private async Task StopListeningForMessagesInternalAsync() { if (this.IsListeningForMessages) { @@ -77,7 +77,7 @@ private async Task StopListeningForMessagesInternal() /// /// The uri that the weboscket should connect to /// The task of listening for messages from the websocket. - private async Task StartListeningForMessagesInternal(Uri endpoint) + private async Task StartListeningForMessagesInternalAsync(Uri endpoint) { this.keepListeningForMessages = true; diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/AppDeployment.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/AppDeployment.cs index dc96351e..062dc6a1 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/AppDeployment.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/AppDeployment.cs @@ -53,9 +53,9 @@ public partial class DevicePortal /// Gets the collection of applications installed on the device. /// /// AppPackages object containing the list of installed application packages. - public async Task GetInstalledAppPackages() + public async Task GetInstalledAppPackagesAsync() { - return await this.Get(InstalledPackagesApi); + return await this.GetAsync(InstalledPackagesApi); } /// @@ -71,7 +71,7 @@ public async Task GetInstalledAppPackages() /// InstallApplication sends ApplicationInstallStatus events to indicate the current progress in the installation process. /// Some applications may opt to not register for the AppInstallStatus event and await on InstallApplication. /// Task for tracking completion of install initialization. - public async Task InstallApplication( + public async Task InstallApplicationAsync( string appName, string packageFileName, List dependencyFileNames, @@ -100,12 +100,12 @@ public async Task InstallApplication( ApplicationInstallStatus.InProgress, ApplicationInstallPhase.UninstallingPreviousVersion, installPhaseDescription); - AppPackages installedApps = await this.GetInstalledAppPackages(); + AppPackages installedApps = await this.GetInstalledAppPackagesAsync(); foreach (PackageInfo package in installedApps.Packages) { if (package.Name == appName) { - await this.UninstallApplication(package.FullName); + await this.UninstallApplicationAsync(package.FullName); break; } } @@ -170,7 +170,7 @@ public async Task InstallApplication( string contentType = string.Format("multipart/form-data; boundary={0}", boundaryString); // Make the HTTP request. - await this.Post(uri, dataStream, contentType); + await this.PostAsync(uri, dataStream, contentType); } // Poll the status until complete. @@ -185,7 +185,7 @@ public async Task InstallApplication( await Task.Delay(TimeSpan.FromMilliseconds(stateCheckIntervalMs)); - status = await this.GetInstallStatus(); + status = await this.GetInstallStatusAsync(); } while (status == ApplicationInstallStatus.InProgress); @@ -221,9 +221,9 @@ public async Task InstallApplication( /// /// The name of the application package to uninstall. /// Task tracking the uninstall operation. - public async Task UninstallApplication(string packageName) + public async Task UninstallApplicationAsync(string packageName) { - await this.Delete( + await this.DeleteAsync( PackageManagerApi, //// NOTE: When uninstalling an app package, the package name is not Hex64 encoded. string.Format("package={0}", packageName)); diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/AppFileExplorer.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/AppFileExplorer.cs index 0b155fc9..cc93f29e 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/AppFileExplorer.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/AppFileExplorer.cs @@ -41,9 +41,9 @@ public partial class DevicePortal /// Gets a list of Known Folders on the device. /// /// List of known folders available on this device. - public async Task GetKnownFolders() + public async Task GetKnownFoldersAsync() { - return await this.Get(KnownFoldersApi); + return await this.GetAsync(KnownFoldersApi); } /// @@ -53,14 +53,14 @@ public async Task GetKnownFolders() /// An optional subpath to the folder. /// The package full name if using LocalAppData. /// Contents of the requested folder. - public async Task GetFolderContents( + public async Task GetFolderContentsAsync( string knownFolderId, string subPath = null, string packageFullName = null) { Dictionary payload = this.BuildCommonFilePayload(knownFolderId, subPath, packageFullName); - return await this.Get(GetFilesApi, Utilities.BuildQueryString(payload)); + return await this.GetAsync(GetFilesApi, Utilities.BuildQueryString(payload)); } /// @@ -71,7 +71,7 @@ public async Task GetFolderContents( /// An optional subpath to the folder. /// The package full name if using LocalAppData. /// Stream to the downloaded file. - public async Task GetFile( + public async Task GetFileAsync( string knownFolderId, string filename, string subPath = null, @@ -86,7 +86,7 @@ public async Task GetFile( GetFileApi, Utilities.BuildQueryString(payload)); - return await this.Get(uri); + return await this.GetAsync(uri); } /// @@ -97,7 +97,7 @@ public async Task GetFile( /// An optional subpath to the folder. /// The package full name if using LocalAppData. /// Task tracking completion of the upload request. - public async Task UploadFile( + public async Task UploadFileAsync( string knownFolderId, string filepath, string subPath = null, @@ -108,7 +108,7 @@ public async Task UploadFile( List files = new List(); files.Add(filepath); - await this.Post(GetFileApi, files, Utilities.BuildQueryString(payload)); + await this.PostAsync(GetFileApi, files, Utilities.BuildQueryString(payload)); } /// @@ -119,7 +119,7 @@ public async Task UploadFile( /// An optional subpath to the folder. /// The package full name if using LocalAppData. /// Task tracking completion of the delete request. - public async Task DeleteFile( + public async Task DeleteFileAsync( string knownFolderId, string filename, string subPath = null, @@ -129,7 +129,7 @@ public async Task DeleteFile( payload.Add("filename", filename); - await this.Delete(GetFileApi, Utilities.BuildQueryString(payload)); + await this.DeleteAsync(GetFileApi, Utilities.BuildQueryString(payload)); } /// @@ -141,7 +141,7 @@ public async Task DeleteFile( /// An optional subpath to the folder. /// The package full name if using LocalAppData. /// Task tracking completion of the rename request. - public async Task RenameFile( + public async Task RenameFileAsync( string knownFolderId, string filename, string newFilename, @@ -153,7 +153,7 @@ public async Task RenameFile( payload.Add("filename", filename); payload.Add("newfilename", newFilename); - await this.Post(RenameFileApi, Utilities.BuildQueryString(payload)); + await this.PostAsync(RenameFileApi, Utilities.BuildQueryString(payload)); } /// diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/DeviceManager.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/DeviceManager.cs index ef710637..d420b83a 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/DeviceManager.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/DeviceManager.cs @@ -24,9 +24,9 @@ public partial class DevicePortal /// Get a listing of installed devices /// /// List of installed devices - public async Task> GetDeviceList() + public async Task> GetDeviceListAsync() { - DeviceList deviceList = await this.Get(InstalledDevicesApi); + DeviceList deviceList = await this.GetAsync(InstalledDevicesApi); return deviceList.Devices; } diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/Dns-Sd.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/Dns-Sd.cs index 9ed30723..730cc5dc 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/Dns-Sd.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/Dns-Sd.cs @@ -30,9 +30,9 @@ public partial class DevicePortal /// Gets a list of DNS-SD tags being broadcast by this device. /// /// Array of strings, each one an individual tag. - public async Task> GetServiceTags() + public async Task> GetServiceTagsAsync() { - ServiceTags tags = await this.Get(TagsApi); + ServiceTags tags = await this.GetAsync(TagsApi); return tags.Tags; } @@ -41,30 +41,30 @@ public async Task> GetServiceTags() /// /// The tag to assign to the device. /// Task tracking adding the tag. - public async Task AddServiceTag(string tagValue) + public async Task AddServiceTagAsync(string tagValue) { - await this.Post( + await this.PostAsync( TagApi, string.Format("tagValue={0}", tagValue)); } /// - /// Delete all tags from the device's DNS-SD broadcast. + /// DeleteAsync all tags from the device's DNS-SD broadcast. /// /// Task tracking deletion of all tags. - public async Task DeleteAllTags() + public async Task DeleteAllTagsAsync() { - await this.Delete(TagsApi); + await this.DeleteAsync(TagsApi); } /// - /// Delete a specific tag from the device's DNS-SD broadcast. + /// DeleteAsync a specific tag from the device's DNS-SD broadcast. /// /// The tag to delete from the device broadcast. /// Task tracking deletion of the tag. - public async Task DeleteTag(string tagValue) + public async Task DeleteTagAsync(string tagValue) { - await this.Delete( + await this.DeleteAsync( TagApi, string.Format("tagValue={0}", tagValue)); } diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/Networking.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/Networking.cs index 0e48820a..9b34e544 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/Networking.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/Networking.cs @@ -25,9 +25,9 @@ public partial class DevicePortal /// Gets the IP configuration data of the device. /// /// object containing details of the device's network configuration. - public async Task GetIpConfig() + public async Task GetIpConfigAsync() { - return await this.Get(IpConfigApi); + return await this.GetAsync(IpConfigApi); } #region Data contract diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/OsInformation.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/OsInformation.cs index 0391410d..0530bf9e 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/OsInformation.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/OsInformation.cs @@ -91,9 +91,9 @@ public enum DevicePortalPlatforms /// Gets the family name (ex: Windows.Holographic) of the device. /// /// String containing the device's family. - public async Task GetDeviceFamily() + public async Task GetDeviceFamilyAsync() { - DeviceOsFamily deviceFamily = await this.Get(DeviceFamilyApi); + DeviceOsFamily deviceFamily = await this.GetAsync(DeviceFamilyApi); return deviceFamily.Family; } @@ -101,9 +101,9 @@ public async Task GetDeviceFamily() /// Gets the name of the device. /// /// String containing the device's name. - public async Task GetDeviceName() + public async Task GetDeviceNameAsync() { - DeviceName deviceName = await this.Get(MachineNameApi); + DeviceName deviceName = await this.GetAsync(MachineNameApi); return deviceName.Name; } @@ -111,9 +111,9 @@ public async Task GetDeviceName() /// Gets information about the device's operating system. /// /// OperatingSystemInformation object containing details of the installed operating system. - public async Task GetOperatingSystemInformation() + public async Task GetOperatingSystemInformationAsync() { - return await this.Get(OsInfoApi); + return await this.GetAsync(OsInfoApi); } /// @@ -122,9 +122,9 @@ public async Task GetOperatingSystemInformation() /// The name to assign to the device. /// The new name does not take effect until the device has been restarted. /// Task tracking setting the device name completion. - public async Task SetDeviceName(string name) + public async Task SetDeviceNameAsync(string name) { - await this.Post( + await this.PostAsync( MachineNameApi, string.Format("name={0}", Utilities.Hex64Encode(name))); } diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/PerformanceData.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/PerformanceData.cs index 99ad2fe4..1b2f835a 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/PerformanceData.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/PerformanceData.cs @@ -50,16 +50,16 @@ public partial class DevicePortal /// Gets the collection of processes running on the device. /// /// RunningProcesses object containing the list of running processes. - public async Task GetRunningProcesses() + public async Task GetRunningProcessesAsync() { - return await this.Get(RunningProcessApi); + return await this.GetAsync(RunningProcessApi); } /// /// Starts listening for the running processes on the device with them being returned via the RunningProcessesMessageReceived event handler. /// /// Task for connecting to the websocket but not for listening to it. - public async Task StartListeningForRunningProcesses() + public async Task StartListeningForRunningProcessesAsync() { if (this.deviceProcessesWebSocket == null) { @@ -79,37 +79,37 @@ public async Task StartListeningForRunningProcesses() } } - await this.deviceProcessesWebSocket.StartListeningForMessages(RunningProcessApi); + await this.deviceProcessesWebSocket.StartListeningForMessagesAsync(RunningProcessApi); } /// /// Stop listening for the running processes on the device. /// /// Task for stop listening for processes and disconnecting from the websocket . - public async Task StopListeningForRunningProcesses() + public async Task StopListeningForRunningProcessesAsync() { if (this.deviceProcessesWebSocket == null || !this.deviceProcessesWebSocket.IsListeningForMessages) { return; } - await this.deviceProcessesWebSocket.StopListeningForMessages(); + await this.deviceProcessesWebSocket.StopListeningForMessagesAsync(); } /// /// Gets system performance information for the device. /// /// SystemPerformanceInformation object containing information such as memory usage. - public async Task GetSystemPerf() + public async Task GetSystemPerfAsync() { - return await this.Get(SystemPerfApi); + return await this.GetAsync(SystemPerfApi); } /// /// Starts listening for the system performance information for the device with it being returned via the SystemPerfMessageReceived event handler. /// /// Task for connecting to the websocket but not for listening to it. - public async Task StartListeningForSystemPerf() + public async Task StartListeningForSystemPerfAsync() { if (this.systemPerfWebSocket == null) { @@ -129,21 +129,21 @@ public async Task StartListeningForSystemPerf() } } - await this.systemPerfWebSocket.StartListeningForMessages(SystemPerfApi); + await this.systemPerfWebSocket.StartListeningForMessagesAsync(SystemPerfApi); } /// /// Stop listening for the system performance information for the device. /// /// Task for stop listening for system perf and disconnecting from the websocket . - public async Task StopListeningForSystemPerf() + public async Task StopListeningForSystemPerfAsync() { if (this.systemPerfWebSocket == null || !this.systemPerfWebSocket.IsListeningForMessages) { return; } - await this.systemPerfWebSocket.StopListeningForMessages(); + await this.systemPerfWebSocket.StopListeningForMessagesAsync(); } /// diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/Power.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/Power.cs index 8cc16c31..d504adb3 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/Power.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/Power.cs @@ -54,9 +54,9 @@ public partial class DevicePortal /// Returns the current active power scheme. /// /// The power scheme identifier. - public async Task GetActivePowerScheme() + public async Task GetActivePowerSchemeAsync() { - ActivePowerScheme activeScheme = await this.Get(ActivePowerSchemeApi); + ActivePowerScheme activeScheme = await this.GetAsync(ActivePowerSchemeApi); return activeScheme.Id; } @@ -64,18 +64,18 @@ public async Task GetActivePowerScheme() /// Returns the current state of the device's battery. /// /// BatteryState object containing details such as the current battery level. - public async Task GetBatteryState() + public async Task GetBatteryStateAsync() { - return await this.Get(BatteryStateApi); + return await this.GetAsync(BatteryStateApi); } /// /// Gets the device's current power state. /// /// PowerState object containing details such as whether or not the device is in low power mode. - public async Task GetPowerState() + public async Task GetPowerStateAsync() { - return await this.Get(PowerStateApi); + return await this.GetAsync(PowerStateApi); } #region Data contract diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/RemoteControl.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/RemoteControl.cs index 290a0f1a..9ba49c2c 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/RemoteControl.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/RemoteControl.cs @@ -29,9 +29,9 @@ public partial class DevicePortal /// /// Task tracking reboot completion. /// - public async Task Reboot() + public async Task RebootAsync() { - await this.Post(RebootApi); + await this.PostAsync(RebootApi); } /// @@ -40,9 +40,9 @@ public async Task Reboot() /// /// Task tracking shutdown completion. /// - public async Task Shutdown() + public async Task ShutdownAsync() { - await this.Post(ShutdownApi); + await this.PostAsync(ShutdownApi); } } } diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/TaskManager.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/TaskManager.cs index 37fd1f4f..1344de63 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 LaunchApplication( + public async Task LaunchApplicationAsync( string appid, string packageName) { @@ -33,11 +33,11 @@ public async Task LaunchApplication( Utilities.Hex64Encode(appid), Utilities.Hex64Encode(packageName)); - await this.Post( + await this.PostAsync( TaskManagerApi, payload); - RunningProcesses runningApps = await this.GetRunningProcesses(); + RunningProcesses runningApps = await this.GetRunningProcessesAsync(); int processId = 0; foreach (DeviceProcessInfo process in runningApps.Processes) @@ -59,9 +59,9 @@ await this.Post( /// /// Task for tracking termination completion /// - public async Task TerminateApplication(string packageName) + public async Task TerminateApplicationAsync(string packageName) { - await this.Delete( + await this.DeleteAsync( TaskManagerApi, string.Format("package={0}", Utilities.Hex64Encode(packageName))); } diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/WiFiManagement.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/WiFiManagement.cs index 44985bfe..ed1063c7 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/WiFiManagement.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/WiFiManagement.cs @@ -38,7 +38,7 @@ public partial class DevicePortal /// SSID of the network. /// Network key. /// Task tracking connection status. - public async Task ConnectToWifiNetwork( + public async Task ConnectToWifiNetworkAsync( Guid networkAdapter, string ssid, string networkKey) @@ -49,7 +49,7 @@ public async Task ConnectToWifiNetwork( Utilities.Hex64Encode(ssid), Utilities.Hex64Encode(networkKey)); - await this.Post( + await this.PostAsync( WifiNetworkApi, payload); } @@ -58,9 +58,9 @@ await this.Post( /// Gets WiFi interfaces. /// /// List of WiFi interfaces. - public async Task GetWifiInterfaces() + public async Task GetWifiInterfacesAsync() { - return await this.Get(WifiInterfacesApi); + return await this.GetAsync(WifiInterfacesApi); } /// @@ -68,9 +68,9 @@ public async Task GetWifiInterfaces() /// /// Interface to get networks from. /// List of available networks. - public async Task GetWifiNetworks(Guid interfaceGuid) + public async Task GetWifiNetworksAsync(Guid interfaceGuid) { - return await this.Get( + return await this.GetAsync( WifiNetworksApi, string.Format("interface={0}", interfaceGuid.ToString())); } diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/DevicePortal.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/DevicePortal.cs index 5a0b9375..e58eae5f 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/DevicePortal.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/DevicePortal.cs @@ -186,7 +186,7 @@ public string PlatformName /// Some applications may opt to not register for the ConnectionStatus event and await on Connect. /// Task for tracking the connect. [method: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1118:ParameterMustNotSpanMultipleLines", Justification = "manualCertificate param doesn't really span multiple lines, it just has a different type for UWP and .NET implementations.")] - public async Task Connect( + public async Task ConnectAsync( string ssid = null, string ssidKey = null, bool updateConnection = true, @@ -216,8 +216,8 @@ public async Task Connect( DeviceConnectionStatus.Connecting, DeviceConnectionPhase.RequestingOperatingSystemInformation, connectionPhaseDescription); - this.deviceConnection.Family = await this.GetDeviceFamily(); - this.deviceConnection.OsInfo = await this.GetOperatingSystemInformation(); + this.deviceConnection.Family = await this.GetDeviceFamilyAsync(); + this.deviceConnection.OsInfo = await this.GetOperatingSystemInformationAsync(); // Default to using whatever was specified in the connection. bool requiresHttps = this.IsUsingHttps(); @@ -231,7 +231,7 @@ public async Task Connect( DeviceConnectionStatus.Connecting, DeviceConnectionPhase.DeterminingConnectionRequirements, connectionPhaseDescription); - requiresHttps = await this.GetIsHttpsRequired(); + requiresHttps = await this.GetIsHttpsRequiredAsync(); } // Connect the device to the specified network. @@ -242,10 +242,10 @@ public async Task Connect( DeviceConnectionStatus.Connecting, DeviceConnectionPhase.ConnectingToTargetNetwork, connectionPhaseDescription); - WifiInterfaces wifiInterfaces = await this.GetWifiInterfaces(); + WifiInterfaces wifiInterfaces = await this.GetWifiInterfacesAsync(); // TODO - consider what to do if there is more than one wifi interface on a device - await this.ConnectToWifiNetwork(wifiInterfaces.Interfaces[0].Guid, ssid, ssidKey); + await this.ConnectToWifiNetworkAsync(wifiInterfaces.Interfaces[0].Guid, ssid, ssidKey); } // Get the device's IP configuration and update the connection as appropriate. @@ -268,7 +268,7 @@ public async Task Connect( } this.deviceConnection.UpdateConnection( - await this.GetIpConfig(), + await this.GetIpConfigAsync(), requiresHttps, preservePort); } @@ -318,7 +318,7 @@ await this.GetIpConfig(), /// An optional stream to use for the request body content. /// The content type of the request stream. /// Task waiting for HTTP call to return and file copy to complete. - public async Task SaveEndpointResponseToFile( + public async Task SaveEndpointResponseToFileAsync( string endpoint, string directory, HttpMethods httpMethod, @@ -372,12 +372,12 @@ public async Task SaveEndpointResponseToFile( websocket.WebSocketStreamReceived += streamReceivedHandler; - Task startListeningForStreamTask = websocket.StartListeningForMessages(endpoint); + Task startListeningForStreamTask = websocket.StartListeningForMessagesAsync(endpoint); startListeningForStreamTask.Wait(); streamReceived.WaitOne(); - Task stopListeningForStreamTask = websocket.StopListeningForMessages(); + Task stopListeningForStreamTask = websocket.StopListeningForMessagesAsync(); stopListeningForStreamTask.Wait(); websocket.WebSocketStreamReceived -= streamReceivedHandler; @@ -410,7 +410,7 @@ public async Task SaveEndpointResponseToFile( #endif // WINDOWS_UWP } - using (Stream dataStream = await this.Put(uri, streamContent)) + using (Stream dataStream = await this.PutAsync(uri, streamContent)) { using (var fileStream = File.Create(filepath)) { @@ -421,7 +421,7 @@ public async Task SaveEndpointResponseToFile( } else if (HttpMethods.Post == httpMethod) { - using (Stream dataStream = await this.Post(uri, requestBody, requestBodyContentType)) + using (Stream dataStream = await this.PostAsync(uri, requestBody, requestBodyContentType)) { using (var fileStream = File.Create(filepath)) { @@ -432,7 +432,7 @@ public async Task SaveEndpointResponseToFile( } else if (HttpMethods.Delete == httpMethod) { - using (Stream dataStream = await this.Delete(uri)) + using (Stream dataStream = await this.DeleteAsync(uri)) { using (var fileStream = File.Create(filepath)) { @@ -443,7 +443,7 @@ public async Task SaveEndpointResponseToFile( } else if (HttpMethods.Get == httpMethod) { - using (Stream dataStream = await this.Get(uri)) + using (Stream dataStream = await this.GetAsync(uri)) { using (var fileStream = File.Create(filepath)) { diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/HolographicOs.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/HolographicOs.cs index 2233e903..6f6c4e73 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/HolographicOs.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/HolographicOs.cs @@ -34,14 +34,14 @@ public partial class DevicePortal /// /// Interpupilary distance, in millimeters. /// This method is only supported on HoloLens devices. - public async Task GetInterPupilaryDistance() + public async Task GetInterPupilaryDistanceAsync() { if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } - InterPupilaryDistance ipd = await this.Get(HolographicIpdApi); + InterPupilaryDistance ipd = await this.GetAsync(HolographicIpdApi); return ipd.Ipd; } @@ -51,14 +51,14 @@ public async Task GetInterPupilaryDistance() /// Desired value for HTTPS communication /// True if WiFi based communication requires a secure connection, false otherwise. /// This method is only supported on HoloLens devices. - public async Task SetIsHttpsRequired(bool httpsRequired) + public async Task SetIsHttpsRequiredAsync(bool httpsRequired) { if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } - await this.Post( + await this.PostAsync( HolographicWebManagementHttpSettingsApi, string.Format("required={0}", httpsRequired)); @@ -71,7 +71,7 @@ await this.Post( /// Interpupilary distance, in millimeters. /// Task for tracking the POST call /// This method is only supported on HoloLens devices. - public async Task SetInterPupilaryDistance(float ipd) + public async Task SetInterPupilaryDistanceAsync(float ipd) { if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { @@ -80,7 +80,7 @@ public async Task SetInterPupilaryDistance(float ipd) string payload = string.Format("ipd={0}", (int)(ipd * 1000.0f)); - await this.Post( + await this.PostAsync( HolographicIpdApi, payload); } @@ -90,14 +90,14 @@ await this.Post( /// /// True if WiFi based communication requires a secure connection, false otherwise. /// This method is only supported on HoloLens devices. - public async Task GetIsHttpsRequired() + public async Task GetIsHttpsRequiredAsync() { if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } - WebManagementHttpSettings httpSettings = await this.Get(HolographicWebManagementHttpSettingsApi); + WebManagementHttpSettings httpSettings = await this.GetAsync(HolographicWebManagementHttpSettingsApi); return httpSettings.IsHttpsRequired; } diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/HolographicPerception.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/HolographicPerception.cs index 5661cfd9..f7d7ebe3 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/HolographicPerception.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/HolographicPerception.cs @@ -61,14 +61,14 @@ public enum SimulationControlMode /// /// The simulation control mode. /// This method is only supported on HoloLens devices. - public async Task GetPerceptionSimulationControlMode() + public async Task GetPerceptionSimulationControlModeAsync() { if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } - PerceptionSimulationControlMode controlMode = await this.Get(HolographicSimulationModeApi); + PerceptionSimulationControlMode controlMode = await this.GetAsync(HolographicSimulationModeApi); return controlMode.Mode; } @@ -78,7 +78,7 @@ public async Task GetPerceptionSimulationControlMode() /// The simulation control mode. /// This method is only supported on HoloLens devices. /// Task tracking completion of the REST call. - public async Task SetPerceptionSimulationControlMode(SimulationControlMode mode) + public async Task SetPerceptionSimulationControlModeAsync(SimulationControlMode mode) { if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { @@ -88,7 +88,7 @@ public async Task SetPerceptionSimulationControlMode(SimulationControlMode mode) string payload = string.Format( "mode={0}", (int)mode); - await this.Post(HolographicSimulationModeApi, payload); + await this.PostAsync(HolographicSimulationModeApi, payload); } #region Data contract diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/HolographicThermal.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/HolographicThermal.cs index 2bd09afa..92732853 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/HolographicThermal.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/HolographicThermal.cs @@ -51,14 +51,14 @@ public partial class DevicePortal /// /// ThermalStages enum value. /// This method is only supported on HoloLens devices. - public async Task GetThermalStage() + public async Task GetThermalStageAsync() { if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } - ThermalStage thermalStage = await this.Get(ThermalStageApi); + ThermalStage thermalStage = await this.GetAsync(ThermalStageApi); return thermalStage.Stage; } diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/MixedRealityCapture.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/MixedRealityCapture.cs index 2c0434af..d0ab6ce9 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/MixedRealityCapture.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/MixedRealityCapture.cs @@ -83,14 +83,14 @@ public partial class DevicePortal /// The name of the file to be deleted. /// Task tracking completion of the REST call. /// This method is only supported on HoloLens devices. - public async Task DeleteMrcFile(string fileName) + public async Task DeleteMrcFileAsync(string fileName) { if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } - await this.Delete( + await this.DeleteAsync( MrcFileApi, string.Format("filename={0}", Utilities.Hex64Encode(fileName))); } @@ -186,7 +186,7 @@ public Uri GetMediumResolutionMrcLiveStreamUri( /// Specifies whether or not we are requesting a thumbnail image. /// Byte array containing the file data. /// This method is only supported on HoloLens devices. - public async Task GetMrcFileData( + public async Task GetMrcFileDataAsync( string fileName, bool isThumbnailRequest = false) { @@ -199,7 +199,7 @@ public async Task GetMrcFileData( string apiPath = isThumbnailRequest ? MrcThumbnailApi : MrcFileApi; - using (MemoryStream data = await this.Get( + using (MemoryStream data = await this.GetAsync( apiPath, string.Format("filename={0}", Utilities.Hex64Encode(fileName)))) { @@ -215,20 +215,20 @@ public async Task GetMrcFileData( /// /// List of the capture files /// This method is only supported on HoloLens devices. - public async Task GetMrcFileList() + public async Task GetMrcFileListAsync() { if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } - MrcFileList mrcFileList = await this.Get(MrcFileListApi); + MrcFileList mrcFileList = await this.GetAsync(MrcFileListApi); foreach (MrcFileInformation mfi in mrcFileList.Files) { try { - mfi.Thumbnail = await this.GetMrcThumbnailData(mfi.FileName); + mfi.Thumbnail = await this.GetMrcThumbnailDataAsync(mfi.FileName); } catch { @@ -273,14 +273,14 @@ public Uri GetMrcLiveStreamUri( /// /// Status of the capture /// This method is only supported on HoloLens devices. - public async Task GetMrcStatus() + public async Task GetMrcStatusAsync() { if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } - return await this.Get(MrcStatusApi); + return await this.GetAsync(MrcStatusApi); } /// @@ -289,10 +289,10 @@ public async Task GetMrcStatus() /// Name of the capture file /// Byte array containing the thumbnail image data /// This method is only supported on HoloLens devices. - public async Task GetMrcThumbnailData(string fileName) + public async Task GetMrcThumbnailDataAsync(string fileName) { // GetMrcFileData checks for the appropriate platform. We do not need to duplicate the check here. - return await this.GetMrcFileData(fileName, true); + return await this.GetMrcFileDataAsync(fileName, true); } // TODO: SetMrcSettings() @@ -306,7 +306,7 @@ public async Task GetMrcThumbnailData(string fileName) /// Specifies whether or not to include audio data /// Task tracking completion of the REST call. /// This method is only supported on HoloLens devices. - public async Task StartMrcRecording( + public async Task StartMrcRecordingAsync( bool includeHolograms = true, bool includeColorCamera = true, bool includeMicrophone = true, @@ -324,7 +324,7 @@ public async Task StartMrcRecording( includeMicrophone, includeAudio).ToLower(); - await this.Post( + await this.PostAsync( MrcStartRecordingApi, payload); } @@ -334,14 +334,14 @@ await this.Post( /// /// Task tracking completion of the REST call. /// This method is only supported on HoloLens devices. - public async Task StopMrcRecording() + public async Task StopMrcRecordingAsync() { if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } - await this.Post(MrcStopRecordingApi); + await this.PostAsync(MrcStopRecordingApi); } /// @@ -351,7 +351,7 @@ public async Task StopMrcRecording() /// Specifies whether or not to include the color camera /// Task tracking completion of the REST call. /// This method is only supported on HoloLens devices. - public async Task TakeMrcPhoto( + public async Task TakeMrcPhotoAsync( bool includeHolograms = true, bool includeColorCamera = true) { @@ -360,7 +360,7 @@ public async Task TakeMrcPhoto( throw new NotSupportedException("This method is only supported on HoloLens."); } - await this.Post( + await this.PostAsync( MrcPhotoApi, string.Format("holo={0}&pv={1}", includeHolograms, includeColorCamera).ToLower()); } diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/PerceptionSimulationPlayback.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/PerceptionSimulationPlayback.cs index f2ac0723..87d4fc38 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/PerceptionSimulationPlayback.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/PerceptionSimulationPlayback.cs @@ -99,7 +99,7 @@ public enum HolographicSimulationPlaybackStates /// The name of the recording to delete (ex: testsession.xef). /// Task tracking completion of the REST call. /// This method is only supported on HoloLens devices. - public async Task DeleteHolographicSimulationRecording(string name) + public async Task DeleteHolographicSimulationRecordingAsync(string name) { if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { @@ -110,7 +110,7 @@ public async Task DeleteHolographicSimulationRecording(string name) "recording={0}", name); - await this.Delete(HolographicSimulationPlaybackFileApi, payload); + await this.DeleteAsync(HolographicSimulationPlaybackFileApi, payload); } /// @@ -119,7 +119,7 @@ public async Task DeleteHolographicSimulationRecording(string name) /// The name of the recording (ex: testsession.xef). /// HolographicSimulationPlaybackStates enum value describing the state of the recording. /// This method is only supported on HoloLens devices. - public async Task GetHolographicSimulationPlaybackState(string name) + public async Task GetHolographicSimulationPlaybackStateAsync(string name) { if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { @@ -137,7 +137,7 @@ public async Task GetHolographicSimulationP HolographicSimulationPlaybackStateApi, payload); - using (Stream dataStream = await this.Get(uri)) + using (Stream dataStream = await this.GetAsync(uri)) { if ((dataStream != null) && (dataStream.Length != 0)) @@ -169,7 +169,7 @@ public async Task GetHolographicSimulationP /// The name of the recording to load (ex: testsession.xef). /// Task tracking completion of the REST call. /// This method is only supported on HoloLens devices. - public async Task LoadHolographicSimulationRecording(string name) + public async Task LoadHolographicSimulationRecordingAsync(string name) { if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { @@ -180,7 +180,7 @@ public async Task LoadHolographicSimulationRecording(string name) "recording={0}", name); - await this.Post(HolographicSimulationPlaybackSessionFileApi, payload); + await this.PostAsync(HolographicSimulationPlaybackSessionFileApi, payload); } /// @@ -189,7 +189,7 @@ public async Task LoadHolographicSimulationRecording(string name) /// The name of the recording to unload (ex: testsession.xef). /// Task tracking completion of the REST call. /// This method is only supported on HoloLens devices. - public async Task UnloadHolographicSimulationRecording(string name) + public async Task UnloadHolographicSimulationRecordingAsync(string name) { if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { @@ -200,7 +200,7 @@ public async Task UnloadHolographicSimulationRecording(string name) "recording={0}", name); - await this.Delete(HolographicSimulationPlaybackSessionFileApi, payload); + await this.DeleteAsync(HolographicSimulationPlaybackSessionFileApi, payload); } #region Data contract diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/PerceptionSimulationRecording.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/PerceptionSimulationRecording.cs index aed2f011..7f9e9ccc 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/PerceptionSimulationRecording.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/PerceptionSimulationRecording.cs @@ -37,14 +37,14 @@ public partial class DevicePortal /// /// True if recording, false otherwise. /// This method is only supported on HoloLens devices. - public async Task GetHolographicSimulationRecordingStatus() + public async Task GetHolographicSimulationRecordingStatusAsync() { if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } - HolographicSimulationRecordingStatus status = await this.Get(HolographicSimulationRecordingStatusApi); + HolographicSimulationRecordingStatus status = await this.GetAsync(HolographicSimulationRecordingStatusApi); return status.IsRecording; } @@ -58,7 +58,7 @@ public async Task GetHolographicSimulationRecordingStatus() /// Should environment data be recorded? The default value is true. /// Task tracking completion of the REST call. /// This method is only supported on HoloLens devices. - public async Task StartHolographicSimulationRecording( + public async Task StartHolographicSimulationRecordingAsync( string name, bool recordHead = true, bool recordHands = true, @@ -77,7 +77,7 @@ public async Task StartHolographicSimulationRecording( recordSpatialMapping ? 1 : 0, recordEnvironment ? 1 : 0, name); - await this.Post(StartHolographicSimulationRecordingApi, payload); + await this.PostAsync(StartHolographicSimulationRecordingApi, payload); } /// @@ -86,7 +86,7 @@ public async Task StartHolographicSimulationRecording( /// Byte array containing the recorded data. /// No recording was in progress. /// This method is only supported on HoloLens devices. - public async Task StopHolographicSimulationRecording() + public async Task StopHolographicSimulationRecordingAsync() { if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { @@ -99,7 +99,7 @@ public async Task StopHolographicSimulationRecording() byte[] dataBytes = null; - using (Stream dataStream = await this.Get(uri)) + using (Stream dataStream = await this.GetAsync(uri)) { if ((dataStream != null) && (dataStream.Length != 0)) diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/RestDelete.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/RestDelete.cs index f329f96d..15d907aa 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/RestDelete.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/RestDelete.cs @@ -24,11 +24,11 @@ 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 Delete( + private async Task DeleteAsync( string apiPath, string payload = null) { - await this.Delete(apiPath, payload); + await this.DeleteAsync(apiPath, payload); } /// @@ -38,7 +38,7 @@ private async Task Delete( /// 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 Delete( + private async Task DeleteAsync( string apiPath, string payload = null) where T : new() { @@ -51,7 +51,7 @@ private async Task Delete( DataContractJsonSerializer deserializer = new DataContractJsonSerializer(typeof(T)); - using (Stream dataStream = await this.Delete(uri)) + using (Stream dataStream = await this.DeleteAsync(uri)) { if ((dataStream != null) && (dataStream.Length != 0)) diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/RestGet.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/RestGet.cs index 424ca4f6..0a027444 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/RestGet.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/RestGet.cs @@ -70,7 +70,7 @@ 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 Get( + private async Task GetAsync( string apiPath, string payload = null) where T : new() { @@ -83,7 +83,7 @@ private async Task Get( DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(T)); - using (Stream dataStream = await this.Get(uri)) + using (Stream dataStream = await this.GetAsync(uri)) { if ((dataStream != null) && (dataStream.Length != 0)) diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/RestPost.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/RestPost.cs index 26d85157..9b8439e2 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 Post( + private async Task PostAsync( string apiPath, List files, string payload = null) @@ -53,7 +53,7 @@ private async Task Post( dataStream.Position = 0; string contentType = string.Format("multipart/form-data; boundary={0}", boundaryString); - await this.Post(apiPath, payload, dataStream, contentType); + await this.PostAsync(apiPath, payload, dataStream, contentType); } } @@ -65,11 +65,11 @@ private async Task Post( /// 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 Post( + private async Task PostAsync( string apiPath, string payload = null) { - await this.Post(apiPath, payload); + await this.PostAsync(apiPath, payload); } /// @@ -81,7 +81,7 @@ private async Task Post( /// Optional stream containing data for the request body. /// The type of that request body data. /// Task tracking the POST completion. - private async Task Post( + private async Task PostAsync( string apiPath, string payload = null, Stream requestStream = null, @@ -96,7 +96,7 @@ private async Task Post( DataContractJsonSerializer deserializer = new DataContractJsonSerializer(typeof(T)); - using (Stream dataStream = await this.Post(uri, requestStream, requestStreamContentType)) + using (Stream dataStream = await this.PostAsync(uri, requestStream, requestStreamContentType)) { if ((dataStream != null) && (dataStream.Length != 0)) diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/RestPut.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/RestPut.cs index 62d92266..4cc6490a 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/RestPut.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/RestPut.cs @@ -41,12 +41,12 @@ 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 Put( + private async Task PutAsync( string apiPath, K bodyData, string payload = null) where K : class { - await this.Put(apiPath, bodyData, payload); + await this.PutAsync(apiPath, bodyData, payload); } /// @@ -58,7 +58,7 @@ private async Task Put( /// 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 Put( + private async Task PutAsync( string apiPath, K bodyData = null, string payload = null) where T : new() @@ -96,7 +96,7 @@ private async Task Put( DataContractJsonSerializer deserializer = new DataContractJsonSerializer(typeof(T)); - using (Stream dataStream = await this.Put(uri, streamContent)) + using (Stream dataStream = await this.PutAsync(uri, streamContent)) { if ((dataStream != null) && (dataStream.Length != 0)) diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/WebSocket.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/WebSocket.cs index a31061a6..93ae900b 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/WebSocket.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HttpRest/WebSocket.cs @@ -66,11 +66,11 @@ public bool IsListeningForMessages /// Closes the connection to the websocket and stop listening for messages. /// /// The task of closing the websocket connection. - internal async Task StopListeningForMessages() + internal async Task StopListeningForMessagesAsync() { if (this.IsListeningForMessages) { - await this.StopListeningForMessagesInternal(); + await this.StopListeningForMessagesInternalAsync(); } } @@ -80,7 +80,7 @@ internal async Task StopListeningForMessages() /// 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. /// The task of listening for messages from the websocket. - internal async Task StartListeningForMessages( + internal async Task StartListeningForMessagesAsync( string apiPath, string payload = null) { @@ -90,8 +90,7 @@ internal async Task StartListeningForMessages( this.deviceConnection.WebSocketConnection, apiPath, payload); - - await this.StartListeningForMessagesInternal(uri); + await this.StartListeningForMessagesInternalAsync(uri); } } diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/ApplicationManager.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/ApplicationManager.cs index 66ad1382..a7881c25 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/ApplicationManager.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/ApplicationManager.cs @@ -40,18 +40,18 @@ public partial class DevicePortal /// Gets List of apps. /// /// Object containing the list of applications. - public async Task GetAppsListInfo() + public async Task GetAppsListInfoAsync() { - return await this.Get(AppsListApi); + return await this.GetAsync(AppsListApi); } /// /// Gets list of headless apps. /// /// Object containing the list of headless applications. - public async Task GetHeadlessAppsListInfo() + public async Task GetHeadlessAppsListInfoAsync() { - return await this.Get(HeadlessAppsListApi); + return await this.GetAsync(HeadlessAppsListApi); } /// @@ -59,9 +59,9 @@ public async Task GetHeadlessAppsListInfo() /// /// App Id. /// Task tracking completion of the REST call. - public async Task UpdateStartupApp(string appId) + public async Task UpdateStartupAppAsync(string appId) { - await this.Post( + await this.PostAsync( AppsListApi, string.Format("appid={0}", Utilities.Hex64Encode(appId))); } @@ -71,9 +71,9 @@ await this.Post( /// /// App Id. /// Task tracking completion of the REST call. - public async Task UpdateHeadlessStartupApp(string appId) + public async Task UpdateHeadlessStartupAppAsync(string appId) { - await this.Post( + await this.PostAsync( HeadlessStartupAppApi, string.Format("appid={0}", Utilities.Hex64Encode(appId))); } @@ -83,9 +83,9 @@ await this.Post( /// /// App Id. /// Task tracking completion of the REST call. - public async Task RemoveHeadlessStartupApp(string appId) + public async Task RemoveHeadlessStartupAppAsync(string appId) { - await this.Delete( + await this.DeleteAsync( HeadlessStartupAppApi, string.Format("appid={0}", Utilities.Hex64Encode(appId))); } @@ -95,9 +95,9 @@ await this.Delete( /// /// App Id. /// Task tracking completion of the REST call. - public async Task ActivatePackage(string appId) + public async Task ActivatePackageAsync(string appId) { - await this.Post( + await this.PostAsync( ActivatePackageApi, string.Format("appid={0}", Utilities.Hex64Encode(appId))); } diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/AudioDevices.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/AudioDevices.cs index 00a955a8..c36f1b25 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/AudioDevices.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/AudioDevices.cs @@ -35,9 +35,9 @@ public partial class DevicePortal /// Gets the Audio Device List Information. /// /// String containing the Audio Device List information. - public async Task GetAudioDeviceListInfo() + public async Task GetAudioDeviceListInfoAsync() { - return await this.Get(AudioDeviceListApi); + return await this.GetAsync(AudioDeviceListApi); } /// @@ -45,9 +45,9 @@ public async Task GetAudioDeviceListInfo() /// /// Render Volume. /// Task tracking completion of the REST call. - public async Task SetRenderVolume(string renderVolume) + public async Task SetRenderVolumeAsync(string renderVolume) { - await this.Post( + await this.PostAsync( SetRenderVolumeApi, string.Format("rendervolume={0}", Utilities.Hex64Encode(renderVolume))); } @@ -57,9 +57,9 @@ await this.Post( /// /// Capture Volume. /// Task tracking completion of the REST call. - public async Task SetCaptureVolume(string captureVolume) + public async Task SetCaptureVolumeAsync(string captureVolume) { - await this.Post( + await this.PostAsync( SetCaptureVolumeApi, string.Format("capturevolume={0}", Utilities.Hex64Encode(captureVolume))); } diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/BluetoothConnectivity.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/BluetoothConnectivity.cs index 19b62eed..34b1d2ba 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/BluetoothConnectivity.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/BluetoothConnectivity.cs @@ -86,12 +86,12 @@ public AvailableBluetoothDevicesInfo GetAvailableBluetoothDevicesInfo() }; this.BluetoothDeviceListReceived += bluetoothReceivedHandler; - Task startListeningForBluetooth = this.StartListeningForBluetooth(AvailableBluetoothDevicesApi); + Task startListeningForBluetooth = this.StartListeningForBluetoothAsync(AvailableBluetoothDevicesApi); startListeningForBluetooth.Wait(); BluetoothReceived.WaitOne(); - Task stopListeningForBluetooth = this.StopListeningForBluetooth(); + Task stopListeningForBluetooth = this.StopListeningForBluetoothAsync(); stopListeningForBluetooth.Wait(); this.BluetoothDeviceListReceived -= bluetoothReceivedHandler; @@ -118,12 +118,12 @@ public PairedBluetoothDevicesInfo GetPairedBluetoothDevicesInfo() }; this.PairedBluetoothDeviceListReceived += pairedBluetoothReceivedHandler; - Task startListeningForPairedBluetooth = this.StartListeningForPairedBluetooth(PairedBluetoothDevicesApi); + Task startListeningForPairedBluetooth = this.StartListeningForPairedBluetoothAsync(PairedBluetoothDevicesApi); startListeningForPairedBluetooth.Wait(); PairedBluetoothReceived.WaitOne(); - Task stopListeningForPairedBluetooth = this.StopListeningForPairedBluetooth(); + Task stopListeningForPairedBluetooth = this.StopListeningForPairedBluetoothAsync(); stopListeningForPairedBluetooth.Wait(); this.PairedBluetoothDeviceListReceived -= pairedBluetoothReceivedHandler; @@ -149,12 +149,12 @@ public PairBluetoothDevicesInfo GetPairBluetoothDevicesInfo(string deviceId) }; this.PairBluetoothDeviceListReceived += pairBluetoothReceivedHandler; - Task startListeningForPairBluetooth = this.StartListeningForPairBluetooth(PairBluetoothDevicesApi, string.Format("deviceId={0}", Utilities.Hex64Encode(deviceId))); + Task startListeningForPairBluetooth = this.StartListeningForPairBluetoothAsync(PairBluetoothDevicesApi, string.Format("deviceId={0}", Utilities.Hex64Encode(deviceId))); startListeningForPairBluetooth.Wait(); PairBluetoothReceived.WaitOne(); - Task stopListeningForPairBluetooth = this.StopListeningForPairBluetooth(); + Task stopListeningForPairBluetooth = this.StopListeningForPairBluetoothAsync(); stopListeningForPairBluetooth.Wait(); this.PairBluetoothDeviceListReceived -= pairBluetoothReceivedHandler; @@ -165,7 +165,7 @@ public PairBluetoothDevicesInfo GetPairBluetoothDevicesInfo(string deviceId) /// Starts listening for bluetooth list of devices returned from the BluetoothDeviceListReceived handler. /// /// Task for connecting to the websocket but not for listening to it. - public async Task StartListeningForBluetooth(string bluetoothApi) + public async Task StartListeningForBluetoothAsync(string bluetoothApi) { if (this.BluetoothWebSocket == null) { @@ -185,21 +185,21 @@ public async Task StartListeningForBluetooth(string bluetoothApi) } } - await this.BluetoothWebSocket.StartListeningForMessages(bluetoothApi); + await this.BluetoothWebSocket.StartListeningForMessagesAsync(bluetoothApi); } /// /// Stop listening for the list of bluetooth device. /// /// Task to stop listening for bluetooth devices and disconnecting from the websocket . - public async Task StopListeningForBluetooth() + public async Task StopListeningForBluetoothAsync() { if (this.BluetoothWebSocket == null || !this.BluetoothWebSocket.IsListeningForMessages) { return; } - await this.BluetoothWebSocket.StopListeningForMessages(); + await this.BluetoothWebSocket.StopListeningForMessagesAsync(); } /// @@ -223,7 +223,7 @@ private void BluetoothReceivedHandler( /// Starts listening for paired bluetooth list of devices returned from the PairedBluetoothDeviceListReceived handler. /// /// Task for connecting to the websocket but not for listening to it. - public async Task StartListeningForPairedBluetooth(string bluetoothApi) + public async Task StartListeningForPairedBluetoothAsync(string bluetoothApi) { if (this.PairedBluetoothWebSocket == null) { @@ -243,21 +243,21 @@ public async Task StartListeningForPairedBluetooth(string bluetoothApi) } } - await this.PairedBluetoothWebSocket.StartListeningForMessages(bluetoothApi); + await this.PairedBluetoothWebSocket.StartListeningForMessagesAsync(bluetoothApi); } /// /// Stop listening for the list of paired bluetooth device. /// /// Task to stop listening for bluetooth devices and disconnecting from the websocket . - public async Task StopListeningForPairedBluetooth() + public async Task StopListeningForPairedBluetoothAsync() { if (this.PairedBluetoothWebSocket == null || !this.PairedBluetoothWebSocket.IsListeningForMessages) { return; } - await this.PairedBluetoothWebSocket.StopListeningForMessages(); + await this.PairedBluetoothWebSocket.StopListeningForMessagesAsync(); } /// @@ -281,7 +281,7 @@ private void PairedBluetoothReceivedHandler( /// Starts listening for the result to pair the bluetooth device returned from the PairBluetoothDeviceListReceived handler. /// /// Task for connecting to the websocket but not for listening to it. - public async Task StartListeningForPairBluetooth(string bluetoothApi, string payload) + public async Task StartListeningForPairBluetoothAsync(string bluetoothApi, string payload) { if (this.PairBluetoothWebSocket == null) { @@ -301,21 +301,21 @@ public async Task StartListeningForPairBluetooth(string bluetoothApi, string pay } } - await this.PairBluetoothWebSocket.StartListeningForMessages(bluetoothApi, payload); + await this.PairBluetoothWebSocket.StartListeningForMessagesAsync(bluetoothApi, payload); } /// /// Stop listening for the results for pairing bluetooth device. /// /// Task to stop listening for the bluetooth device and disconnecting from the websocket . - public async Task StopListeningForPairBluetooth() + public async Task StopListeningForPairBluetoothAsync() { if (this.PairBluetoothWebSocket == null || !this.PairBluetoothWebSocket.IsListeningForMessages) { return; } - await this.PairBluetoothWebSocket.StopListeningForMessages(); + await this.PairBluetoothWebSocket.StopListeningForMessagesAsync(); } /// @@ -340,9 +340,9 @@ private void PairBluetoothReceivedHandler( /// /// Device Id. /// Task tracking completion of the REST call. - public async Task UnPairBluetoothDevice(string deviceId) + public async Task UnPairBluetoothDeviceAsync(string deviceId) { - return await this.Post( + return await this.PostAsync( UnpairBluetoothDevicesApi, string.Format("deviceId={0}", Utilities.Hex64Encode(deviceId))); } diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/DeviceInfo.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/DeviceInfo.cs index 05445e48..fded71c2 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/DeviceInfo.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/DeviceInfo.cs @@ -70,54 +70,54 @@ public partial class DevicePortal /// Gets the IoT OS Information. /// /// String containing the OS information. - public async Task GetIoTOSInfo() + public async Task GetIoTOSInfoAsync() { - return await this.Get(IoTOsInfoApi); + return await this.GetAsync(IoTOsInfoApi); } /// /// Gets the Timezone information. /// /// String containing the timezone information. - public async Task GetTimezoneInfo() + public async Task GetTimezoneInfoAsync() { - return await this.Get(TimezoneInfoApi); + return await this.GetAsync(TimezoneInfoApi); } /// /// Gets the datetime information. /// /// String containing the datetime information. - public async Task GetDateTimeInfo() + public async Task GetDateTimeInfoAsync() { - return await this.Get(DateTimeInfoApi); + return await this.GetAsync(DateTimeInfoApi); } /// /// Gets the controller driver information. /// /// String containing the controller driver information. - public async Task GetControllerDriverInfo() + public async Task GetControllerDriverInfoAsync() { - return await this.Get(ControllerDriverApi); + return await this.GetAsync(ControllerDriverApi); } /// /// Gets the dispaly orientation information. /// /// String containing the dispaly orientation information. - public async Task GetDisplayOrientationInfo() + public async Task GetDisplayOrientationInfoAsync() { - return await this.Get(DisplayOrientationApi); + return await this.GetAsync(DisplayOrientationApi); } /// /// Gets the dispaly resolution information. /// /// String containing the dispaly resolution information. - public async Task GetDisplayResolutionInfo() + public async Task GetDisplayResolutionInfoAsync() { - return await this.Get(DisplayResolutionApi); + return await this.GetAsync(DisplayResolutionApi); } /// @@ -125,9 +125,9 @@ public async Task GetDisplayResolutionInfo() /// /// Name to set for the device. /// Task tracking completion of the REST call. - public async Task SetIoTDeviceName(string name) + public async Task SetIoTDeviceNameAsync(string name) { - await this.Post(DeviceNameApi, string.Format("newdevicename={0}", Utilities.Hex64Encode(name))); + await this.PostAsync(DeviceNameApi, string.Format("newdevicename={0}", Utilities.Hex64Encode(name))); } /// @@ -136,9 +136,9 @@ public async Task SetIoTDeviceName(string name) /// Old password. /// New desired password. /// Task tracking completion of the REST call. - public async Task SetNewPassword(string oldPassword, string newPassword) + public async Task SetNewPasswordAsync(string oldPassword, string newPassword) { - return await this.Post( + return await this.PostAsync( ResetPasswordApi, string.Format("oldpassword={0}&newpassword={1}", Utilities.Hex64Encode(oldPassword), Utilities.Hex64Encode(newPassword))); } @@ -148,9 +148,9 @@ public async Task SetNewPassword(string oldPassword, string ne /// /// New pin. /// Task tracking completion of the REST call. - public async Task SetNewRemoteDebuggingPin(string newPin) + public async Task SetNewRemoteDebuggingPinAsync(string newPin) { - await this.Post( + await this.PostAsync( NewRemoteDebuggingPinApi, string.Format("newpin={0}", Utilities.Hex64Encode(newPin))); } @@ -160,9 +160,9 @@ await this.Post( /// /// Driver to set. /// Task tracking completion of the REST call. - public async Task SetControllersDrivers(string newDriver) + public async Task SetControllersDriversAsync(string newDriver) { - return await this.Post( + return await this.PostAsync( ControllerDriverApi, string.Format("newdriver={0}", Utilities.Hex64Encode(newDriver))); } @@ -172,9 +172,9 @@ public async Task SetControllersDrivers(string newDriver) /// /// Timezone index. /// Task tracking completion of the REST call. - public async Task SetTimeZone(int index) + public async Task SetTimeZoneAsync(int index) { - return await this.Post( + return await this.PostAsync( SetTimeZoneApi, string.Format("index={0}", index)); } @@ -184,9 +184,9 @@ public async Task SetTimeZone(int index) /// /// New display resolution. /// Task tracking completion of the REST call. - public async Task SetDisplayResolution(string displayResolution) + public async Task SetDisplayResolutionAsync(string displayResolution) { - await this.Post( + await this.PostAsync( DisplayResolutionApi, string.Format("newdisplayresolution={0}", Utilities.Hex64Encode(displayResolution))); } @@ -196,9 +196,9 @@ await this.Post( /// /// Desired orientation. /// Task tracking completion of the REST call. - public async Task SetDisplayOrientation(string displayOrientation) + public async Task SetDisplayOrientationAsync(string displayOrientation) { - await this.Post( + await this.PostAsync( DisplayOrientationApi, string.Format("newdisplayorientation={0}", Utilities.Hex64Encode(displayOrientation))); } diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/IcsManager.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/IcsManager.cs index f317ba99..b598db67 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/IcsManager.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/IcsManager.cs @@ -30,9 +30,9 @@ public partial class DevicePortal /// Gets the internet connection sharing(ICS) interfaces . /// /// String containing the internet connection sharing(ICS) interfaces. - public async Task GetIcsInterfacesInfo() + public async Task GetIcsInterfacesInfoAsync() { - return await this.Get(IcsInterfacesApi); + return await this.GetAsync(IcsInterfacesApi); } /// @@ -41,9 +41,9 @@ public async Task GetIcsInterfacesInfo() /// Private Interface. /// Public Interface. /// Task tracking completion of the REST call. - public async Task IcSharingStart(string privateInterface, string publicInterface) + public async Task IcSharingStartAsync(string privateInterface, string publicInterface) { - await this.Post( + await this.PostAsync( IcSharingApi, string.Format("PrivateInterface={0}&PublicInterface={1}", Utilities.Hex64Encode(privateInterface), Utilities.Hex64Encode(publicInterface))); } @@ -53,9 +53,9 @@ await this.Post( /// Private Interface. /// Public Interface. /// Task tracking completion of the REST call. - public async Task IcSharingStop(string privateInterface, string publicInterface) + public async Task IcSharingStopAsync(string privateInterface, string publicInterface) { - await this.Delete( + await this.DeleteAsync( IcSharingApi, string.Format("PrivateInterface={0}&PublicInterface={1}", Utilities.Hex64Encode(privateInterface), Utilities.Hex64Encode(publicInterface))); } diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/IoTOnboarding.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/IoTOnboarding.cs index 6ac67f22..254d912a 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/IoTOnboarding.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/IoTOnboarding.cs @@ -30,18 +30,18 @@ public partial class DevicePortal /// Retrieves the Soft AP Settings Info. /// /// SoftAPSettingsInfo for this device. - public async Task GetSoftAPSettingsInfo() + public async Task GetSoftAPSettingsInfoAsync() { - return await this.Get(SoftAPSettingsApi); + return await this.GetAsync(SoftAPSettingsApi); } /// /// Retrieves the All Joyn Settings Info. /// /// AllJoynSettingsInfo for this device. - public async Task GetAllJoynSettingsInfo() + public async Task GetAllJoynSettingsInfoAsync() { - return await this.Get(AllJoynSettingsApi); + return await this.GetAsync(AllJoynSettingsApi); } /// @@ -51,9 +51,9 @@ public async Task GetAllJoynSettingsInfo() /// SoftAp Ssid. /// /// SoftAp Password. /// Task tracking completion of the REST call. - public async Task SetSoftApSettings(string softApStatus, string softApSsid, string softApPassword) + public async Task SetSoftApSettingsAsync(string softApStatus, string softApSsid, string softApPassword) { - await this.Post( + await this.PostAsync( SoftAPSettingsApi, string.Format("SoftApEnabled={0}&SoftApSsid={1}&SoftApPassword={2}", Utilities.Hex64Encode(softApStatus), Utilities.Hex64Encode(softApSsid), Utilities.Hex64Encode(softApPassword))); } @@ -66,9 +66,9 @@ await this.Post( /// AllJoyn Manufacturer. /// AllJoyn Number. /// Task tracking completion of the REST call. - public async Task SetAllJoynSettings(string allJoynStatus, string allJoynDescription, string allJoynManufacturer, string allJoynModelNumber) + public async Task SetAllJoynSettingsAsync(string allJoynStatus, string allJoynDescription, string allJoynManufacturer, string allJoynModelNumber) { - await this.Post( + await this.PostAsync( AllJoynSettingsApi, string.Format("AllJoynOnboardingEnabled={0}&AllJoynOnboardingDefaultDescription={1}&AllJoynOnboardingDefaultManufacturer={2}&AllJoynOnboardingModelNumber={3}", Utilities.Hex64Encode(allJoynStatus), Utilities.Hex64Encode(allJoynDescription), Utilities.Hex64Encode(allJoynManufacturer), Utilities.Hex64Encode(allJoynModelNumber))); } diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/Limpet.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/Limpet.cs index 54147d88..eaeee9d0 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/Limpet.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/Limpet.cs @@ -35,9 +35,9 @@ public partial class DevicePortal /// Gets Tpm Settings information. /// /// String containing theTpm Settings information. - public async Task GetTpmSettingsInfo() + public async Task GetTpmSettingsInfoAsync() { - return await this.Get(TpmSettingsApi); + return await this.GetAsync(TpmSettingsApi); } /// @@ -45,27 +45,27 @@ public async Task GetTpmSettingsInfo() /// /// ACPI Table Index. /// Task tracking completion of the REST call. - public async Task SetTpmAcpiTablesInfo(string acpiTableIndex) + public async Task SetTpmAcpiTablesInfoAsync(string acpiTableIndex) { - await this.Post(TpmAcpiTablesApi, string.Format("AcpiTableIndex={0}", Utilities.Hex64Encode(acpiTableIndex))); + await this.PostAsync(TpmAcpiTablesApi, string.Format("AcpiTableIndex={0}", Utilities.Hex64Encode(acpiTableIndex))); } /// /// Gets TPM ACPI Tables information. /// /// List of string containing the TPM ACPI Tables information. - public async Task GetTpmAcpiTablesInfo() + public async Task GetTpmAcpiTablesInfoAsync() { - return await this.Get(TpmAcpiTablesApi); + return await this.GetAsync(TpmAcpiTablesApi); } /// /// Gets TPM Logical Device Settings information. /// /// String containing the TPM Logical Device Settings information. - public async Task GetTpmLogicalDeviceSettingsInfo(int logicalDeviceId) + public async Task GetTpmLogicalDeviceSettingsInfoAsync(int logicalDeviceId) { - return await this.Get(string.Format("{0}/{1}", TpmSettingsApi, logicalDeviceId)); + return await this.GetAsync(string.Format("{0}/{1}", TpmSettingsApi, logicalDeviceId)); } /// @@ -75,9 +75,9 @@ public async Task GetTpmLogicalDeviceSettingsInfo( /// Azure Uri. /// Azure Key. /// Task tracking completion of the REST call. - public async Task SetTpmLogicalDeviceSettingsInfo(int logicalDeviceId, string azureUri, string azureKey) + public async Task SetTpmLogicalDeviceSettingsInfoAsync(int logicalDeviceId, string azureUri, string azureKey) { - await this.Post(string.Format("{0}/{1}", TpmSettingsApi, logicalDeviceId), string.Format("AzureUri={0}&AzureKey={1}", Utilities.Hex64Encode(azureUri), Utilities.Hex64Encode(azureKey))); + await this.PostAsync(string.Format("{0}/{1}", TpmSettingsApi, logicalDeviceId), string.Format("AzureUri={0}&AzureKey={1}", Utilities.Hex64Encode(azureUri), Utilities.Hex64Encode(azureKey))); } /// @@ -85,18 +85,18 @@ public async Task SetTpmLogicalDeviceSettingsInfo(int logicalDeviceId, string az /// /// Logical Device Id. /// Task tracking completion of the REST call. - public async Task ResetTpmLogicalDeviceSettingsInfo(int logicalDeviceId) + public async Task ResetTpmLogicalDeviceSettingsInfoAsync(int logicalDeviceId) { - await this.Delete(string.Format("{0}/{1}", TpmSettingsApi, logicalDeviceId)); + await this.DeleteAsync(string.Format("{0}/{1}", TpmSettingsApi, logicalDeviceId)); } /// /// Gets TPM Azure Token information. /// /// String containing the TPM Azure Token information. - public async Task GetTpmAzureTokenInfo(int logicalDeviceId, string validity) + public async Task GetTpmAzureTokenInfoAsync(int logicalDeviceId, string validity) { - return await this.Get(string.Format("{0}/{1}", TpmAzureTokenApi, logicalDeviceId), string.Format("validity={0}", Utilities.Hex64Encode(validity))); + return await this.GetAsync(string.Format("{0}/{1}", TpmAzureTokenApi, logicalDeviceId), string.Format("validity={0}", Utilities.Hex64Encode(validity))); } #region Data contract diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/ProcessManagement.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/ProcessManagement.cs index cac60c44..648d7a3c 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/ProcessManagement.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/ProcessManagement.cs @@ -32,9 +32,9 @@ public partial class DevicePortal /// Command. /// /// Run As Default Account. /// Task tracking completion of the REST call. - public async Task RunCommand(string command,string runAsDefaultAccount) + public async Task RunCommandAsync(string command, string runAsDefaultAccount) { - await this.Post( + await this.PostAsync( RunCommandApi, string.Format("command={0}&runasdefaultaccount={1}", Utilities.Hex64Encode(command), Utilities.Hex64Encode(runAsDefaultAccount))); } @@ -45,9 +45,9 @@ await this.Post( /// Run As Default Account. /// Timeout. /// String containing the output after the command is executed. - public async Task RunCommandWithoutOutput(string commandWithoutOutput, string runAsDefaultAccount, string timeout) + public async Task RunCommandWithoutOutputAsync(string commandWithoutOutput, string runAsDefaultAccount, string timeout) { - return await this.Post( + return await this.PostAsync( RunCommandWithoutOutputApi, string.Format("command={0}&runasdefaultaccount={1}&timeout={2}", Utilities.Hex64Encode(commandWithoutOutput), Utilities.Hex64Encode(runAsDefaultAccount), Utilities.Hex64Encode(timeout))); } diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/RemoteSettings.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/RemoteSettings.cs index 4710286e..5b54ac45 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/RemoteSettings.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/RemoteSettings.cs @@ -35,18 +35,18 @@ public partial class DevicePortal /// Gets the Remote Settings Status Information. /// /// String containing the Remote Settings Status information. - public async Task GetRemoteSettingsStatusInfo() + public async Task GetRemoteSettingsStatusInfoAsync() { - return await this.Get(RemoteSettingsStatusApi); + return await this.GetAsync(RemoteSettingsStatusApi); } /// /// Enables the remote settings. /// /// Task tracking completion of the REST call. - public async Task RemoteSettingsEnable() + public async Task RemoteSettingsEnableAsync() { - return await this.Post( + return await this.PostAsync( RemoteSettingsEnableApi); } @@ -54,9 +54,9 @@ public async Task RemoteSettingsEnable() /// Disables the remote settings. /// /// Task tracking completion of the REST call. - public async Task RemoteSettingsDisable() + public async Task RemoteSettingsDisableAsync() { - return await this.Post( + return await this.PostAsync( RemoteSettingsDisableApi); } diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/WindowsUpdate.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/WindowsUpdate.cs index 48dd4faf..8ac09c71 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/WindowsUpdate.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/IoT/WindowsUpdate.cs @@ -30,18 +30,18 @@ public partial class DevicePortal /// Gets Status information. /// /// String containing the status information. - public async Task GetStatusInfo() + public async Task GetStatusInfoAsync() { - return await this.Get(StatusApi); + return await this.GetAsync(StatusApi); } /// /// Gets the update install time information. /// /// String containing the update install time information. - public async Task GetUpdateInstallTime() + public async Task GetUpdateInstallTimeAsync() { - return await this.Get(InstallTimeApi); + return await this.GetAsync(InstallTimeApi); } #region Data contract diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Xbox/FiddlerSetup.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Xbox/FiddlerSetup.cs index 9fd78610..9cdaf243 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Xbox/FiddlerSetup.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Xbox/FiddlerSetup.cs @@ -27,7 +27,7 @@ public partial class DevicePortal /// The port the proxy is listening on. /// An optional path to the cert file to use. /// Task tracking completion. A reboot will be required before the tracing begins. - public async Task EnableFiddlerTracing(string proxyAddress, string proxyPort, string certFilePath = null) + public async Task EnableFiddlerTracingAsync(string proxyAddress, string proxyPort, string certFilePath = null) { if (this.Platform != DevicePortalPlatforms.XboxOne) { @@ -45,11 +45,11 @@ public async Task EnableFiddlerTracing(string proxyAddress, string proxyPort, st queryStringList.Add("updateCert", "true"); - await this.Post(FiddlerSetupApi, certFileList, Utilities.BuildQueryString(queryStringList)); + await this.PostAsync(FiddlerSetupApi, certFileList, Utilities.BuildQueryString(queryStringList)); } else { - await this.Post(FiddlerSetupApi, Utilities.BuildQueryString(queryStringList)); + await this.PostAsync(FiddlerSetupApi, Utilities.BuildQueryString(queryStringList)); } } @@ -57,14 +57,14 @@ public async Task EnableFiddlerTracing(string proxyAddress, string proxyPort, st /// Disables Fiddler on the console. /// /// Task tracking completion. A reboot will be required before tracing stops. - public async Task DisableFiddlerTracing() + public async Task DisableFiddlerTracingAsync() { if (this.Platform != DevicePortalPlatforms.XboxOne) { throw new NotSupportedException("This method is only supported on Xbox One."); } - await this.Delete(FiddlerSetupApi); + await this.DeleteAsync(FiddlerSetupApi); } } } diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Xbox/SmbShare.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Xbox/SmbShare.cs index d260b9eb..fc1b73fd 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Xbox/SmbShare.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Xbox/SmbShare.cs @@ -24,14 +24,14 @@ public partial class DevicePortal /// Gets the SMB Share info for the device /// /// The SMB path, username, and password. - public async Task GetSmbShareInfo() + public async Task GetSmbShareInfoAsync() { if (this.Platform != DevicePortalPlatforms.XboxOne) { throw new NotSupportedException("This method is only supported on Xbox One."); } - return await this.Get(GetSmbShareInfoApi); + return await this.GetAsync(GetSmbShareInfoApi); } #region Data contract diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Xbox/UserManagement.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Xbox/UserManagement.cs index ed500bbb..733bf2f2 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Xbox/UserManagement.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Xbox/UserManagement.cs @@ -25,14 +25,14 @@ public partial class DevicePortal /// Gets the Xbox Live user info for all users present on the device /// /// UserList object containing a List of UserInfo objects representing the users on the device. - public async Task GetXboxLiveUsers() + public async Task GetXboxLiveUsersAsync() { if (this.Platform != DevicePortalPlatforms.XboxOne) { throw new NotSupportedException("This method is only supported on Xbox One."); } - return await this.Get(XboxLiveUserApi); + return await this.GetAsync(XboxLiveUserApi); } /// @@ -40,14 +40,14 @@ public async Task GetXboxLiveUsers() /// /// List of users to be updated. /// Task for tracking async completion. - public async Task UpdateXboxLiveUsers(UserList users) + public async Task UpdateXboxLiveUsersAsync(UserList users) { if (this.Platform != DevicePortalPlatforms.XboxOne) { throw new NotSupportedException("This method is only supported on Xbox One."); } - await this.Put(XboxLiveUserApi, users); + await this.PutAsync(XboxLiveUserApi, users); } #region Data contract @@ -142,7 +142,7 @@ public class UserInfo /// /// Gets or sets if the user should be deleted /// - [DataMember(Name = "Delete", EmitDefaultValue = false)] + [DataMember(Name = "DeleteAsync", EmitDefaultValue = false)] public bool? Delete { get; set; } /// diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Xbox/XboxAppDeployment.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Xbox/XboxAppDeployment.cs index 8be29918..923f4381 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Xbox/XboxAppDeployment.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Xbox/XboxAppDeployment.cs @@ -31,14 +31,14 @@ public partial class DevicePortal /// /// Relative folder path where the app can be found. /// Task for tracking async completion. - public async Task RegisterApplication(string folderName) + public async Task RegisterApplicationAsync(string folderName) { if (this.Platform != DevicePortalPlatforms.XboxOne) { throw new NotSupportedException("This method is only supported on Xbox One."); } - await this.Post( + await this.PostAsync( RegisterPackageApi, string.Format("folder={0}", Utilities.Hex64Encode(folderName))); @@ -48,7 +48,7 @@ await this.Post( { await Task.Delay(TimeSpan.FromMilliseconds(500)); - status = await this.GetInstallStatus(); + status = await this.GetInstallStatusAsync(); } while (status == ApplicationInstallStatus.InProgress); } @@ -59,7 +59,7 @@ await this.Post( /// The source folder to upload. /// The destination path to upload it to. /// Task for tracking async completion. - public async Task UploadPackageFolder(string sourceFolder, string destinationFolder) + public async Task UploadPackageFolderAsync(string sourceFolder, string destinationFolder) { if (this.Platform != DevicePortalPlatforms.XboxOne) { @@ -69,7 +69,7 @@ public async Task UploadPackageFolder(string sourceFolder, string destinationFol List files = new List(); files.AddRange(Directory.GetFiles(sourceFolder)); - await this.Post( + await this.PostAsync( UploadPackageFolderApi, files, string.Format("destinationFolder={0}", Utilities.Hex64Encode(destinationFolder))); diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Xbox/XboxLiveSandbox.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Xbox/XboxLiveSandbox.cs index cb88bca1..7d486a02 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Xbox/XboxLiveSandbox.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Xbox/XboxLiveSandbox.cs @@ -23,7 +23,7 @@ public partial class DevicePortal /// Gets the current Xbox Live sandbox value for this device. /// /// The value of the current sandbox this device is in. - public async Task GetXboxLiveSandbox() + public async Task GetXboxLiveSandboxAsync() { /* This method lives with the Xbox wrappers since it's Xbox Live and @@ -31,7 +31,7 @@ This method lives with the Xbox wrappers since it's Xbox Live and there is no check for Xbox platform type here. */ - return await this.Get(XboxLiveSandboxApi); + return await this.GetAsync(XboxLiveSandboxApi); } /// @@ -39,7 +39,7 @@ This method lives with the Xbox wrappers since it's Xbox Live and /// /// The new sandbox to move this device into. /// Task tracking completion. A reboot will be required may be required before the sandbox change takes effect on some devices. - public async Task SetXboxLiveSandbox(string newSandbox) + public async Task SetXboxLiveSandboxAsync(string newSandbox) { /* This method lives with the Xbox wrappers since it's Xbox Live and @@ -50,7 +50,7 @@ This method lives with the Xbox wrappers since it's Xbox Live and Sandbox sandbox = new Sandbox(); sandbox.Value = newSandbox; - return await this.Put(XboxLiveSandboxApi, sandbox); + return await this.PutAsync(XboxLiveSandboxApi, sandbox); } #region Data contract diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Xbox/XboxMediaCapture.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Xbox/XboxMediaCapture.cs index 9362d9c2..27bd4615 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Xbox/XboxMediaCapture.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Xbox/XboxMediaCapture.cs @@ -24,7 +24,7 @@ public partial class DevicePortal /// Takes a current screenshot of the device. /// /// A stream of the screenshot in PNG form. - public async Task TakeXboxScreenshot() + public async Task TakeXboxScreenshotAsync() { if (this.Platform != DevicePortalPlatforms.XboxOne) { @@ -35,7 +35,7 @@ public async Task TakeXboxScreenshot() this.deviceConnection.Connection, GetXboxScreenshotApi); - return await this.Get(uri); + return await this.GetAsync(uri); } } } diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Xbox/XboxSettings.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Xbox/XboxSettings.cs index f7458920..8af1abb9 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Xbox/XboxSettings.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Xbox/XboxSettings.cs @@ -26,14 +26,14 @@ public partial class DevicePortal /// Gets the Xbox Settings info for all settings which can be controlled on the device. /// /// XboxSettingList object containing a List of XboxSetting objects representing the settings on the device. - public async Task GetXboxSettings() + public async Task GetXboxSettingsAsync() { if (this.Platform != DevicePortalPlatforms.XboxOne) { throw new NotSupportedException("This method is only supported on Xbox One."); } - return await this.Get(XboxSettingsApi); + return await this.GetAsync(XboxSettingsApi); } /// @@ -41,14 +41,14 @@ public async Task GetXboxSettings() /// /// Name of the setting we want to retrieve. /// XboxSetting object containing a information about the settings on the device. - public async Task GetXboxSetting(string settingName) + public async Task GetXboxSettingAsync(string settingName) { if (this.Platform != DevicePortalPlatforms.XboxOne) { throw new NotSupportedException("This method is only supported on Xbox One."); } - return await this.Get(Path.Combine(XboxSettingsApi, settingName)); + return await this.GetAsync(Path.Combine(XboxSettingsApi, settingName)); } /// @@ -56,14 +56,14 @@ public async Task GetXboxSetting(string settingName) /// /// Setting to be updated. /// Task for tracking async completion. - public async Task UpdateXboxSetting(XboxSetting setting) + public async Task UpdateXboxSettingAsync(XboxSetting setting) { if (this.Platform != DevicePortalPlatforms.XboxOne) { throw new NotSupportedException("This method is only supported on Xbox One."); } - return await this.Put(Path.Combine(XboxSettingsApi, setting.Name), setting); + return await this.PutAsync(Path.Combine(XboxSettingsApi, setting.Name), setting); } #region Data contract diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/CertificateHandling.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/CertificateHandling.cs index 49482fdf..35a6261f 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/CertificateHandling.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/CertificateHandling.cs @@ -26,7 +26,7 @@ public partial class DevicePortal /// Whether or not we should accept untrusted certificates. /// The device certificate. #pragma warning disable 1998 - public async Task GetRootDeviceCertificate(bool acceptUntrustedCerts = false) + public async Task GetRootDeviceCertificateAsync(bool acceptUntrustedCerts = false) { Certificate certificate = null; diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/Core/AppDeployment.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/Core/AppDeployment.cs index b7f9474f..61328091 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/Core/AppDeployment.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/Core/AppDeployment.cs @@ -31,7 +31,7 @@ public partial class DevicePortal /// /// The status #pragma warning disable 1998 - public async Task GetInstallStatus() + public async Task GetInstallStatusAsync() { ApplicationInstallStatus status = ApplicationInstallStatus.None; diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/HttpRest/RestDelete.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/HttpRest/RestDelete.cs index 25769d3e..ed8aa767 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/HttpRest/RestDelete.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/HttpRest/RestDelete.cs @@ -18,7 +18,7 @@ namespace Microsoft.Tools.WindowsDevicePortal { /// - /// Universal Windows Platform implementation of HTTP Delete + /// Universal Windows Platform implementation of HTTP DeleteAsync /// public partial class DevicePortal { @@ -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 Delete(Uri uri) + private 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 3ffea499..38593c45 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/HttpRest/RestGet.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/HttpRest/RestGet.cs @@ -18,7 +18,7 @@ namespace Microsoft.Tools.WindowsDevicePortal { /// - /// Universal Windows Platform implementation of HTTP Get + /// Universal Windows Platform implementation of HTTP GetAsync /// public partial class DevicePortal { @@ -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 Get(Uri uri) + private 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 d4bc4e28..3a634322 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/HttpRest/RestPost.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/HttpRest/RestPost.cs @@ -18,7 +18,7 @@ namespace Microsoft.Tools.WindowsDevicePortal { /// - /// Universal Windows Platform implementation of HTTP Post + /// Universal Windows Platform implementation of HTTP PostAsync /// public partial class DevicePortal { @@ -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 Post( + private 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 fb0656cd..36548ec0 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/HttpRest/RestPut.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/HttpRest/RestPut.cs @@ -18,7 +18,7 @@ namespace Microsoft.Tools.WindowsDevicePortal { /// - /// Universal Windows Platform implementation of HTTP Put + /// Universal Windows Platform implementation of HTTP PutAsync /// public partial class DevicePortal { @@ -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 Put( + private async Task PutAsync( Uri uri, IHttpContent body = null) { diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/HttpRest/WebSocket.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/HttpRest/WebSocket.cs index dd0dae4b..52395049 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/HttpRest/WebSocket.cs +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/HttpRest/WebSocket.cs @@ -42,7 +42,7 @@ public WebSocket(IDevicePortalConnection connection, bool sendStreams = false) /// The uri that the weboscket should connect to /// The task of opening a connection to the websocket. #pragma warning disable 1998 - private async Task StartListeningForMessagesInternal( + private async Task StartListeningForMessagesInternalAsync( Uri endpoint) { this.websocket = new MessageWebSocket(); @@ -130,7 +130,7 @@ private void MessageReceived(MessageWebSocket sender, MessageWebSocketMessageRec /// /// The task of closing the websocket connection. #pragma warning disable 1998 - private async Task StopListeningForMessagesInternal() + private async Task StopListeningForMessagesInternalAsync() { if (this.IsListeningForMessages) { diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/Properties/AssemblyInfo.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/Properties/AssemblyInfo.cs index b2aed5e6..6f097b63 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.0.0")] -[assembly: AssemblyFileVersion("0.9.0.0")] +[assembly: AssemblyVersion("0.9.1.0")] +[assembly: AssemblyFileVersion("0.9.1.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 ac6abbce..52acc73d 100644 --- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/WindowsDevicePortalWrapper.UniversalWindows.csproj +++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.UniversalWindows/WindowsDevicePortalWrapper.UniversalWindows.csproj @@ -11,7 +11,7 @@ WindowsDevicePortalWrapper.UniversalWindows en-US UAP - 10.0.10586.0 + 10.0.14393.0 10.0.10240.0 14 512 @@ -126,7 +126,7 @@ 14.0 - +