/// <summary>
 /// Provides implementations an instance of <see cref="Section" /> to self populate any end user configuration options.
 /// </summary>
 /// <param name="section">The configuration section, <c>&lt;glimpse&gt;</c> from <c>web.config</c>.</param>
 /// <remarks>
 /// Populates the content type white list with values from <c>web.config</c>.
 /// A list of ratified Http status codes is available in <see href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html">Section 10 of RFC 2616</see>, the Http version 1.1 specification.
 /// </remarks>
 /// <example>
 /// Configure the content type white list in <c>web.config</c> with the following entries:
 /// <code>
 /// <![CDATA[
 /// <glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd">
 ///     <runtimePolicies>
 ///         <contentTypes>
 ///             <!-- <clear /> clear to reset defaults -->
 ///             <add contentType="{media\type}" runtimePolicy="on" />
 ///         </contentTypes>
 ///     </runtimePolicies>
 /// </glimpse>
 /// ]]>
 /// </code>
 /// </example>
 public void Configure(Section section)
 {
     foreach (ContentTypeElement item in section.RuntimePolicies.ContentTypes)
     {
         ContentTypeWhiteList.Add(new Tuple <string, RuntimePolicy>(item.ContentType, item.RuntimePolicy));
     }
 }
Exemple #2
0
 /// <summary>
 /// Provides implementations an instance of <see cref="Section" /> to self populate any end user configuration options.
 /// </summary>
 /// <param name="section">The configuration section, <c>&lt;glimpse&gt;</c> from <c>web.config</c>.</param>
 /// <remarks>
 /// Populates the content type white list with values from <c>web.config</c>.
 /// A list of ratified Http status codes is available in <see href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html">Section 10 of RFC 2616</see>, the Http version 1.1 specification.
 /// </remarks>
 /// <example>
 /// Configure the content type white list in <c>web.config</c> with the following entries:
 /// <code>
 /// <![CDATA[
 /// <glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd">
 ///     <runtimePolicies>
 ///         <contentTypes>
 ///             <!-- <clear /> clear to reset defaults -->
 ///             <add contentType="{media\type}" />
 ///         </contentTypes>
 ///     </runtimePolicies>
 /// </glimpse>
 /// ]]>
 /// </code>
 /// </example>
 public void Configure(Section section)
 {
     foreach (ContentTypeElement item in section.RuntimePolicies.ContentTypes)
     {
         ContentTypeWhiteList.Add(item.ContentType);
     }
 }