public static IConnection CreateConnection(FavoriteConfigurationElement Favorite, TerminalTabControlItem TerminalTabPage, MainForm parentForm)
 {
     IConnection conn = null; ;
     switch (Favorite.Protocol) {
         case "VNC":
             conn = new VNCConnection();
             break;
         case "VMRC":
             conn = new VMRCConnection();
             break;
         case "RAS":
             conn = new RASConnection();
             break;
         case "Telnet":
             conn = new TerminalConnection();
             break;
         case "ICA Citrix":
             conn = new ICAConnection();
             break;
         case "HTTP":
             conn = new HTTPConnection();
             break;
         case "HTTPS":
             conn = new HTTPConnection();
             break;
         default:
             conn = new RDPConnection();
             break;
     }
     conn.Favorite = Favorite;
     TerminalTabPage.Connection = conn;
     conn.TerminalTabPage = TerminalTabPage;
     conn.ParentForm = parentForm;
     return conn;
 }
        public static IConnection CreateConnection(FavoriteConfigurationElement Favorite, TerminalTabControlItem TerminalTabPage, MainForm parentForm)
        {
            IConnection conn = null;;

            switch (Favorite.Protocol)
            {
            case "VNC":
                conn = new VNCConnection();
                break;

            case "VMRC":
                conn = new VMRCConnection();
                break;

            case "RAS":
                conn = new RASConnection();
                break;

            case "Telnet":
                conn = new TerminalConnection();
                break;

            case "ICA Citrix":
                conn = new ICAConnection();
                break;

            case "HTTP":
                conn = new HTTPConnection();
                break;

            case "HTTPS":
                conn = new HTTPConnection();
                break;

            default:
                conn = new RDPConnection();
                break;
            }
            conn.Favorite = Favorite;
            TerminalTabPage.Connection = conn;
            conn.TerminalTabPage       = TerminalTabPage;
            conn.ParentForm            = parentForm;
            return(conn);
        }