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