Example #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);
            }
        }
Example #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--;
            }
        }
Example #3
0
File: Vnc.cs Project: 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);
     }
 }
Example #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);
            }
        }
Example #5
0
 /// <summary>
 /// This method is called when a workspace notification is received.
 /// </summary>
 public virtual void OnKwsSmNotif(Object sender, KwsSmNotif n)
 {
 }
Example #6
0
 /// <summary>
 /// Queue a notification to be delivered.
 /// </summary>
 public static void QueueNotif(KwsSmNotif n)
 {
     m_notifQueue.Enqueue(n);
 }
Example #7
0
 /// <summary>
 /// This method is called when a workspace notification is received.
 /// </summary>
 public virtual void OnKwsSmNotif(Object sender, KwsSmNotif n)
 {
 }
Example #8
0
File: Vnc.cs Project: 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);
     }
 }
Example #9
0
 /// <summary>
 /// Queue a notification to be delivered.
 /// </summary>
 public static void QueueNotif(KwsSmNotif n)
 {
     m_notifQueue.Enqueue(n);
 }