public void Connect(ITerminalConfig config) { if (config.TermType == "IBM-3477-FC" || config.TermType == "IBM-3477-FG" || config.TermType == "IBM-3180-2") { emulator = new IBM5250.Emulator(true); telnet.Terminal_Type = "IBM-3477-FC"; emulator.TerminalType = "3477"; emulator.TerminalModel = "FC"; } else { emulator = new IBM5250.Emulator(false); telnet.Terminal_Type = "IBM-3179-2"; emulator.TerminalType = "3179"; emulator.TerminalModel = "2"; } emulator.DataReady += Emulator_DataReady; emulator.CursorPositionSet += Emulator_CursorPositionSet; telnet.IBM_AuthEncryptionMethod = Telnet.De.Mud.Telnet.TelnetProtocolHandler.IBMAuthEncryptionType.SHA1; telnet.Connect(config.Hostname, config.Port, config.UseSSL); //emu.Config.FastScreenMode = true; // //Retrieve host settings // emu.Config.HostName = Hostname; // emu.Config.HostPort = port; // emu.Config.TermType = TermType; // emu.Config.UseSSL = UseSSL; //Begin the connection process asynchomously IsConnecting = true; }
public void Connect(ITerminalConfig config) { emu.Config.FastScreenMode = true; emu.Config.HostName = config.Hostname; emu.Config.HostPort = config.Port; emu.Config.TermType = config.TermType; emu.Config.UseSSL = config.UseSSL; emu.Config.ThrowExceptionOnLockedScreen = false; IsConnecting = true; Task.Factory.StartNew(ConnectToHost).ContinueWith((t) => { IsConnecting = false; IsConnected = emu.IsConnected; var ScreenText = emu.CurrentScreenXML?.Dump(); }); }