Example #1
0
 private void ConnectionStateChangeConnectHandler(ConnectionStateChangedEventArgs args)
 {
     if (_completionStates.Contains(args.State))
     {
         bool flag;
         lock (_serversInScopeLock)
         {
             flag = _serversInScope.Remove(args.Server);
         }
         if (flag)
         {
             _throttledAction.CompleteAction();
         }
     }
 }
Example #2
0
        private static void Server_ConnectionStateChanged(ConnectionStateChangedEventArgs args)
        {
            ReconnectServerRef reconnectServerRef = args.Server.FindServerRef <ReconnectServerRef>();

            if (reconnectServerRef != null)
            {
                switch (args.State)
                {
                case RdpClient.ConnectionState.Connecting:
                    reconnectServerRef.OnConnecting();
                    break;

                case RdpClient.ConnectionState.Connected:
                    reconnectServerRef.OnConnected();
                    break;

                case RdpClient.ConnectionState.Disconnected:
                    reconnectServerRef.OnDisconnected();
                    break;
                }
            }
        }
Example #3
0
        private static void Server_ConnectionStateChanged(ConnectionStateChangedEventArgs args)
        {
            switch (args.State)
            {
            case RdpClient.ConnectionState.Connecting:
                break;

            case RdpClient.ConnectionState.Connected:
                Instance.AddReference(args.Server);
                break;

            case RdpClient.ConnectionState.Disconnected:
            {
                RdcTreeNode rdcTreeNode = args.Server.FindServerRef <ConnectedServerRef>();
                if (rdcTreeNode != null)
                {
                    ServerTree.Instance.RemoveNode(rdcTreeNode);
                }
                break;
            }
            }
        }