Commit 7955bb8a authored by Hirsch Singhal's avatar Hirsch Singhal
Browse files

Change TestApp to use ConnectionStatus

parent dd4475ec
Loading
Loading
Loading
Loading
+23 −20
Original line number Diff line number Diff line
@@ -85,11 +85,9 @@ namespace SampleWdpClient.UniversalWindows
                    sb.Append(this.MarshalGetCommandOutput());
                    sb.AppendLine("Connecting...");
                    this.MarshalUpdateCommandOutput(sb.ToString());

                    try
                    portal.ConnectionStatus += (portal, connectArgs) =>
                    {
                        await portal.Connect();

                        if (connectArgs.Status == DeviceConnectionStatus.Connected) { 
                            sb.Append("Connected to: ");
                            sb.AppendLine(portal.Address);
                            sb.Append("OS version: ");
@@ -101,11 +99,16 @@ namespace SampleWdpClient.UniversalWindows
                                portal.PlatformName,
                                portal.Platform.ToString()));
                        }
                    catch(Exception ex)
                        else if (connectArgs.Status == DeviceConnectionStatus.Failed)
                        { 
                        sb.AppendLine("Failed to connect to the device.");
                        sb.AppendLine(ex.GetType().ToString() + " - " + ex.Message);
                        sb.AppendLine(connectArgs.Message);
                        }
                    };
                    
                        await portal.Connect();

                      
                });

            Task continuationTask = connectTask.ContinueWith(