コード例 #1
0
 private void ReceiveEncryptionStatus(dynamic jsonData)
 {
     try
     {
         if (jsonData["Status"] == "On")
         {
             Encryptor     = new Encryption();
             Encryptor.Key = Encryption.GetClientKey();
             if (Encryptor.Key == null)
             {
                 AditViewer.Disconnect();
                 Pages.Viewer.Current.RefreshUICall();
                 return;
             }
         }
         else if (jsonData["Status"] == "Failed")
         {
             throw new Exception("Server failed to start encrypted connection.");
         }
         SendConnectionType(ConnectionTypes.Viewer);
     }
     catch (Exception ex)
     {
         Utilities.WriteToLog(ex);
         System.Windows.MessageBox.Show("There was a problem starting an encrypted connection.  If the issue persists, please contact support.", "Connection Error", MessageBoxButton.OK, MessageBoxImage.Error);
         Environment.Exit(0);
     }
 }
コード例 #2
0
 private void ReceiveRequestForElevatedClient(dynamic jsonData)
 {
     if (jsonData["Status"] == "failed")
     {
         MessageBox.Show("Failed to connect to client.", "Connection Failed", MessageBoxButton.OK, MessageBoxImage.Error);
         AditViewer.Disconnect();
     }
     else if (jsonData["Status"] == "ok")
     {
         AditViewer.Disconnect();
         AditViewer.Connect(jsonData["ClientSessionID"]);
     }
 }
コード例 #3
0
        private void ReceiveParticipantList(dynamic jsonData)
        {
            var participantList = ((object[])jsonData["ParticipantList"]).Select(x => x.ToString()).ToList();

            if (participantList.Count == 1)
            {
                FlyoutNotification.Show("Connection to partner has been closed.");
                AditViewer.Disconnect();
            }
            else if (participantList.Count > AditViewer.ParticipantList.Count)
            {
                FlyoutNotification.Show("A partner has connected.");
            }
            else if (participantList.Count < AditViewer.ParticipantList.Count)
            {
                FlyoutNotification.Show("A partner has disconnected.");
            }
            AditViewer.ParticipantList = participantList;
        }