Пример #1
0
 public void Dispose()
 {
     if (isDisposed)
     {
         return;
     }
     trackedObjects.Dispose();
     unSubscribeFromSessionEvents(Session);
     SessionEvents.Remove(this);
     isDisposed = true;
 }
Пример #2
0
        /// <summary>
        /// Gets the SessionEvents for sessionData.
        /// </summary>
        /// <param name="sessionData">The session data.</param>
        /// <returns></returns>
        public static SessionEvents GetEvents(SessionData sessionData)
        {
            SessionEvents result = null;

            if (sessionData != null)
            {
                result = tree.Where(x => x.SessionData == sessionData).FirstOrDefault();
                if (result == null)
                {
                    result = new SessionEvents
                    {
                        SessionData = sessionData,
                        StartedOn   = sessionData.StartedOn,
                        SessionId   = sessionData.SessionId
                    };
                    tree.Add(result);
                    if (sessionData.Parent != null)
                    {
                        result.Parent = GetEvents(sessionData.Parent);
                    }
                }
            }
            return(result);
        }
Пример #3
0
 /// <summary>
 /// Gets the SessionEvents for sessionData.
 /// </summary>
 /// <param name="sessionData">The session data.</param>
 /// <returns></returns>
 public static SessionEvents GetEvents(SessionData sessionData)
 {
     SessionEvents result = null;
     if (sessionData != null)
     {
         result = tree.Where(x => x.SessionData == sessionData).FirstOrDefault();
         if (result == null)
         {
             result = new SessionEvents
                          {
                              SessionData = sessionData,
                              StartedOn = sessionData.StartedOn,
                              SessionId = sessionData.SessionId
                          };
             tree.Add(result);
             if (sessionData.Parent != null)
                 result.Parent = GetEvents(sessionData.Parent);
         }
     }
     return result;
 }