Commit 22bc4649 authored by Jason Williams's avatar Jason Williams Committed by GitHub
Browse files

Merge pull request #131 from hpsin/master

Change TestApp to use ConnectionStatus
parents c4ca5c6d 7955bb8a
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(