/// <summary>
        /// send keystrokes intended to signoff the display session to the Settings.SessId
        /// identified display session window.
        /// </summary>
        /// <param name="InSess"></param>
        public void Play_Signoff(DisplaySession InSess)
        {
            while (true)
            {
                PresentationSpace          ps  = InSess.GetPresentationSpace();
                CommonScreens.SignonScreen sos = new CommonScreens.SignonScreen(ps);
                if (sos.IsScreen( ))
                {
                    throw new EhllapiExcp("At signon screen. cant signoff from this screen.");
                }

                InSess.SendKeys(Ehllapier.Key.SystemRequest + Ehllapier.Key.Enter);
                InSess.Wait();

                ps = InSess.GetPresentationSpace();
                var sysrqs = new CommonScreens.SystemRequestMenuScreen(ps);
                if (sysrqs.IsScreen( ))
                {
                    break;
                }
            }

            InSess.SendKeys("90" + Ehllapier.Key.Enter);
            InSess.Wait();

            // signoff prompt
            InSess.SendKeys(Ehllapier.Key.Enter);
            InSess.Wait();

            return;

            InSess.SendKeys(Ehllapier.Key.SystemRequest + "90" + Ehllapier.Key.Enter);
            Play_Signoff_WaitUntilSignedOff(InSess);
        }
Esempio n. 2
0
        public static bool IsScreen(EhllapiSettings Settings)
        {
            bool isScreen = false;

            using (DisplaySession sess = new DisplaySession())
            {
                sess.Connect(Settings.SessId);
                isScreen = SignonScreen.IsScreen(sess);
            }
            return(isScreen);
        }
Esempio n. 3
0
        /// <summary>
        /// If the session display does not contain a signon screen, automatically sign
        /// the session off.
        /// </summary>
        /// <param name="SessId"></param>
        public static SessIdMessage AssureSignedOff(string SessId)
        {
            SessIdMessage msg      = null;
            var           settings = EhllapiSettings.RecallSettings();

            settings.SessId = SessId;

            // make sure the session is active.
            SessionScript.Assure_ClientAccessSession(settings);

            msg = SignonScreen.AssureSignedOff(settings);
            return(msg);
        }
Esempio n. 4
0
        public static bool IsScreen(DisplaySession DisplaySession)
        {
            SignonScreen dms =
                new SignonScreen(DisplaySession.GetPresentationSpace());

            if (dms.IsScreen() == true)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
 private void Play_Signoff_WaitUntilSignedOff(DisplaySession InSess)
 {
     while (true)
     {
         InSess.Wait( );
         PresentationSpace          ps  = InSess.GetPresentationSpace();
         CommonScreens.SignonScreen sos = new CommonScreens.SignonScreen(ps);
         if (sos.IsScreen( ))
         {
             break;
         }
         Thread.Sleep(1);
     }
 }
Esempio n. 6
0
        public static SessIdMessage AssureSignedOff(EhllapiSettings Settings)
        {
            SessIdMessage msg = null;

            if (SignonScreen.IsScreen(Settings) == false)
            {
                var script = new SessionScript();
                var sess   = new DisplaySession();
                script.Play_Signoff(Settings);
                msg = new SessIdMessage()
                {
                    SessId  = Settings.SessId,
                    Message = "Session signed off"
                };
            }

            return(msg);
        }
        public void AssureSignoff(EhllapiSettings Settings)
        {
            SessionScript script = new SessionScript();

            try
            {
                using (DisplaySession sess = new DisplaySession())
                {
                    sess.Connect(Settings.SessId);
                    var sos = new CommonScreens.SignonScreen(sess.GetPresentationSpace( ));
                    if (sos.IsScreen( ) == true)
                    {
                        Play_Signoff(sess);
                    }
                }
            }
            catch (ApplicationException excp)
            {
                throw new EhllapiExcp("AssureSignoff failed. " + excp.Message, excp);
            }
        }