public void OnSessionKilled(SessionInfo sessionInfo) { MessageBox.Show("The current session has been killed!", sessionInfo.SessionID.ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information); Application.Exit(); }
public void OnSessionTimeOut(SessionInfo sessionInfo) { MessageBox.Show("The current session timeout!", sessionInfo.SessionID.ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information); Application.Exit(); }
public static Guid StartSession(SessionClientInfo clientInfo) { var sessionID = Guid.NewGuid(); ISessionCallback callBack = OperationContext.Current.GetCallbackChannel<ISessionCallback>(); SessionInfo sessionInfo = new SessionInfo(); sessionInfo.ClientInfo = clientInfo; sessionInfo.LastActivityTime = DateTime.Now; sessionInfo.SessionID = sessionID; sessionInfo.StartTime = DateTime.Now; lock (_syncHelper) { CurrentCallbackList.Add(sessionID, callBack); CurrentSessionList.Add(sessionID, sessionInfo); } return sessionID; }