public void OnSessionTimeout(SessionInfo sessionInfo) { MessageBox.Show("The current session timeout!", sessionInfo.SessionID.ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information); Application.Exit(); }
/// <summary> /// Start a new session. /// </summary> /// <param name="clientInfo">The client information regarding the current session.</param> /// <returns>The session ID in the form of Guid.</returns> public static Guid StartSession(SessionClientInfo clientInfo) { Guid sessionID = Guid.NewGuid(); ISessionCallback callback = OperationContext.Current.GetCallbackChannel<ISessionCallback>(); SessionInfo sesionInfo = new SessionInfo() { SessionID = sessionID, StartTime = DateTime.Now, LastActivityTime = DateTime.Now, ClientInfo = clientInfo }; lock (_syncHelper) { CurrentSessionList.Add(sessionID, sesionInfo); CurrentCallbackList.Add(sessionID, callback); } return sessionID; }
public void OnSessionKilled(SessionInfo sessionInfo) { MessageBox.Show("The current session has been killed!", sessionInfo.SessionID.ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information); Application.Exit(); }