Esempio n. 1
0
        private void timerPush_Tick(object sender, EventArgs e)
        {
            _pushData = null;
            if (_rpd == null)
            {
                string resource = "TimecodePush";
                _rpd = new RestController <PushData>(Settings.RestController.ServerBase, resource, Settings.RestController.ResourcePrefix);
            }
            if (_sessionInformation != null && _rpd != null)
            {
                string parameter = "?data=" + _sessionInformation.Code;
                try
                {
                    _pushData = _rpd.GetData(parameter);
                }
                catch (Exception exp)
                {
                    DisplayBallonTips(exp.Message, 2000);
                }

                if (_pushData != null && _pushData.Duration != 0)
                {
                    string DurationText = Utils.DurationToText(_pushData.Duration);
                    DisplayBallonTips(DurationText, 3000);
                }
                //else if (_pushData.Duration <= 3)
                //{
                //    //Logout
                //    DoLogout();
                //}
            }
            if (_pushData == null)
            {
                //Logout
                DoLogout();
            }
        }
Esempio n. 2
0
        private void DoLogout()
        {
            RestController <MessageData> rmd;
            MessageData md        = null;
            string      resource  = "ClientLogout";
            string      parameter = "?data=" + _sessionInformation.Code;

            rmd = new RestController <MessageData>(Settings.RestController.ServerBase, resource, Settings.RestController.ResourcePrefix);
            try
            {
                md = rmd.GetData(parameter);
            }
            catch (Exception exp)
            {
                DisplayBallonTips(exp.Message, 2000);
            }
            _sessionInformation = null;
            _pushData           = null;
            timerPush.Enabled   = false;
            _frmConfirm.Hide();
            ProcessMonitor.KillAll();
            Show();
            FullScreen();
        }
Esempio n. 3
0
        private void timerPush_Tick(object sender, EventArgs e)
        {
            _pushData = null;
            if( _rpd == null )
            {
                string resource = "TimecodePush";
                _rpd = new RestController<PushData>( Settings.RestController.ServerBase, resource, Settings.RestController.ResourcePrefix );
            }
            if( _sessionInformation != null && _rpd != null )
            {
                string parameter = "?data=" + _sessionInformation.Code;
                try
                {
                    _pushData = _rpd.GetData( parameter );

                }
                catch(Exception exp)
                {

                    DisplayBallonTips( exp.Message, 2000 );
                }

                if ( _pushData != null && _pushData.Duration != 0)
                {
                    string DurationText = Utils.DurationToText(_pushData.Duration);
                    DisplayBallonTips(DurationText, 3000);
                }
                //else if (_pushData.Duration <= 3)
                //{
                //    //Logout
                //    DoLogout();
                //}
            }
            if ( _pushData == null )
            {
                //Logout
                DoLogout();
            }
        }
Esempio n. 4
0
        private void DoLogout()
        {
            RestController<MessageData> rmd;
            MessageData md = null;
            string resource = "ClientLogout";
            string parameter = "?data="+_sessionInformation.Code;

            rmd = new RestController<MessageData>(Settings.RestController.ServerBase, resource, Settings.RestController.ResourcePrefix);
            try
            {
                md = rmd.GetData(parameter);

            }
            catch (Exception exp)
            {
                DisplayBallonTips( exp.Message ,2000);
            }
            _sessionInformation = null;
            _pushData = null;
            timerPush.Enabled = false;
            _frmConfirm.Hide();
            ProcessMonitor.KillAll();
            Show();
            FullScreen();
        }