コード例 #1
0
 public void OnSessionKilled(SessionInfo sessionInfo)
 {
     MessageBox.Show("The current session has been killed!", sessionInfo.SessionID.ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
     Application.Exit();
 }
コード例 #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 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;
        }