Пример #1
0
        /// <summary>
        /// Handle a notification received from the workspace state machine. By
        /// default this method calls the default handlers.
        /// </summary>
        public virtual void HandleKwsNotification(Object sender, KwsSmNotif evt)
        {
            if (DoneFlag)
            {
                return;
            }

            else if (evt is KwsSmNotifKcdConn)
            {
                KwsSmNotifKcdConn e = evt as KwsSmNotifKcdConn;
                HandleKcdConn(e.Status, e.Ex);
            }

            else if (evt is KwsSmNotifKcdLogin)
            {
                KwsSmNotifKcdLogin e = evt as KwsSmNotifKcdLogin;
                HandleKwsLogin(e.Status, e.Ex);
            }

            else if (evt is KwsSmNotifTaskSwitch)
            {
                KwsSmNotifTaskSwitch e = evt as KwsSmNotifTaskSwitch;
                HandleTaskSwitch(e.Task, e.Ex);
            }
        }
Пример #2
0
        /// <summary>
        /// Deliver notifications if delivery is allowed.
        /// </summary>
        private static void TriggerNotif()
        {
            while (m_notifLockCount == 0 && m_notifQueue.Count > 0)
            {
                // While we are firing, we need to lock notifications so that
                // we don't end up with two executions of this method.
                m_notifLockCount++;
                KwsSmNotif n   = m_notifQueue.Dequeue();
                Workspace  kws = n.Kws;

                try
                {
                    if (kws.OnKwsSmNotif != null)
                    {
                        kws.OnKwsSmNotif(kws, n);
                    }
                }

                catch (Exception ex)
                {
                    // We cannot handle failures in notifications.
                    KBase.HandleException(ex, true);
                }

                m_notifLockCount--;
            }
        }
Пример #3
0
Файл: Vnc.cs Проект: tmbx/kwm-ng
 public override void OnKwsSmNotif(Object sender, KwsSmNotif notif)
 {
     // We want to stop the local session if we go offline.
     if (LocalSession != null &&
         !IsOnlineCapable() &&
         notif is KwsSmNotifKcdLogin)
     {
         KwsSmNotifKcdLogin n = notif as KwsSmNotifKcdLogin;
         LocalSession.HandleSessionTrouble(n.Ex);
     }
 }
Пример #4
0
        /// <summary>
        /// Handle a notification received from the workspace state machine. By
        /// default this method calls the default handlers.
        /// </summary>
        public virtual void HandleKwsNotification(Object sender, KwsSmNotif evt)
        {
            if (DoneFlag) return;

            else if (evt is KwsSmNotifKcdConn)
            {
                KwsSmNotifKcdConn e = evt as KwsSmNotifKcdConn;
                HandleKcdConn(e.Status, e.Ex);
            }

            else if (evt is KwsSmNotifKcdLogin)
            {
                KwsSmNotifKcdLogin e = evt as KwsSmNotifKcdLogin;
                HandleKwsLogin(e.Status, e.Ex);
            }

            else if (evt is KwsSmNotifTaskSwitch)
            {
                KwsSmNotifTaskSwitch e = evt as KwsSmNotifTaskSwitch;
                HandleTaskSwitch(e.Task, e.Ex);
            }
        }
Пример #5
0
 /// <summary>
 /// This method is called when a workspace notification is received.
 /// </summary>
 public virtual void OnKwsSmNotif(Object sender, KwsSmNotif n)
 {
 }
Пример #6
0
 /// <summary>
 /// Queue a notification to be delivered.
 /// </summary>
 public static void QueueNotif(KwsSmNotif n)
 {
     m_notifQueue.Enqueue(n);
 }
Пример #7
0
 /// <summary>
 /// This method is called when a workspace notification is received.
 /// </summary>
 public virtual void OnKwsSmNotif(Object sender, KwsSmNotif n)
 {
 }
Пример #8
0
Файл: Vnc.cs Проект: tmbx/kwm-ng
 public override void OnKwsSmNotif(Object sender, KwsSmNotif notif)
 {
     // We want to stop the local session if we go offline.
     if (LocalSession != null &&
         !IsOnlineCapable() &&
         notif is KwsSmNotifKcdLogin)
     {
         KwsSmNotifKcdLogin n = notif as KwsSmNotifKcdLogin;
         LocalSession.HandleSessionTrouble(n.Ex);
     }
 }
Пример #9
0
 /// <summary>
 /// Queue a notification to be delivered.
 /// </summary>
 public static void QueueNotif(KwsSmNotif n)
 {
     m_notifQueue.Enqueue(n);
 }