Beispiel #1
0
 public void disconnectrdp()
 {
     if (connection != null)
     {
         if (connection.IsConnected && client.autosignout)
         {
             connection.PushMessage(new RPAMessage("signout"));
         }
     }
     if (freerdp != null)
     {
         if (freerdp.Connected)
         {
             freerdp.Disconnect();
         }
         freerdp.Dispose();
     }
     freerdp = null;
     if (rdp != null)
     {
         if (rdp.Connected)
         {
             rdp.Disconnect();
         }
         rdp.Dispose();
     }
     rdp = null;
     cancellationTokenSource.Cancel();
 }
Beispiel #2
0
        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    //if (rdpClient != null)
                    //{
                    //    if(rdpClient.isConnected) rdpClient.Disconnect();
                    //    rdpClient.Dispose();
                    //}
                    //rdpClient = null;
                    if (rdp != null)
                    {
                        if (rdp.Connected)
                        {
                            rdp.Disconnect();
                        }
                        rdp.Dispose();
                    }
                    rdp = null;
                    cancellationTokenSource.Cancel();

                    if (connection != null)
                    {
                        if (connection.IsConnected)
                        {
                            connection.Close();
                        }
                        connection = null;
                    }
                }
                disposedValue = true;
            }
        }
        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    if (freerdp != null)
                    {
                        if (freerdp.Connected)
                        {
                            freerdp.Disconnect();
                        }
                        freerdp.Dispose();
                    }
                    freerdp = null;
                    if (rdp != null)
                    {
                        if (rdp.Connected)
                        {
                            rdp.Disconnect();
                        }
                        rdp.Dispose();
                    }
                    rdp = null;
                    cancellationTokenSource.Cancel();

                    if (connection != null)
                    {
                        if (connection.IsConnected)
                        {
                            connection.Close();
                        }
                        connection = null;
                    }
                }
                disposedValue = true;
            }
        }
Beispiel #4
0
 public void disconnectrdp()
 {
     // _ = SendSignout();
     if (freerdp != null)
     {
         if (freerdp.Connected)
         {
             freerdp.Disconnect();
         }
         freerdp.Dispose();
     }
     freerdp = null;
     if (rdp != null)
     {
         if (rdp.Connected)
         {
             rdp.Disconnect();
         }
         rdp.Dispose();
     }
     rdp = null;
     cancellationTokenSource.Cancel();
 }