Beispiel #1
0
        public ITerminalConnection EstablishConnection(IPoderosaMainWindow window, ITerminalParameter param, ITerminalSettings settings)
        {
            SerialTerminalParam    sp = param as SerialTerminalParam;
            SerialTerminalSettings ts = settings as SerialTerminalSettings;

            Debug.Assert(sp != null && ts != null);

            return(SerialPortUtil.CreateNewSerialConnection(window, sp, ts));
        }
        private void OnOK(object sender, EventArgs args)
        {
            _connection       = null;
            this.DialogResult = DialogResult.None;

            if (!ValidateParam())
            {
                return;
            }

            try {
                _connection = SerialPortUtil.CreateNewSerialConnection(null, _terminalParam, _terminalSettings);
                if (_connection != null)
                {
                    this.DialogResult = DialogResult.OK;
                }
            }
            catch (Exception ex) {
                GUtil.Warning(this, ex.Message);
            }
        }