/// <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); } }
/// <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--; } }
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); } }
/// <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); } }
/// <summary> /// This method is called when a workspace notification is received. /// </summary> public virtual void OnKwsSmNotif(Object sender, KwsSmNotif n) { }
/// <summary> /// Queue a notification to be delivered. /// </summary> public static void QueueNotif(KwsSmNotif n) { m_notifQueue.Enqueue(n); }