상속: ProtocolBase
예제 #1
0
        public ProtocolBase CreateProtocol(ConnectionInfo connectionInfo)
        {
            ProtocolBase newProtocol = default(ProtocolBase);

            switch (connectionInfo.Protocol)
            {
            case ProtocolType.RDP:
                newProtocol = new ProtocolRDP();
                ((ProtocolRDP)newProtocol).tmrReconnect.Elapsed += ((ProtocolRDP)newProtocol).tmrReconnect_Elapsed;
                break;

            case ProtocolType.VNC:
                newProtocol = new ProtocolVNC();
                break;

            case ProtocolType.SSH1:
                newProtocol = new ProtocolSSH1();
                break;

            case ProtocolType.SSH2:
                newProtocol = new ProtocolSSH2();
                break;

            case ProtocolType.Telnet:
                newProtocol = new ProtocolTelnet();
                break;

            case ProtocolType.Rlogin:
                newProtocol = new ProtocolRlogin();
                break;

            case ProtocolType.RAW:
                newProtocol = new ProtocolRAW();
                break;

            case ProtocolType.HTTP:
                newProtocol = new ProtocolHTTP(connectionInfo.RenderingEngine);
                break;

            case ProtocolType.HTTPS:
                newProtocol = new ProtocolHTTPS(connectionInfo.RenderingEngine);
                break;

            case ProtocolType.ICA:
                newProtocol = new ProtocolICA();
                ((ProtocolICA)newProtocol).tmrReconnect.Elapsed += ((ProtocolICA)newProtocol).tmrReconnect_Elapsed;
                break;

            case ProtocolType.IntApp:
                newProtocol = new IntegratedProgram();
                if (connectionInfo.ExtApp == "")
                {
                    throw (new Exception(Language.strNoExtAppDefined));
                }
                break;
            }
            return(newProtocol);
        }
예제 #2
0
 public ProtocolBase CreateProtocol(ConnectionInfo connectionInfo)
 {
     ProtocolBase newProtocol = default(ProtocolBase);
     switch (connectionInfo.Protocol)
     {
         case ProtocolType.RDP:
             newProtocol = new ProtocolRDP();
             ((ProtocolRDP) newProtocol).tmrReconnect.Elapsed += ((ProtocolRDP) newProtocol).tmrReconnect_Elapsed;
             break;
         case ProtocolType.VNC:
             newProtocol = new ProtocolVNC();
             break;
         case ProtocolType.SSH1:
             newProtocol = new ProtocolSSH1();
             break;
         case ProtocolType.SSH2:
             newProtocol = new ProtocolSSH2();
             break;
         case ProtocolType.Telnet:
             newProtocol = new ProtocolTelnet();
             break;
         case ProtocolType.Rlogin:
             newProtocol = new ProtocolRlogin();
             break;
         case ProtocolType.RAW:
             newProtocol = new ProtocolRAW();
             break;
         case ProtocolType.HTTP:
             newProtocol = new ProtocolHTTP(connectionInfo.RenderingEngine);
             break;
         case ProtocolType.HTTPS:
             newProtocol = new ProtocolHTTPS(connectionInfo.RenderingEngine);
             break;
         case ProtocolType.ICA:
             newProtocol = new ProtocolICA();
             ((ProtocolICA) newProtocol).tmrReconnect.Elapsed += ((ProtocolICA) newProtocol).tmrReconnect_Elapsed;
             break;
         case ProtocolType.IntApp:
             newProtocol = new IntegratedProgram();
             if (connectionInfo.ExtApp == "")
             {
                 throw (new Exception(Language.strNoExtAppDefined));
             }
             break;
     }
     return newProtocol;
 }
예제 #3
0
        public ProtocolBase CreateProtocol(ConnectionInfo connectionInfo)
        {
            var newProtocol = default(ProtocolBase);

            // ReSharper disable once SwitchStatementMissingSomeCases
            switch (connectionInfo.Protocol)
            {
            case ProtocolType.RDP:
                newProtocol = new RdpProtocol
                {
                    LoadBalanceInfoUseUtf8 = Settings.Default.RdpLoadBalanceInfoUseUtf8
                };
                ((RdpProtocol)newProtocol).tmrReconnect.Elapsed += ((RdpProtocol)newProtocol).tmrReconnect_Elapsed;
                break;

            case ProtocolType.VNC:
                newProtocol = new ProtocolVNC();
                break;

            case ProtocolType.SSH1:
                newProtocol = new ProtocolSSH1();
                break;

            case ProtocolType.SSH2:
                newProtocol = new ProtocolSSH2();
                break;

            case ProtocolType.Telnet:
                newProtocol = new ProtocolTelnet();
                break;

            case ProtocolType.Rlogin:
                newProtocol = new ProtocolRlogin();
                break;

            case ProtocolType.RAW:
                newProtocol = new RawProtocol();
                break;

            case ProtocolType.HTTP:
                newProtocol = new ProtocolHTTP(connectionInfo.RenderingEngine);
                break;

            case ProtocolType.HTTPS:
                newProtocol = new ProtocolHTTPS(connectionInfo.RenderingEngine);
                break;

            case ProtocolType.ICA:
                newProtocol = new IcaProtocol();
                ((IcaProtocol)newProtocol).tmrReconnect.Elapsed += ((IcaProtocol)newProtocol).tmrReconnect_Elapsed;
                break;

            case ProtocolType.IntApp:
                newProtocol = new IntegratedProgram();
                if (connectionInfo.ExtApp == "")
                {
                    throw (new Exception(Language.strNoExtAppDefined));
                }

                break;
            }

            return(newProtocol);
        }