Esempio n. 1
0
 public IProfileRequest BeginRequest(String address, String session)
 {
     if (!Enabled)
     {
         return(null);
     }
     if (address.ToLowerInvariant().EndsWith("/shell/trace"))
     {
         return(null);
     }
     _request = new ProfileRequest(address);
     AddRequestToSession(_request);
     return(_request);
 }
Esempio n. 2
0
        void AddRequestToSession(ProfileRequest action)
        {
            var currentContext = HttpContext.Current;

            if (currentContext == null)
            {
                return;
            }
            if (!(currentContext.Session[_sessionKey] is LinkedList <ProfileRequest> sessionArray))
            {
                sessionArray = new LinkedList <ProfileRequest>();
                currentContext.Session.Add(_sessionKey, sessionArray);
            }
            sessionArray.AddFirst(action);
            while (sessionArray.Count > _requestCount)
            {
                sessionArray.RemoveLast();
            }
        }