Ejemplo n.º 1
0
		/// <summary>
		/// Internal constructor
		/// </summary>
		/// <remarks>
		/// <para>
		/// Initializes a new instance of the <see cref="ThreadContextStacks" /> class.
		/// </para>
		/// </remarks>
		internal ThreadContextStacks(ContextPropertiesBase properties)
		{
			m_properties = properties;
		}
 /// <summary>
 /// Internal constructor
 /// </summary>
 /// <remarks>
 /// <para>
 /// Initializes a new instance of the <see cref="ThreadContextStacks" /> class.
 /// </para>
 /// </remarks>
 internal ThreadContextStacks(ContextPropertiesBase properties)
 {
     m_properties = properties;
 }
        private void AddPropertiesToContext(ContextPropertiesBase properties)
        {
            if (null == HttpContext.Current)
                return;

            var request = HttpContext.Current.Request;

            properties["url"] = request.Url.AbsoluteUri;
            properties["urlReferrer"] = request.UrlReferrer;
            properties["userAgent"] = request.UserAgent;
            properties["ipAddress"] = request.GetRequestIpAddress();
            properties["isLocal"] = request.IsLocal;
            properties["queryString"] = request.QueryString;
            properties["httpMethod"] = request.HttpMethod;
            properties["machineName"] = Environment.MachineName;
        }