Example #1
0
 public void Dispose()
 {
     try
     {
         if (rdpConnection != null && rdpConnection.Connected != 0)
         {
             rdpConnection.Disconnect();
         }
     }
     catch (Exception ex)
     {
         Log.Debug(ex.ToString());
     }
     if (rdpConnection != null)
     {
         rdpConnection.Dispose();
     }
     rdpConnection = null;
     try
     {
         if (form != null)
         {
             form.Close();
         }
     }
     catch (Exception ex)
     {
         Log.Debug(ex.ToString());
     }
     if (form != null)
     {
         form.Dispose();
     }
     form = null;
 }
Example #2
0
 public void Dispose()
 {
     try
     {
         if (rdpConnection != null)
         {
             rdpConnection.Disconnect();
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.ToString());
     }
     if (rdpConnection != null)
     {
         rdpConnection.Dispose();
     }
     rdpConnection = null;
     try
     {
         if (form != null)
         {
             form.Close();
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.ToString());
     }
     if (form != null)
     {
         form.Dispose();
     }
     form = null;
 }