Ejemplo n.º 1
0
        protected void DoSystemStateChanged(MonitorSystemState state)
        {
            try
            {
                CLocalSystem.WriteInfoLog(string.Format("MonitorSystem[{0}] SystemState={1} UserName={2}", Name, state, (state == MonitorSystemState.Login ? UserName : "")));

                if (!IsLocal && state != MonitorSystemState.Login)
                {
                    SystemContext.SystemCleanup();
                }

                if (OnSystemStateChanged != null)
                {
                    if (CLocalSystem.MainForm != null)
                    {
                        MethodInvoker form_invoker = delegate
                        {
                            OnSystemStateChanged(SystemContext, Name, state);
                        };
                        CLocalSystem.MainForm.Invoke(form_invoker);
                    }
                    else
                    {
                        OnSystemStateChanged(SystemContext, Name, state);
                    }
                }
            }
            catch (Exception e)
            {
                CLocalSystem.WriteErrorLog(string.Format("CMonitorSystem.DoSystemStateChanged Exception:{0}", e));
            }
        }
Ejemplo n.º 2
0
        public bool HeartbeatProcess(ref Message m)
        {
            if (m.Msg == HeartbeatMsgCode)
            {
                mProcMonitorHWnd = m.LParam;
                mHeartbeatTimer.Start();

                CLocalSystem.WriteDebugLog(string.Format("HeartbeatMsgCode={0} LParam={1} WParam={2}", m.Msg, m.LParam, m.WParam));

                return(true);
            }
            return(false);
        }