Пример #1
0
        // Routine to send the Clear Screen command and then wait until the Session Calms down
        private void ClearScreenAndWait()
        {
            _Handler.SendKey("@C");

            _Handler.WaitForSession(SessionDisplayWaitType.NotBusy, 20000);
            TraceScreen();
        }
Пример #2
0
        private bool SetOpeningState()
        {
            try
            {
                // if we are doing 3270
                if (_use3270)
                {
                    // connect to the host if not already done so
                    if (m_Handler == null)
                    {
                        m_Handler = new SessionDisplay();
                        m_Handler.Connect("TRANSPORT=SNA;LOGICALUNITNAME=" + this.InputLUNameBox.Text.Trim().ToUpperInvariant());
                        m_Handler.Connection.HostCodePage = 37;

                        // set the large form, so that we can see 3270 stuff
                        this.Width = _largeWindowSize;

                        // wait for the Message 10 Screen
                        m_Handler.WaitForContent("TERM NAME", 20000);

                        // try to connect to CICS
                        m_Handler.SendKey("LOGON APPLID(" + this.InputCICSNameBox.Text.Trim().ToUpperInvariant() + ")@E");

                        // must be in PLU session
                        m_Handler.WaitForSession(SessionDisplayWaitType.PLUSLU, 20000);

                        // wait for the blurb to come
                        m_Handler.WaitForContent(@"DEMONSTRATION", 20000);

                        // go to the clear screen
                        ClearScreenAndWait();

                        _hostOK = true;
                    }
                }
                else
                {
                    // squash the form down!
                    this.Width  = 1049;
                    this.Height = 588;
                    _hostOK     = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                if (m_Handler != null)
                {
                    m_Handler.Disconnect();
                }
                m_Handler = null;
                return(false);
            }
            DisableEverything();

            EnableWorkTab();
            return(true);
        }