﻿<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
  <channel>
    <title>Sb2 Developers Blog</title>
    <description>try { } catch { } finally { }</description>
    <link>http://blog.sb2.fr/</link>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>BlogEngine.NET 1.4.5.0</generator>
    <language>en-US</language>
    <blogChannel:blogRoll>http://blog.sb2.fr/opml.axd</blogChannel:blogRoll>
    <blogChannel:blink>http://feeds.feedburner.com/sb2/JSrW</blogChannel:blink>
    <dc:creator>SB2</dc:creator>
    <dc:title>Sb2 Developers Blog</dc:title>
    <item>
      <title>Microsoft Office Excel instance does not close.</title>
      <description>&lt;p&gt;Hi, &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p align="justify"&gt;I found an issue, when an user quit an Excel instance created with Microsoft Office Interop library. The process does not exit properly, and i can't manange this issue with the calling application. &lt;/p&gt;  &lt;p align="justify"&gt;To set the context : The main application is an Addin for Office (Excel, Word and PowerPoint) and one action launches a new instance of Excel where the user can see and do some actions. And that's with this new instance that we encountered the issue. &lt;/p&gt;  &lt;p align="justify"&gt;Moreover the Microsoft.Office.Interop.Excel.Application does not have event handlers to manage &amp;quot;Quit&amp;quot; or &amp;quot;Close&amp;quot; events of the application, so i had to found another way to kill my process =) &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;So here is the code used to create a new Excel instance : &lt;/p&gt;  &lt;div id="codeSnippetWrapper" style="border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4; text-align: left"&gt;   &lt;div id="codeSnippet" style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum1" style="color: #606060"&gt;   1:&lt;/span&gt; Microsoft.Office.Interop.Excel.Application xlApp = &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum2" style="color: #606060"&gt;   2:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum3" style="color: #606060"&gt;   3:&lt;/span&gt; &lt;span style="color: #008000"&gt;// Launch New Excel instance&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum4" style="color: #606060"&gt;   4:&lt;/span&gt; xlApp = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Microsoft.Office.Interop.Excel.Application();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum5" style="color: #606060"&gt;   5:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum6" style="color: #606060"&gt;   6:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (xlApp == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum7" style="color: #606060"&gt;   7:&lt;/span&gt;    &lt;span style="color: #0000ff"&gt;throw&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Exception(&lt;span style="color: #006080"&gt;&amp;quot;EXCEL could not be started. Check that your office installation and project references are correct.&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum8" style="color: #606060"&gt;   8:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum9" style="color: #606060"&gt;   9:&lt;/span&gt; xlApp.Visible = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum10" style="color: #606060"&gt;  10:&lt;/span&gt; xlApp.UserControl = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum11" style="color: #606060"&gt;  11:&lt;/span&gt; System.Threading.Thread.CurrentThread.CurrentCulture =&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum12" style="color: #606060"&gt;  12:&lt;/span&gt; System.Globalization.CultureInfo.CreateSpecificCulture(&lt;span style="color: #006080"&gt;&amp;quot;en-US&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum13" style="color: #606060"&gt;  13:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum14" style="color: #606060"&gt;  14:&lt;/span&gt; &lt;span style="color: #008000"&gt;// Open the file&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum15" style="color: #606060"&gt;  15:&lt;/span&gt; Workbook wb = xlApp.Workbooks.Open(filepath, Type.Missing,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum16" style="color: #606060"&gt;  16:&lt;/span&gt;                                 Type.Missing, Type.Missing, Type.Missing,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum17" style="color: #606060"&gt;  17:&lt;/span&gt;                                 Type.Missing, Type.Missing, Type.Missing,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum18" style="color: #606060"&gt;  18:&lt;/span&gt;                                 Type.Missing, Type.Missing, Type.Missing,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum19" style="color: #606060"&gt;  19:&lt;/span&gt;                                 Type.Missing, Type.Missing, Type.Missing,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum20" style="color: #606060"&gt;  20:&lt;/span&gt;                                 Type.Missing);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum21" style="color: #606060"&gt;  21:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum22" style="color: #606060"&gt;  22:&lt;/span&gt; Worksheet ws = (Worksheet)wb.Worksheets[1];&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum23" style="color: #606060"&gt;  23:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum24" style="color: #606060"&gt;  24:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (ws == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum25" style="color: #606060"&gt;  25:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;throw&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Exception(&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum26" style="color: #606060"&gt;  26:&lt;/span&gt;         &lt;span style="color: #006080"&gt;&amp;quot;Worksheet could not be created. Check that your office installation and project references are correct.&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;And here the class used to manage the&amp;#160; quit process :&lt;/p&gt;

&lt;div id="codeSnippetWrapper" style="border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4; text-align: left"&gt;
  &lt;div id="codeSnippet" style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum1" style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; SubclassHWND : NativeWindow&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum2" style="color: #606060"&gt;   2:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum3" style="color: #606060"&gt;   3:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; WndProc(&lt;span style="color: #0000ff"&gt;ref&lt;/span&gt; Message m)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum4" style="color: #606060"&gt;   4:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum5" style="color: #606060"&gt;   5:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (m.Msg == 0x10)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum6" style="color: #606060"&gt;   6:&lt;/span&gt;             {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum7" style="color: #606060"&gt;   7:&lt;/span&gt;                 Process.GetCurrentProcess().Kill();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum8" style="color: #606060"&gt;   8:&lt;/span&gt;                 &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum9" style="color: #606060"&gt;   9:&lt;/span&gt;                 &lt;span style="color: #008000"&gt;// Confirmation message if needed&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum10" style="color: #606060"&gt;  10:&lt;/span&gt;                 &lt;span style="color: #008000"&gt;//if (MessageBox.Show(&amp;quot;Would you like to quit?&amp;quot;, &amp;quot;Close?&amp;quot;, MessageBoxButtons.YesNo) == DialogResult.Yes)&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum11" style="color: #606060"&gt;  11:&lt;/span&gt;                 &lt;span style="color: #008000"&gt;//    Process.GetCurrentProcess().Kill();&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum12" style="color: #606060"&gt;  12:&lt;/span&gt;                 &lt;span style="color: #008000"&gt;//else&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum13" style="color: #606060"&gt;  13:&lt;/span&gt;                 &lt;span style="color: #008000"&gt;//    return;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum14" style="color: #606060"&gt;  14:&lt;/span&gt;             }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum15" style="color: #606060"&gt;  15:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;base&lt;/span&gt;.WndProc(&lt;span style="color: #0000ff"&gt;ref&lt;/span&gt; m);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum16" style="color: #606060"&gt;  16:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum17" style="color: #606060"&gt;  17:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;And the code to attach the application handler :&lt;/p&gt;

&lt;div id="codeSnippetWrapper" style="border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; height: 94px; background-color: #f4f4f4; text-align: left"&gt;
  &lt;div id="codeSnippet" style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum1" style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (OfficeApplicationManager.OfficeApplication != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum2" style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum3" style="color: #606060"&gt;   3:&lt;/span&gt;     s = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; SubclassHWND();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum4" style="color: #606060"&gt;   4:&lt;/span&gt;     s.AssignHandle(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; IntPtr(OfficeApplicationManager.OfficeApplication.GetApplicationHwnd()));&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum5" style="color: #606060"&gt;   5:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;The OfficeAppliaction is the same as Microsoft.Office.Interop.Excel.Application&lt;/p&gt;</description>
      <link>http://blog.sb2.fr/post/2010/04/30/Microsoft-Office-Excel-instance-does-not-close.aspx</link>
      <author>yb.nospam@nospam.sb2.fr (razak)</author>
      <comments>http://blog.sb2.fr/post/2010/04/30/Microsoft-Office-Excel-instance-does-not-close.aspx#comment</comments>
      <guid>http://blog.sb2.fr/post.aspx?id=8df7fb1d-f077-4842-bcec-e122ec961199</guid>
      <pubDate>Fri, 30 Apr 2010 13:36:16 +0200</pubDate>
      <category>C#</category>
      <category>Windows</category>
      <category>Office</category>
      <category>Excel</category>
      <category>Interop</category>
      <category>Event</category>
      <dc:publisher>razak</dc:publisher>
      <pingback:server>http://blog.sb2.fr/pingback.axd</pingback:server>
      <pingback:target>http://blog.sb2.fr/post.aspx?id=8df7fb1d-f077-4842-bcec-e122ec961199</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://blog.sb2.fr/trackback.axd?id=8df7fb1d-f077-4842-bcec-e122ec961199</trackback:ping>
      <wfw:comment>http://blog.sb2.fr/post/2010/04/30/Microsoft-Office-Excel-instance-does-not-close.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.sb2.fr/syndication.axd?post=8df7fb1d-f077-4842-bcec-e122ec961199</wfw:commentRss>
    </item>
    <item>
      <title>FluentNHibernarte.Search 0.3 Beta Released Now Support Fluent XML-Less Configuration</title>
      <description>&lt;p&gt;Just released &lt;strong&gt;FluentNHibernate.Search 0.3 Beta&lt;/strong&gt; which now support &lt;strong&gt;Fluent XML-Less Configuration&lt;/strong&gt; available on &lt;a href="http://fnhsearch.codeplex.com/releases/view/41631"&gt;CodePlex&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;No need to configure &lt;strong&gt;NHibernate.Search&lt;/strong&gt; in web.config or app.config, you can know configure it like &lt;strong&gt;FluentNHibernate&lt;/strong&gt; do for &lt;strong&gt;NHibernate&lt;/strong&gt;.&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; Configuration nhcfg = FluentSearch.Configure()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;     .DefaultAnalyzer().Standard()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     .DirectoryProvider().FSDirectory()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     .IndexBase(&lt;span style="color: #006080"&gt;&amp;quot;~/Index&amp;quot;&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     .IndexingStrategy().Event()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     .MappingClass&amp;lt;SearchMappingImpl&amp;gt;()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;     .BuildConfiguration();&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;FHNS support both builtin Analyzers and Directory Providers :&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Builtin Analyzers :&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;StandardAnalyzer &lt;/li&gt;

  &lt;li&gt;KeywordAnalyzer &lt;/li&gt;

  &lt;li&gt;SimpleAnalyzer &lt;/li&gt;

  &lt;li&gt;StopAnalyzer &lt;/li&gt;

  &lt;li&gt;WhitespaceAnalyzer &lt;/li&gt;
&lt;/ul&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #008000"&gt;// Some Builtin Analyzers&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; FluentSearch.Configure().DefaultAnalyzer().Standard()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; FluentSearch.Configure().DefaultAnalyzer().Simple()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt; FluentSearch.Configure().DefaultAnalyzer().Whitespace()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt; ...&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt; &lt;span style="color: #008000"&gt;// Custom Analyzers&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt; FluentSearch.Configure().DefaultAnalyzer().Custom&amp;lt;MyAnalyzer&amp;gt;()&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Builtin Directory Providers :&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;FSDirectoryProvider &lt;/li&gt;

  &lt;li&gt;RAMDirectoryProvider &lt;/li&gt;
&lt;/ul&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #008000"&gt;// Builtin Directory Providers&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; FluentSearch.Configure().DirectoryProvider().FSDirectory()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; FluentSearch.Configure().DirectoryProvider().RAMDirectory()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt; ...&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt; &lt;span style="color: #008000"&gt;// Custom Directory Providers&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt; FluentSearch.Configure().DirectoryProvider().Custom&amp;lt;MyDirectoryProvider&amp;gt;()&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Working with FluentNHibernate for NHibernate Configuration ? &lt;/p&gt;

&lt;p&gt;You can get FluentNHibernate.Search and FluentNHibernate in touch like this :&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #008000"&gt;// FluentNHibernate.Search Configuration&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; var nhcfg = FluentSearch.Configure()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     .DefaultAnalyzer().Standard()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     .DirectoryProvider().FSDirectory()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     .IndexBase(&lt;span style="color: #006080"&gt;&amp;quot;~/Index&amp;quot;&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     .IndexingStrategy().Event()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;     .MappingClass&amp;lt;SearchMappingImpl&amp;gt;()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;     .BuildConfiguration();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt; &lt;span style="color: #008000"&gt;// FluentNHibernate Configuration&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt; var fcfg = Fluently.Configure(nhcfg);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt; var sessionFactory = fcfg.Database(MsSqlConfiguration.MsSql2008.ConnectionString(_settings.ConnectionString)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;                            .Cache(p =&amp;gt; p.UseQueryCache().ProviderClass&amp;lt;SysCacheProvider&amp;gt;())&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;                            .Dialect&amp;lt;MsSql2008Dialect&amp;gt;().UseReflectionOptimizer()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;                            .AdoNetBatchSize(50)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt;                            .ProxyFactoryFactory&amp;lt;ProxyFactoryFactory&amp;gt;())&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt;                            .BuildSessionFactory();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum19"&gt;  19:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Beta 0.3 is available on CodePlex : &lt;a href="http://fnhsearch.codeplex.com/"&gt;http://fnhsearch.codeplex.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Have fun :)&lt;/p&gt;</description>
      <link>http://blog.sb2.fr/post/2010/03/08/FluentNHibernarteSearch-03-Beta-Released-Now-Support-Fluent-XML-Less-Configuration.aspx</link>
      <author>yb.nospam@nospam.sb2.fr (xtc)</author>
      <comments>http://blog.sb2.fr/post/2010/03/08/FluentNHibernarteSearch-03-Beta-Released-Now-Support-Fluent-XML-Less-Configuration.aspx#comment</comments>
      <guid>http://blog.sb2.fr/post.aspx?id=38dcba2d-b788-44de-8c04-56f0666cd435</guid>
      <pubDate>Mon, 08 Mar 2010 23:58:15 +0200</pubDate>
      <category>C#</category>
      <category>FluentNHibernate.Search</category>
      <category>Lucene.NET</category>
      <category>NHibernate</category>
      <dc:publisher>xtc</dc:publisher>
      <pingback:server>http://blog.sb2.fr/pingback.axd</pingback:server>
      <pingback:target>http://blog.sb2.fr/post.aspx?id=38dcba2d-b788-44de-8c04-56f0666cd435</pingback:target>
      <slash:comments>32</slash:comments>
      <trackback:ping>http://blog.sb2.fr/trackback.axd?id=38dcba2d-b788-44de-8c04-56f0666cd435</trackback:ping>
      <wfw:comment>http://blog.sb2.fr/post/2010/03/08/FluentNHibernarteSearch-03-Beta-Released-Now-Support-Fluent-XML-Less-Configuration.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.sb2.fr/syndication.axd?post=38dcba2d-b788-44de-8c04-56f0666cd435</wfw:commentRss>
    </item>
    <item>
      <title>FluentNHibernarte.Search 0.2 Beta Released</title>
      <description>&lt;p&gt;&lt;a href="http://blog.sb2.fr/image.axd?picture=WindowsLiveWriter/FluentNHibernarte.Search0.2BetaReleased/3137515D/fluentnhs.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="fluentnhs" border="0" alt="fluentnhs" src="http://blog.sb2.fr/image.axd?picture=WindowsLiveWriter/FluentNHibernarte.Search0.2BetaReleased/10B011AB/fluentnhs_thumb.jpg" width="240" height="54" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;I’ve just released FluentNHibernate.Search 0.2 Beta which is available on &lt;a href="http://fnhsearch.codeplex.com/releases/view/41482"&gt;CodePlex&lt;/a&gt; and support the following new features.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://fnhsearch.codeplex.com/WorkItem/View.aspx?WorkItemId=7275"&gt;&lt;strong&gt;Field Mapping without specifying &amp;quot;Name&amp;quot;&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Actually we needed to specify Field name using .Field(“FieldName”) :&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; BookSearchMap : DocumentMap&amp;lt;Book&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; BookSearchMap()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;         Id(p =&amp;gt; p.BookId).Field(&lt;span style="color: #006080"&gt;&amp;quot;BookId&amp;quot;&lt;/span&gt;).Bridge().Guid();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Now if we don’t specify this, the field name will be automaticaly taken from the mapped property name.&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; BookSearchMap : DocumentMap&amp;lt;Book&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; BookSearchMap()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;         Id(p =&amp;gt; p.BookId).Bridge().Guid();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;a href="http://fnhsearch.codeplex.com/WorkItem/View.aspx?WorkItemId=7270"&gt;&lt;strong&gt;Id Mapping without specifiying &amp;quot;Field&amp;quot;&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Actually to we needed to specify Field name using .Name(“FieldName”) for Field mapping, now we can forget this, it will be taken directly from the mapping property name.&lt;/p&gt;

&lt;p&gt;However we can overrides that name using .Name(“FieldName”) method.&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; BookSearchMap : DocumentMap&amp;lt;Book&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; BookSearchMap()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;         Id(p =&amp;gt; p.BookId).Bridge().Guid();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;         Name(&lt;span style="color: #006080"&gt;&amp;quot;Book&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;         Map(x =&amp;gt; x.Title)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;             .Store().Yes()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;             .Index().Tokenized();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;         Map(x =&amp;gt; x.Description)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;             .Store().Yes()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;             .Index().Tokenized();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Embedded Mapping&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;FluentNHibernate.Search now support embedded mapping using the &lt;strong&gt;Embedded&lt;/strong&gt; method in &lt;strong&gt;DocumentMap&lt;/strong&gt;.&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; AuthorSearchMap : DocumentMap&amp;lt;Author&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; AuthorSearchMap()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;         Id(p =&amp;gt; p.AuthorId)Bridge().Guid();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;         Name(&lt;span style="color: #006080"&gt;&amp;quot;Author&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;         Map(x =&amp;gt; x.Name)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;             .Store().Yes()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;             .Index().Tokenized();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;         Embedded(x =&amp;gt; x.Books).AsCollection();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;</description>
      <link>http://blog.sb2.fr/post/2010/03/07/FluentNHibernarteSearch-02-Beta-Released.aspx</link>
      <author>yb.nospam@nospam.sb2.fr (xtc)</author>
      <comments>http://blog.sb2.fr/post/2010/03/07/FluentNHibernarteSearch-02-Beta-Released.aspx#comment</comments>
      <guid>http://blog.sb2.fr/post.aspx?id=bc466647-7ca8-4eed-aefe-324d64e73257</guid>
      <pubDate>Sun, 07 Mar 2010 12:29:29 +0200</pubDate>
      <category>Lucene.NET</category>
      <category>NHibernate</category>
      <category>C#</category>
      <category>FluentNHibernate.Search</category>
      <dc:publisher>xtc</dc:publisher>
      <pingback:server>http://blog.sb2.fr/pingback.axd</pingback:server>
      <pingback:target>http://blog.sb2.fr/post.aspx?id=bc466647-7ca8-4eed-aefe-324d64e73257</pingback:target>
      <slash:comments>36</slash:comments>
      <trackback:ping>http://blog.sb2.fr/trackback.axd?id=bc466647-7ca8-4eed-aefe-324d64e73257</trackback:ping>
      <wfw:comment>http://blog.sb2.fr/post/2010/03/07/FluentNHibernarteSearch-02-Beta-Released.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.sb2.fr/syndication.axd?post=bc466647-7ca8-4eed-aefe-324d64e73257</wfw:commentRss>
    </item>
    <item>
      <title>Introducing FluentNhibernate.Search Mapping Interface</title>
      <description>&lt;p&gt;Coming back for a long time…&lt;/p&gt;  &lt;p&gt;I announce today a new project i’ve hosted on &lt;a href="http://fnhsearch.codeplex.com/"&gt;CodePlex&lt;/a&gt; about &lt;strong&gt;NHibernate.Search&lt;/strong&gt;, a &lt;strong&gt;Lucene.NET&lt;/strong&gt; provider&amp;#160; implementation for &lt;strong&gt;NHibernate&lt;/strong&gt; which is a part of the NHibernate Contrib project.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blog.sb2.fr/image.axd?picture=WindowsLiveWriter/IntroducingFluent.SearchMappingInterface/0F3FDD0B/fluentnhs.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="fluentnhs" border="0" alt="fluentnhs" src="http://blog.sb2.fr/image.axd?picture=WindowsLiveWriter/IntroducingFluent.SearchMappingInterface/1CA5F011/fluentnhs_thumb.jpg" width="240" height="54" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Actually &lt;strong&gt;NHibernate.Search&lt;/strong&gt; is attributes based mapping. &lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; [Indexed]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Book&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     [DocumentId]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; Guid BookId { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;     [Field(Index=Index.Tokenized, Name=&lt;span style="color: #006080"&gt;&amp;quot;Title&amp;quot;&lt;/span&gt;, Store=Store.Yes)]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Title { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;     [Field(Index = Index.Tokenized, Name = &lt;span style="color: #006080"&gt;&amp;quot;Description&amp;quot;&lt;/span&gt;, Store = Store.Yes)]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Description { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;In my recent projects I needed to keep my domain entites true &lt;strong&gt;POCO and persistant ignorant&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Since there was no Fluent inteface to map Lucene.NET documents without attributes outside domain entities, I decided to start this project which I hope should make us feel better :)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;FluentNHibernate.Search&lt;/strong&gt; mapping is quite equivalent to &lt;a href="http://fluentnhibernate.org/"&gt;FluentNHibernate&lt;/a&gt; for NHibernate XML-Less entity mapping initialy developped by &lt;a href="http://codebetter.com/blogs/jeremy.miller/"&gt;Jeremy Miller&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Mapping Lucene.NET documents are now very simple, attribute-less, here is a sample :&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Book&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; Guid BookId { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Title { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Description { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Woow, that’s clean :)&lt;/p&gt;

&lt;p&gt;And here is the mapping class :&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; BookSearchMap : DocumentMap&amp;lt;Book&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; BookSearchMap()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;         Id(p =&amp;gt; p.BookId).Field(&lt;span style="color: #006080"&gt;&amp;quot;BookId&amp;quot;&lt;/span&gt;).Bridge().Guid();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;         Name(&lt;span style="color: #006080"&gt;&amp;quot;Book&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;         Boost(500);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;         Analyzer&amp;lt;StandardAnalyzer&amp;gt;();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;         Map(x =&amp;gt; x.Title)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;             .Analyzer&amp;lt;StandardAnalyzer&amp;gt;()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;             .Boost(500);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;         Map(x =&amp;gt; x.Description)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;             .Boost(500)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;             .Name(&lt;span style="color: #006080"&gt;&amp;quot;Description&amp;quot;&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt;             .Store().Yes()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt;             .Index().Tokenized();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum19"&gt;  19:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum20"&gt;  20:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Pretty nice isn’t it ? :)&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;FluentNHibernate.Search&lt;/strong&gt; is &lt;em&gt;still&lt;/em&gt; in developpement but I hope I will release a stable version soon.&lt;/p&gt;

&lt;p&gt;Until a stable version be released you can check the current source code at &lt;a href="http://fnhsearch.codeplex.com/"&gt;CodePlex&lt;/a&gt; and give feedbacks !&lt;/p&gt;</description>
      <link>http://blog.sb2.fr/post/2010/03/05/Introducing-FluentNhibernateSearch-Mapping-Interface.aspx</link>
      <author>yb.nospam@nospam.sb2.fr (xtc)</author>
      <comments>http://blog.sb2.fr/post/2010/03/05/Introducing-FluentNhibernateSearch-Mapping-Interface.aspx#comment</comments>
      <guid>http://blog.sb2.fr/post.aspx?id=31326af0-fb4f-4f94-922f-0076f36ea47c</guid>
      <pubDate>Fri, 05 Mar 2010 23:46:39 +0200</pubDate>
      <category>C#</category>
      <category>NHibernate</category>
      <category>Lucene.NET</category>
      <dc:publisher>xtc</dc:publisher>
      <pingback:server>http://blog.sb2.fr/pingback.axd</pingback:server>
      <pingback:target>http://blog.sb2.fr/post.aspx?id=31326af0-fb4f-4f94-922f-0076f36ea47c</pingback:target>
      <slash:comments>33</slash:comments>
      <trackback:ping>http://blog.sb2.fr/trackback.axd?id=31326af0-fb4f-4f94-922f-0076f36ea47c</trackback:ping>
      <wfw:comment>http://blog.sb2.fr/post/2010/03/05/Introducing-FluentNhibernateSearch-Mapping-Interface.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.sb2.fr/syndication.axd?post=31326af0-fb4f-4f94-922f-0076f36ea47c</wfw:commentRss>
    </item>
    <item>
      <title>Windows 7 RTM Now Available in Both x64 and x86 for MSDN Subscribers</title>
      <description>&lt;p&gt;&lt;a href="http://blog.sb2.fr/image.axd?picture=WindowsLiveWriter/Windows7RTMNowAvailableinBothx64andx86fo/01AE777C/aa336858.win7banner_msdn_ENenusMSDN.10.gif"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="aa336858.win7banner_msdn_EN(en-us,MSDN.10)" border="0" alt="aa336858.win7banner_msdn_EN(en-us,MSDN.10)" src="http://blog.sb2.fr/image.axd?picture=WindowsLiveWriter/Windows7RTMNowAvailableinBothx64andx86fo/410C2B0C/aa336858.win7banner_msdn_ENenusMSDN.10_thumb.gif" width="728" height="90" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Hi !&lt;/p&gt;  &lt;p&gt;All editions of Windows 7 RTM are now available in both x64 and x68 for MSDN subscribers!&lt;/p&gt;  &lt;p&gt;Currently only available in English but an MUI with other languages is also available.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/subscriptions/bb608344.aspx"&gt;http://msdn.microsoft.com/en-us/subscriptions/bb608344.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blog.sb2.fr/image.axd?picture=WindowsLiveWriter/Windows7RTMNowAvailableinBothx64andx86fo/0C468362/image.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blog.sb2.fr/image.axd?picture=WindowsLiveWriter/Windows7RTMNowAvailableinBothx64andx86fo/17FBCA94/image_thumb.png" width="644" height="241" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Have a good day ! :)&lt;/p&gt;</description>
      <link>http://blog.sb2.fr/post/2009/08/06/Windows-7-RTM-Now-Available-in-Both-x64-and-x86-for-MSDN-Subscribers.aspx</link>
      <author>yb.nospam@nospam.sb2.fr (xTC)</author>
      <comments>http://blog.sb2.fr/post/2009/08/06/Windows-7-RTM-Now-Available-in-Both-x64-and-x86-for-MSDN-Subscribers.aspx#comment</comments>
      <guid>http://blog.sb2.fr/post.aspx?id=d6149469-5621-427b-9e92-0b2576d1523d</guid>
      <pubDate>Thu, 06 Aug 2009 22:39:23 +0200</pubDate>
      <category>Windows</category>
      <dc:publisher>xTC</dc:publisher>
      <pingback:server>http://blog.sb2.fr/pingback.axd</pingback:server>
      <pingback:target>http://blog.sb2.fr/post.aspx?id=d6149469-5621-427b-9e92-0b2576d1523d</pingback:target>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://blog.sb2.fr/trackback.axd?id=d6149469-5621-427b-9e92-0b2576d1523d</trackback:ping>
      <wfw:comment>http://blog.sb2.fr/post/2009/08/06/Windows-7-RTM-Now-Available-in-Both-x64-and-x86-for-MSDN-Subscribers.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.sb2.fr/syndication.axd?post=d6149469-5621-427b-9e92-0b2576d1523d</wfw:commentRss>
    </item>
    <item>
      <title>Trick for Firefox who doesn't read all the bytes sent with ASP.Net HttpHandler in C#.</title>
      <description>&lt;p&gt;We found an issue where Firefox wasn't getting the entire file bytes sent by our ASP Server (in our case, the last byte of the stream was not read so the file were corrupt) but this bug never happens in Internet Explorer. &lt;/p&gt;  &lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;  &lt;p&gt;Here is the problematic code :&lt;/p&gt;  &lt;div id="codeSnippetWrapper" style="border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; height: 176px; background-color: #f4f4f4; text-align: left"&gt;   &lt;div id="codeSnippet" style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum1" style="color: #606060"&gt;   1:&lt;/span&gt; Response.Clear();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum2" style="color: #606060"&gt;   2:&lt;/span&gt; Response.ContentType = file.Mime;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum3" style="color: #606060"&gt;   3:&lt;/span&gt; Response.Cache.SetCacheability(HttpCacheability.Private);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum4" style="color: #606060"&gt;   4:&lt;/span&gt; Response.Expires = -1;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum5" style="color: #606060"&gt;   5:&lt;/span&gt; Response.Buffer = &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum6" style="color: #606060"&gt;   6:&lt;/span&gt; Response.AddHeader(&lt;span style="color: #006080"&gt;&amp;quot;Content-Disposition&amp;quot;&lt;/span&gt;, String.Format(&lt;span style="color: #006080"&gt;&amp;quot;{0};FileName=\&amp;quot;{1}\&amp;quot;&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;attachment&amp;quot;&lt;/span&gt;, file.Name));&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum7" style="color: #606060"&gt;   7:&lt;/span&gt; Response.OutputStream.Write(file.Contents, 0, file.Contents.Length);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum8" style="color: #606060"&gt;   8:&lt;/span&gt; Response.End(); &lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;We found 2 solutions :&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;First, just change the &lt;strong&gt;Response.Buffer = False&lt;/strong&gt; to &lt;strong&gt;Response.Buffer = true&lt;/strong&gt;, this will have for effect that the response will not be sent until all the scripts are processed or the call of Response.End(), Response.Flush() call.&lt;/p&gt;

&lt;div id="codeSnippetWrapper" style="border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; height: 173px; background-color: #f4f4f4; text-align: left"&gt;
  &lt;div id="codeSnippet" style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum1" style="color: #606060"&gt;   1:&lt;/span&gt; Response.Clear();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum2" style="color: #606060"&gt;   2:&lt;/span&gt; Response.ContentType = file.Mime;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum3" style="color: #606060"&gt;   3:&lt;/span&gt; Response.Cache.SetCacheability(HttpCacheability.Private);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum4" style="color: #606060"&gt;   4:&lt;/span&gt; Response.Expires = -1;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum5" style="color: #606060"&gt;   5:&lt;/span&gt; Response.Buffer = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum6" style="color: #606060"&gt;   6:&lt;/span&gt; Response.AddHeader(&lt;span style="color: #006080"&gt;&amp;quot;Content-Disposition&amp;quot;&lt;/span&gt;, String.Format(&lt;span style="color: #006080"&gt;&amp;quot;{0};FileName=\&amp;quot;{1}\&amp;quot;&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;attachment&amp;quot;&lt;/span&gt;, file.Name));&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum7" style="color: #606060"&gt;   7:&lt;/span&gt; Response.OutputStream.Write(file.Contents, 0, file.Contents.Length);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum8" style="color: #606060"&gt;   8:&lt;/span&gt; Response.End();&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Or do not set the Response.Buffer, and use Response.BinaryWrite() (&lt;a title="http://msdn.microsoft.com/en-us/library/ms524318.aspx" href="http://msdn.microsoft.com/en-us/library/ms524318.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms524318.aspx&lt;/a&gt;) instead of Response.OutputStream() :&lt;/p&gt;

&lt;div id="codeSnippetWrapper" style="border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; height: 158px; background-color: #f4f4f4; text-align: left"&gt;
  &lt;div id="codeSnippet" style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum1" style="color: #606060"&gt;   1:&lt;/span&gt; Response.Clear();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum2" style="color: #606060"&gt;   2:&lt;/span&gt; Response.ContentType = file.Mime;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum3" style="color: #606060"&gt;   3:&lt;/span&gt; Response.Cache.SetCacheability(HttpCacheability.Private);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum4" style="color: #606060"&gt;   4:&lt;/span&gt; Response.Expires = -1;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum5" style="color: #606060"&gt;   5:&lt;/span&gt; Response.AddHeader(&lt;span style="color: #006080"&gt;&amp;quot;Content-Disposition&amp;quot;&lt;/span&gt;, String.Format(&lt;span style="color: #006080"&gt;&amp;quot;{0};FileName=\&amp;quot;{1}\&amp;quot;&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;attachment&amp;quot;&lt;/span&gt;, file.Name));&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum6" style="color: #606060"&gt;   6:&lt;/span&gt; Response.BinaryWrite(file.Contents);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum7" style="color: #606060"&gt;   7:&lt;/span&gt; Response.End();&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;</description>
      <link>http://blog.sb2.fr/post/2009/05/25/Trick-for-Firefox-who-doesnt-read-all-the-bytes-sent-with-ASPNet-HttpHandler-in-C.aspx</link>
      <author>yb.nospam@nospam.sb2.fr (Razak)</author>
      <comments>http://blog.sb2.fr/post/2009/05/25/Trick-for-Firefox-who-doesnt-read-all-the-bytes-sent-with-ASPNet-HttpHandler-in-C.aspx#comment</comments>
      <guid>http://blog.sb2.fr/post.aspx?id=070a0433-9aef-42d9-8416-4a3465031281</guid>
      <pubDate>Mon, 25 May 2009 17:06:23 +0200</pubDate>
      <category>ASP.NET</category>
      <category>C#</category>
      <dc:publisher>Razak</dc:publisher>
      <pingback:server>http://blog.sb2.fr/pingback.axd</pingback:server>
      <pingback:target>http://blog.sb2.fr/post.aspx?id=070a0433-9aef-42d9-8416-4a3465031281</pingback:target>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://blog.sb2.fr/trackback.axd?id=070a0433-9aef-42d9-8416-4a3465031281</trackback:ping>
      <wfw:comment>http://blog.sb2.fr/post/2009/05/25/Trick-for-Firefox-who-doesnt-read-all-the-bytes-sent-with-ASPNet-HttpHandler-in-C.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.sb2.fr/syndication.axd?post=070a0433-9aef-42d9-8416-4a3465031281</wfw:commentRss>
    </item>
    <item>
      <title>How to Change System Date Programmatically With C#</title>
      <description>&lt;p&gt;Hi,&lt;/p&gt;  &lt;p&gt;After a long time without posting, I come back with a useful class in order to change, get or set Local System DateTime.&lt;/p&gt;  &lt;p&gt;Here is the code :&lt;/p&gt;  &lt;div id="codeSnippetWrapper" style="border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4; text-align: left"&gt;   &lt;div id="codeSnippet" style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum1" style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; LocalDateTime&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum2" style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum3" style="color: #606060"&gt;   3:&lt;/span&gt;     [StructLayout(LayoutKind.Sequential)]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum4" style="color: #606060"&gt;   4:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;struct&lt;/span&gt; SYSTEMTIME&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum5" style="color: #606060"&gt;   5:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum6" style="color: #606060"&gt;   6:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;short&lt;/span&gt; wYear;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum7" style="color: #606060"&gt;   7:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;short&lt;/span&gt; wMonth;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum8" style="color: #606060"&gt;   8:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;short&lt;/span&gt; wDayOfWeek;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum9" style="color: #606060"&gt;   9:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;short&lt;/span&gt; wDay;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum10" style="color: #606060"&gt;  10:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;short&lt;/span&gt; wHour;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum11" style="color: #606060"&gt;  11:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;short&lt;/span&gt; wMinute;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum12" style="color: #606060"&gt;  12:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;short&lt;/span&gt; wSecond;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum13" style="color: #606060"&gt;  13:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;short&lt;/span&gt; wMilliseconds;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum14" style="color: #606060"&gt;  14:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum15" style="color: #606060"&gt;  15:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum16" style="color: #606060"&gt;  16:&lt;/span&gt;     [DllImport(&lt;span style="color: #006080"&gt;&amp;quot;kernel32.dll&amp;quot;&lt;/span&gt;, EntryPoint = &lt;span style="color: #006080"&gt;&amp;quot;SetSystemTime&amp;quot;&lt;/span&gt;, SetLastError = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;)]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum17" style="color: #606060"&gt;  17:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;extern&lt;/span&gt; &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; SetSystemTime(&lt;span style="color: #0000ff"&gt;ref&lt;/span&gt; SYSTEMTIME st);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum18" style="color: #606060"&gt;  18:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum19" style="color: #606060"&gt;  19:&lt;/span&gt;     [DllImport(&lt;span style="color: #006080"&gt;&amp;quot;kernel32.dll&amp;quot;&lt;/span&gt;, EntryPoint = &lt;span style="color: #006080"&gt;&amp;quot;GetSystemTime&amp;quot;&lt;/span&gt;, SetLastError = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;)]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum20" style="color: #606060"&gt;  20:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;extern&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; GetSystemTime(&lt;span style="color: #0000ff"&gt;ref&lt;/span&gt; SYSTEMTIME sysTime);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum21" style="color: #606060"&gt;  21:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum22" style="color: #606060"&gt;  22:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum23" style="color: #606060"&gt;  23:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// Set the Local System DateTime&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum24" style="color: #606060"&gt;  24:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum25" style="color: #606060"&gt;  25:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;param name=&amp;quot;date&amp;quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum26" style="color: #606060"&gt;  26:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; SetDateTime(DateTime date)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum27" style="color: #606060"&gt;  27:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum28" style="color: #606060"&gt;  28:&lt;/span&gt;         SYSTEMTIME st = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; SYSTEMTIME();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum29" style="color: #606060"&gt;  29:&lt;/span&gt;         st.wYear = (&lt;span style="color: #0000ff"&gt;short&lt;/span&gt;)date.Year;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum30" style="color: #606060"&gt;  30:&lt;/span&gt;         st.wMonth = (&lt;span style="color: #0000ff"&gt;short&lt;/span&gt;)date.Month;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum31" style="color: #606060"&gt;  31:&lt;/span&gt;         st.wDay = (&lt;span style="color: #0000ff"&gt;short&lt;/span&gt;)date.Day;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum32" style="color: #606060"&gt;  32:&lt;/span&gt;         st.wHour = (&lt;span style="color: #0000ff"&gt;short&lt;/span&gt;)date.Hour;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum33" style="color: #606060"&gt;  33:&lt;/span&gt;         st.wMinute = (&lt;span style="color: #0000ff"&gt;short&lt;/span&gt;)date.Minute;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum34" style="color: #606060"&gt;  34:&lt;/span&gt;         st.wSecond = (&lt;span style="color: #0000ff"&gt;short&lt;/span&gt;)date.Second;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum35" style="color: #606060"&gt;  35:&lt;/span&gt;         st.wMilliseconds = (&lt;span style="color: #0000ff"&gt;short&lt;/span&gt;)date.Millisecond;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum36" style="color: #606060"&gt;  36:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum37" style="color: #606060"&gt;  37:&lt;/span&gt;         SetSystemTime(&lt;span style="color: #0000ff"&gt;ref&lt;/span&gt; st);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum38" style="color: #606060"&gt;  38:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum39" style="color: #606060"&gt;  39:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum40" style="color: #606060"&gt;  40:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum41" style="color: #606060"&gt;  41:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// Get the Local System DateTime&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum42" style="color: #606060"&gt;  42:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum43" style="color: #606060"&gt;  43:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum44" style="color: #606060"&gt;  44:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; DateTime GetDateTime()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum45" style="color: #606060"&gt;  45:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum46" style="color: #606060"&gt;  46:&lt;/span&gt;         SYSTEMTIME st = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; SYSTEMTIME();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum47" style="color: #606060"&gt;  47:&lt;/span&gt;         GetSystemTime(&lt;span style="color: #0000ff"&gt;ref&lt;/span&gt; st);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum48" style="color: #606060"&gt;  48:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum49" style="color: #606060"&gt;  49:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; DateTime(st.wYear, st.wMonth, st.wDay,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum50" style="color: #606060"&gt;  50:&lt;/span&gt;             st.wHour, st.wMinute, st.wSecond, st.wMilliseconds);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum51" style="color: #606060"&gt;  51:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum52" style="color: #606060"&gt;  52:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Hope this help’s!&lt;/p&gt;</description>
      <link>http://blog.sb2.fr/post/2009/03/16/How-to-Change-System-Date-Programmatically-With-C.aspx</link>
      <author>yb.nospam@nospam.sb2.fr (xTC)</author>
      <comments>http://blog.sb2.fr/post/2009/03/16/How-to-Change-System-Date-Programmatically-With-C.aspx#comment</comments>
      <guid>http://blog.sb2.fr/post.aspx?id=dba5490b-9c04-49fa-8d72-738e3a039d6f</guid>
      <pubDate>Mon, 16 Mar 2009 16:53:23 +0200</pubDate>
      <category>C#</category>
      <dc:publisher>xTC</dc:publisher>
      <pingback:server>http://blog.sb2.fr/pingback.axd</pingback:server>
      <pingback:target>http://blog.sb2.fr/post.aspx?id=dba5490b-9c04-49fa-8d72-738e3a039d6f</pingback:target>
      <slash:comments>10</slash:comments>
      <trackback:ping>http://blog.sb2.fr/trackback.axd?id=dba5490b-9c04-49fa-8d72-738e3a039d6f</trackback:ping>
      <wfw:comment>http://blog.sb2.fr/post/2009/03/16/How-to-Change-System-Date-Programmatically-With-C.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.sb2.fr/syndication.axd?post=dba5490b-9c04-49fa-8d72-738e3a039d6f</wfw:commentRss>
    </item>
    <item>
      <title>Windows 7 Beta Available For MSDN Subscribers (x86) And (x64)</title>
      <description>&lt;p&gt;Hi,&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Windows 7&lt;/strong&gt; is now available in Beta for &lt;strong&gt;MSDN Subscribers&lt;/strong&gt;. Both x86 and x64 versions are available.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Windows 7 Beta (x64) - DVD (English) &lt;/li&gt;    &lt;li&gt;Windows 7 Beta (x86) - DVD (English) &lt;/li&gt;    &lt;li&gt;Windows 7 Beta Language Pack (x86) - DVD (English) &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;If you got MSDN Subscription Check it out !&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/subscriptions/default.aspx"&gt;http://msdn.microsoft.com/en-us/subscriptions/default.aspx&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://blog.sb2.fr/post/2009/01/08/Windows-7-Beta-Available-For-MSDN-Subscribers-(x86)-And-(x64).aspx</link>
      <author>yb.nospam@nospam.sb2.fr (xTC)</author>
      <comments>http://blog.sb2.fr/post/2009/01/08/Windows-7-Beta-Available-For-MSDN-Subscribers-(x86)-And-(x64).aspx#comment</comments>
      <guid>http://blog.sb2.fr/post.aspx?id=566f0bb0-6f89-46d9-9e59-84c1e9ebb6d1</guid>
      <pubDate>Thu, 08 Jan 2009 13:18:03 +0200</pubDate>
      <dc:publisher>xTC</dc:publisher>
      <pingback:server>http://blog.sb2.fr/pingback.axd</pingback:server>
      <pingback:target>http://blog.sb2.fr/post.aspx?id=566f0bb0-6f89-46d9-9e59-84c1e9ebb6d1</pingback:target>
      <slash:comments>20</slash:comments>
      <trackback:ping>http://blog.sb2.fr/trackback.axd?id=566f0bb0-6f89-46d9-9e59-84c1e9ebb6d1</trackback:ping>
      <wfw:comment>http://blog.sb2.fr/post/2009/01/08/Windows-7-Beta-Available-For-MSDN-Subscribers-(x86)-And-(x64).aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.sb2.fr/syndication.axd?post=566f0bb0-6f89-46d9-9e59-84c1e9ebb6d1</wfw:commentRss>
    </item>
    <item>
      <title>Scheduled ASP.NET Task Manager</title>
      <description>&lt;p&gt;Hi,&lt;/p&gt;  &lt;p&gt;In this article I’ll talk about Scheduled Task Manager in a ASP.NET Environment. We often need to make scheduled tasks running in background but it’s not very simple to make it with ASP.NET.&lt;/p&gt;  &lt;p&gt;I based my article on the &lt;a href="http://blog.stackoverflow.com/2008/07/easy-background-tasks-in-aspnet/" target="_blank"&gt;StackOverFlow&lt;/a&gt; article which uses ASP.NET Cache to schedule tasks.&lt;/p&gt;  &lt;p&gt;First of all here is the IScheduledTask Interface in order to Implements our Custom Tasks&lt;/p&gt;  &lt;div class="csharpcode-wrapper"&gt;   &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;interface&lt;/span&gt; IScheduledTask
{
    TimeSpan Expiration { get; set; }
    Boolean IsOnce { get; set; }
    String Name { get; set; }
    &lt;span class="kwrd"&gt;void&lt;/span&gt; Run();
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Now the &lt;strong&gt;ScheduledTaskManager&lt;/strong&gt;&lt;/p&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; ScheduledTaskManager
{
    &lt;span class="preproc"&gt;#region&lt;/span&gt; Singleton

    &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;readonly&lt;/span&gt; ScheduledTaskManager instance = &lt;span class="kwrd"&gt;new&lt;/span&gt; ScheduledTaskManager();

    &lt;span class="kwrd"&gt;static&lt;/span&gt; ScheduledTaskManager()
    {
    }

    ScheduledTaskManager()
    {
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; ScheduledTaskManager Instance
    {
        get
        {
            &lt;span class="kwrd"&gt;return&lt;/span&gt; instance;
        }
    }

    &lt;span class="preproc"&gt;#endregion&lt;/span&gt;

    &lt;span class="preproc"&gt;#region&lt;/span&gt; Private Fields

    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; CacheItemRemovedCallback OnCacheRemove = &lt;span class="kwrd"&gt;null&lt;/span&gt;;

    &lt;span class="preproc"&gt;#endregion&lt;/span&gt;

    &lt;span class="preproc"&gt;#region&lt;/span&gt; Public Methods

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; AddTask(IScheduledTask task)
    {
        OnCacheRemove = &lt;span class="kwrd"&gt;new&lt;/span&gt; CacheItemRemovedCallback(CacheItemRemoved);

        HttpRuntime.Cache.Insert(task.Name, task, &lt;span class="kwrd"&gt;null&lt;/span&gt;,
        DateTime.Now.Add(task.Expiration), Cache.NoSlidingExpiration,
        CacheItemPriority.NotRemovable, OnCacheRemove);
    }

    &lt;span class="preproc"&gt;#endregion&lt;/span&gt;

    &lt;span class="preproc"&gt;#region&lt;/span&gt; Private Methods

    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; CacheItemRemoved(&lt;span class="kwrd"&gt;string&lt;/span&gt; k, &lt;span class="kwrd"&gt;object&lt;/span&gt; v, CacheItemRemovedReason r)
    {
        var task = v &lt;span class="kwrd"&gt;as&lt;/span&gt; IScheduledTask;
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (task == &lt;span class="kwrd"&gt;null&lt;/span&gt;) &lt;span class="kwrd"&gt;return&lt;/span&gt;;

        task.Run();
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (!task.IsOnce)
            AddTask((IScheduledTask)v);
    }

    &lt;span class="preproc"&gt;#endregion&lt;/span&gt;
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;We can now implement our Custom Task&lt;/p&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; MyTask : IScheduledTask
{
    &lt;span class="preproc"&gt;#region&lt;/span&gt; IScheduledTask Members

    &lt;span class="kwrd"&gt;public&lt;/span&gt; TimeSpan Expiration
    {
        get; set;
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Name
    {
        get; set;
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Run()
    {
        Debug.WriteLine(&lt;span class="str"&gt;&amp;quot;Running !&amp;quot;&lt;/span&gt;);
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; IsOnce
    {
        get; set;
    }

    &lt;span class="preproc"&gt;#endregion&lt;/span&gt;
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Sample Usage :&lt;/strong&gt;&lt;/p&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Global : System.Web.HttpApplication
{

    &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Application_Start(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, EventArgs e)
    {
        var task = &lt;span class="kwrd"&gt;new&lt;/span&gt; MyTask {Name = &lt;span class="str"&gt;&amp;quot;MyTask&amp;quot;&lt;/span&gt;, Expiration = &lt;span class="kwrd"&gt;new&lt;/span&gt; TimeSpan(0, 0, 10)};
        ScheduledTaskManager.Instance.AddTask(task);

        var task2 = &lt;span class="kwrd"&gt;new&lt;/span&gt; MyTask { Name = &lt;span class="str"&gt;&amp;quot;MyTask2&amp;quot;&lt;/span&gt;, Expiration = &lt;span class="kwrd"&gt;new&lt;/span&gt; TimeSpan(0, 0, 5) };
        ScheduledTaskManager.Instance.AddTask(task2);
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Simple :)&lt;/p&gt;

&lt;p&gt;Hope this help’s !&lt;/p&gt;</description>
      <link>http://blog.sb2.fr/post/2009/01/04/Scheduled-ASPNET-Task-Manager.aspx</link>
      <author>yb.nospam@nospam.sb2.fr (xTC)</author>
      <comments>http://blog.sb2.fr/post/2009/01/04/Scheduled-ASPNET-Task-Manager.aspx#comment</comments>
      <guid>http://blog.sb2.fr/post.aspx?id=3dd838a1-8897-4307-b8d1-ac74cc783cfe</guid>
      <pubDate>Sun, 04 Jan 2009 05:14:49 +0200</pubDate>
      <category>ASP.NET</category>
      <category>C#</category>
      <dc:publisher>xTC</dc:publisher>
      <pingback:server>http://blog.sb2.fr/pingback.axd</pingback:server>
      <pingback:target>http://blog.sb2.fr/post.aspx?id=3dd838a1-8897-4307-b8d1-ac74cc783cfe</pingback:target>
      <slash:comments>26</slash:comments>
      <trackback:ping>http://blog.sb2.fr/trackback.axd?id=3dd838a1-8897-4307-b8d1-ac74cc783cfe</trackback:ping>
      <wfw:comment>http://blog.sb2.fr/post/2009/01/04/Scheduled-ASPNET-Task-Manager.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.sb2.fr/syndication.axd?post=3dd838a1-8897-4307-b8d1-ac74cc783cfe</wfw:commentRss>
    </item>
    <item>
      <title>How-To Change Visual Studio CSS Editor Default Format Settings</title>
      <description>&lt;p&gt;Hi,&lt;/p&gt;  &lt;p&gt;Here is a Quick Tip in order to Change Visual Studio CSS Editor Default Format Settings&lt;/p&gt;  &lt;p&gt;Visual Studio Allow us to choose between 3 different CSS Formats :&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Compact &lt;/li&gt;    &lt;li&gt;Semi-Expanded &lt;/li&gt;    &lt;li&gt;Expanded &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;You can change this Settings in &lt;strong&gt;Tools &amp;gt; Options &amp;gt; Text Editor &amp;gt; CSS &amp;gt; Format&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blog.sb2.fr/image.axd?picture=WindowsLiveWriter/HowToChangeVisualStudioCSSEditorDefaultF_E8B3/image_2.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="374" alt="image" src="http://blog.sb2.fr/image.axd?picture=WindowsLiveWriter/HowToChangeVisualStudioCSSEditorDefaultF_E8B3/image_thumb.png" width="644" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;h3&gt;Compact Format Sample&lt;/h3&gt;  &lt;div class="csharpcode-wrapper"&gt;   &lt;pre class="csharpcode"&gt;a:&lt;span class="kwrd"&gt;link&lt;/span&gt; { &lt;span class="kwrd"&gt;color&lt;/span&gt;: &lt;span class="str"&gt;#034af3;&lt;/span&gt; &lt;span class="kwrd"&gt;text-decoration&lt;/span&gt;: &lt;span class="str"&gt;underline;&lt;/span&gt; }
a:visited { &lt;span class="kwrd"&gt;color&lt;/span&gt;: &lt;span class="str"&gt;#505abc;&lt;/span&gt; }
a:hover { &lt;span class="kwrd"&gt;color&lt;/span&gt;: &lt;span class="str"&gt;#1d60ff;&lt;/span&gt; &lt;span class="kwrd"&gt;text-decoration&lt;/span&gt;: &lt;span class="str"&gt;none;&lt;/span&gt; }
a:active { &lt;span class="kwrd"&gt;color&lt;/span&gt;: &lt;span class="str"&gt;#12eb87;&lt;/span&gt; }&lt;/pre&gt;
&lt;/div&gt;

&lt;h3&gt;Semi-Expanded Format Sample&lt;/h3&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;a:&lt;span class="kwrd"&gt;link&lt;/span&gt; {
    &lt;span class="kwrd"&gt;color&lt;/span&gt;: &lt;span class="str"&gt;#034af3;&lt;/span&gt;
    &lt;span class="kwrd"&gt;text-decoration&lt;/span&gt;: &lt;span class="str"&gt;underline;&lt;/span&gt;
}
a:visited {
    &lt;span class="kwrd"&gt;color&lt;/span&gt;: &lt;span class="str"&gt;#505abc;&lt;/span&gt;
}
a:hover {
    &lt;span class="kwrd"&gt;color&lt;/span&gt;: &lt;span class="str"&gt;#1d60ff;&lt;/span&gt;
    &lt;span class="kwrd"&gt;text-decoration&lt;/span&gt;: &lt;span class="str"&gt;none;&lt;/span&gt;
}
a:active {
    &lt;span class="kwrd"&gt;color&lt;/span&gt;: &lt;span class="str"&gt;#12eb87;&lt;/span&gt;
}&lt;/pre&gt;
&lt;/div&gt;

&lt;h3&gt;Expanded Format Sample&lt;/h3&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;a:&lt;span class="kwrd"&gt;link&lt;/span&gt;
{
    &lt;span class="kwrd"&gt;color&lt;/span&gt;: &lt;span class="str"&gt;#034af3;&lt;/span&gt;
    &lt;span class="kwrd"&gt;text-decoration&lt;/span&gt;: &lt;span class="str"&gt;underline;&lt;/span&gt;
}
a:visited
{
    &lt;span class="kwrd"&gt;color&lt;/span&gt;: &lt;span class="str"&gt;#505abc;&lt;/span&gt;
}
a:hover
{
    &lt;span class="kwrd"&gt;color&lt;/span&gt;: &lt;span class="str"&gt;#1d60ff;&lt;/span&gt;
    &lt;span class="kwrd"&gt;text-decoration&lt;/span&gt;: &lt;span class="str"&gt;none;&lt;/span&gt;
}
a:active
{
    &lt;span class="kwrd"&gt;color&lt;/span&gt;: &lt;span class="str"&gt;#12eb87;&lt;/span&gt;
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Hope this help’s.&lt;/p&gt;</description>
      <link>http://blog.sb2.fr/post/2009/01/03/How-To-Change-Visual-Studio-CSS-Editor-Default-Format-Settings.aspx</link>
      <author>yb.nospam@nospam.sb2.fr (xTC)</author>
      <comments>http://blog.sb2.fr/post/2009/01/03/How-To-Change-Visual-Studio-CSS-Editor-Default-Format-Settings.aspx#comment</comments>
      <guid>http://blog.sb2.fr/post.aspx?id=12c4be4c-7cc6-4433-ad1e-7f4d189b6fb5</guid>
      <pubDate>Sat, 03 Jan 2009 16:34:53 +0200</pubDate>
      <category>Tips</category>
      <category>Visual Studio</category>
      <dc:publisher>xTC</dc:publisher>
      <pingback:server>http://blog.sb2.fr/pingback.axd</pingback:server>
      <pingback:target>http://blog.sb2.fr/post.aspx?id=12c4be4c-7cc6-4433-ad1e-7f4d189b6fb5</pingback:target>
      <slash:comments>4</slash:comments>
      <trackback:ping>http://blog.sb2.fr/trackback.axd?id=12c4be4c-7cc6-4433-ad1e-7f4d189b6fb5</trackback:ping>
      <wfw:comment>http://blog.sb2.fr/post/2009/01/03/How-To-Change-Visual-Studio-CSS-Editor-Default-Format-Settings.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.sb2.fr/syndication.axd?post=12c4be4c-7cc6-4433-ad1e-7f4d189b6fb5</wfw:commentRss>
    </item>
    <item>
      <title>Regular Expression MapRoute With ASP.NET MVC</title>
      <description>&lt;p&gt;Hi,&lt;/p&gt;  &lt;p&gt;In this article I’ll talk about ASP.NET MVC Routes and Regular Expression. I based my article from the &lt;a href="http://iridescence.no/" target="_blank"&gt;Fredrik Kalseth’s Blog&lt;/a&gt; about &lt;a href="http://iridescence.no/post/Defining-Routes-using-Regular-Expressions-in-ASPNET-MVC.aspx" target="_blank"&gt;Defining Routes using Regular Expressions in ASP.NET MVC&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Fredrik provides a Custom Implementation of Route in order to be able to use Regular Expression Patterns with MVC Routing.&lt;/p&gt;  &lt;p&gt;However we are not able to use that with the &lt;strong&gt;MapRoute&lt;/strong&gt; Extension Method of &lt;strong&gt;RouteCollection&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;So Here is a Custom Implementation of the MapRoute Extension Method which takes advantage of &lt;strong&gt;RegexRoute&lt;/strong&gt; Implementation made by Fredrik.&lt;/p&gt;  &lt;h3&gt;RegexRoute :&lt;/h3&gt;  &lt;div class="csharpcode-wrapper"&gt;   &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; RegexRoute : Route
{
    &lt;span class="preproc"&gt;#region&lt;/span&gt; Private Fields

    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;readonly&lt;/span&gt; Regex _urlRegex;

    &lt;span class="preproc"&gt;#endregion&lt;/span&gt;

    &lt;span class="preproc"&gt;#region&lt;/span&gt; Constructors

    &lt;span class="kwrd"&gt;public&lt;/span&gt; RegexRoute(Regex urlPattern, IRouteHandler routeHandler)
        : &lt;span class="kwrd"&gt;this&lt;/span&gt;(urlPattern, &lt;span class="kwrd"&gt;null&lt;/span&gt;, routeHandler)
    {

    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; RegexRoute(Regex urlPattern, RouteValueDictionary defaults, IRouteHandler routeHandler)
        : &lt;span class="kwrd"&gt;base&lt;/span&gt;(&lt;span class="kwrd"&gt;null&lt;/span&gt;, defaults, routeHandler)
    {
        _urlRegex = urlPattern;
    }

    &lt;span class="preproc"&gt;#endregion&lt;/span&gt;

    &lt;span class="preproc"&gt;#region&lt;/span&gt; Public Overrides Methods

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; RouteData GetRouteData(HttpContextBase httpContext)
    {
        var requestUrl = httpContext.Request.AppRelativeCurrentExecutionFilePath.Substring(2) + httpContext.Request.PathInfo;

        var match = _urlRegex.Match(requestUrl);

        RouteData data = &lt;span class="kwrd"&gt;null&lt;/span&gt;;

        &lt;span class="kwrd"&gt;if&lt;/span&gt; (match.Success)
        {
            data = &lt;span class="kwrd"&gt;new&lt;/span&gt; RouteData(&lt;span class="kwrd"&gt;this&lt;/span&gt;, RouteHandler);

            &lt;span class="rem"&gt;// add defaults first&lt;/span&gt;
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (&lt;span class="kwrd"&gt;null&lt;/span&gt; != Defaults)
            {
                &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (var def &lt;span class="kwrd"&gt;in&lt;/span&gt; Defaults)
                {
                    data.Values[def.Key] = def.Value;
                }
            }

            &lt;span class="rem"&gt;// iterate matching groups&lt;/span&gt;
            &lt;span class="kwrd"&gt;for&lt;/span&gt; (var i = 1; i &amp;lt; match.Groups.Count; i++)
            {
                var group = match.Groups[i];

                &lt;span class="kwrd"&gt;if&lt;/span&gt; (!group.Success) &lt;span class="kwrd"&gt;continue&lt;/span&gt;;
                var key = _urlRegex.GroupNameFromNumber(i);

                &lt;span class="kwrd"&gt;if&lt;/span&gt; (!String.IsNullOrEmpty(key) &amp;amp;&amp;amp; !Char.IsNumber(key, 0))
                {
                    data.Values[key] = group.Value;
                }
            }
        }

        &lt;span class="kwrd"&gt;return&lt;/span&gt; data;
    }

    &lt;span class="preproc"&gt;#endregion&lt;/span&gt;
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;h3&gt;RegexRouteCollectionExtensions&lt;/h3&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; RegexRouteCollectionExtensions
{
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; Route MapRoute(&lt;span class="kwrd"&gt;this&lt;/span&gt; RouteCollection routes, &lt;span class="kwrd"&gt;string&lt;/span&gt; name, Regex urlPattern)
    {
        &lt;span class="kwrd"&gt;return&lt;/span&gt; routes.MapRoute(name, urlPattern, &lt;span class="kwrd"&gt;null&lt;/span&gt;, &lt;span class="kwrd"&gt;null&lt;/span&gt;);
    }
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; Route MapRoute(&lt;span class="kwrd"&gt;this&lt;/span&gt; RouteCollection routes, &lt;span class="kwrd"&gt;string&lt;/span&gt; name, Regex urlPattern, &lt;span class="kwrd"&gt;object&lt;/span&gt; defaults)
    {
        &lt;span class="kwrd"&gt;return&lt;/span&gt; routes.MapRoute(name, urlPattern, defaults, &lt;span class="kwrd"&gt;null&lt;/span&gt;);
    }
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; Route MapRoute(&lt;span class="kwrd"&gt;this&lt;/span&gt; RouteCollection routes, &lt;span class="kwrd"&gt;string&lt;/span&gt; name, Regex urlPattern, &lt;span class="kwrd"&gt;string&lt;/span&gt;[] namespaces)
    {
        &lt;span class="kwrd"&gt;return&lt;/span&gt; routes.MapRoute(name, urlPattern, &lt;span class="kwrd"&gt;null&lt;/span&gt;, &lt;span class="kwrd"&gt;null&lt;/span&gt;, namespaces);
    }
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; Route MapRoute(&lt;span class="kwrd"&gt;this&lt;/span&gt; RouteCollection routes, &lt;span class="kwrd"&gt;string&lt;/span&gt; name, Regex urlPattern, &lt;span class="kwrd"&gt;object&lt;/span&gt; defaults, &lt;span class="kwrd"&gt;object&lt;/span&gt; constraints)
    {
        &lt;span class="kwrd"&gt;return&lt;/span&gt; routes.MapRoute(name, urlPattern, defaults, constraints, &lt;span class="kwrd"&gt;null&lt;/span&gt;);
    }
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; Route MapRoute(&lt;span class="kwrd"&gt;this&lt;/span&gt; RouteCollection routes, &lt;span class="kwrd"&gt;string&lt;/span&gt; name, Regex urlPattern, &lt;span class="kwrd"&gt;object&lt;/span&gt; defaults, &lt;span class="kwrd"&gt;string&lt;/span&gt;[] namespaces)
    {
        &lt;span class="kwrd"&gt;return&lt;/span&gt; routes.MapRoute(name, urlPattern, defaults, &lt;span class="kwrd"&gt;null&lt;/span&gt;, namespaces);
    }
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; Route MapRoute(&lt;span class="kwrd"&gt;this&lt;/span&gt; RouteCollection routes, &lt;span class="kwrd"&gt;string&lt;/span&gt; name, Regex urlPattern, &lt;span class="kwrd"&gt;object&lt;/span&gt; defaults, &lt;span class="kwrd"&gt;object&lt;/span&gt; constraints, &lt;span class="kwrd"&gt;string&lt;/span&gt;[] namespaces)
    {
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (routes == &lt;span class="kwrd"&gt;null&lt;/span&gt;)
        {
            &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; ArgumentNullException(&lt;span class="str"&gt;&amp;quot;routes&amp;quot;&lt;/span&gt;);
        }
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (urlPattern == &lt;span class="kwrd"&gt;null&lt;/span&gt;)
        {
            &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; ArgumentNullException(&lt;span class="str"&gt;&amp;quot;urlPattern&amp;quot;&lt;/span&gt;);
        }
        var route2 = &lt;span class="kwrd"&gt;new&lt;/span&gt; RegexRoute(urlPattern, &lt;span class="kwrd"&gt;new&lt;/span&gt; MvcRouteHandler())
                         {
                             Defaults = &lt;span class="kwrd"&gt;new&lt;/span&gt; RouteValueDictionary(defaults),
                             Constraints = &lt;span class="kwrd"&gt;new&lt;/span&gt; RouteValueDictionary(constraints)
                         };
        var item = route2;
        &lt;span class="kwrd"&gt;if&lt;/span&gt; ((namespaces != &lt;span class="kwrd"&gt;null&lt;/span&gt;) &amp;amp;&amp;amp; (namespaces.Length &amp;gt; 0))
        {
            item.DataTokens = &lt;span class="kwrd"&gt;new&lt;/span&gt; RouteValueDictionary();
            item.DataTokens[&lt;span class="str"&gt;&amp;quot;Namespaces&amp;quot;&lt;/span&gt;] = namespaces;
        }
        routes.Add(name, item);
        &lt;span class="kwrd"&gt;return&lt;/span&gt; item;
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;h3&gt;Sample Usage (Global.asax)&lt;/h3&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Global : HttpApplication
{
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; RegisterRoutes(RouteCollection routes)
    {
        routes.MapRoute(&lt;span class="str"&gt;&amp;quot;Books&amp;quot;&lt;/span&gt;, &lt;span class="kwrd"&gt;new&lt;/span&gt; Regex(&lt;span class="str"&gt;@&amp;quot;^Books/((?&amp;lt;ssn&amp;gt;[\d]{3}(-?)[\d]{2}\1[\d]{4})|(?&amp;lt;query&amp;gt;.+)?)$&amp;quot;&lt;/span&gt;, RegexOptions.Compiled),
                &lt;span class="kwrd"&gt;new&lt;/span&gt; { controller = &lt;span class="str"&gt;&amp;quot;Books&amp;quot;&lt;/span&gt;, action = &lt;span class="str"&gt;&amp;quot;Index&amp;quot;&lt;/span&gt; });
    }

    &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Application_Start()
    {
        RegisterRoutes(RouteTable.Routes);
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Hope this help’s!&lt;/p&gt;</description>
      <link>http://blog.sb2.fr/post/2009/01/03/Regular-Expression-MapRoute-With-ASPNET-MVC.aspx</link>
      <author>yb.nospam@nospam.sb2.fr (xTC)</author>
      <comments>http://blog.sb2.fr/post/2009/01/03/Regular-Expression-MapRoute-With-ASPNET-MVC.aspx#comment</comments>
      <guid>http://blog.sb2.fr/post.aspx?id=93e65a42-b09f-49ef-b5aa-d7e465255c2f</guid>
      <pubDate>Sat, 03 Jan 2009 16:17:22 +0200</pubDate>
      <category>ASP.NET MVC</category>
      <dc:publisher>xTC</dc:publisher>
      <pingback:server>http://blog.sb2.fr/pingback.axd</pingback:server>
      <pingback:target>http://blog.sb2.fr/post.aspx?id=93e65a42-b09f-49ef-b5aa-d7e465255c2f</pingback:target>
      <slash:comments>14</slash:comments>
      <trackback:ping>http://blog.sb2.fr/trackback.axd?id=93e65a42-b09f-49ef-b5aa-d7e465255c2f</trackback:ping>
      <wfw:comment>http://blog.sb2.fr/post/2009/01/03/Regular-Expression-MapRoute-With-ASPNET-MVC.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.sb2.fr/syndication.axd?post=93e65a42-b09f-49ef-b5aa-d7e465255c2f</wfw:commentRss>
    </item>
    <item>
      <title>Using IQueryable&lt;T&gt; Extension Methods With LinqToSql</title>
      <description>&lt;p&gt;Hi,&lt;/p&gt;  &lt;p&gt;In this article I’ll shows a pretty useful way to build simple LinqToSql Queries with reusable &lt;strong&gt;IQueryable&amp;lt;T&amp;gt;&lt;/strong&gt; Extension Methods.&lt;/p&gt;  &lt;p&gt;Assuming a LinqToSql DataContext which contains a single Class named “&lt;strong&gt;User&lt;/strong&gt;”&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blog.sb2.fr/image.axd?picture=WindowsLiveWriter/UsingIQueryableTExtensionMethodsWithLinq_2C89/image_2.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="204" alt="image" src="http://blog.sb2.fr/image.axd?picture=WindowsLiveWriter/UsingIQueryableTExtensionMethodsWithLinq_2C89/image_thumb.png" width="208" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Now we want to Query a User by it’s Email Address.&lt;/p&gt;  &lt;p&gt;Using Standard Linq Query we do the following in our &lt;strong&gt;UserController&lt;/strong&gt; Class :&lt;/p&gt;  &lt;div class="csharpcode-wrapper"&gt;   &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; User GetByEmail(String email)
{
    &lt;span class="kwrd"&gt;return&lt;/span&gt; Context.Users.Where(p =&amp;gt; p.Email == email).SingleOrDefault();
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;This works fine but we can make this Where clause Reusable for further usages.&lt;/p&gt;

&lt;p&gt;So we create a Extension Methods Class called &lt;strong&gt;UserExtensions&lt;/strong&gt; :&lt;/p&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; UserExtensions
{
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; IQueryable&amp;lt;User&amp;gt; WithEmail(&lt;span class="kwrd"&gt;this&lt;/span&gt; IQueryable&amp;lt;User&amp;gt; q, String email)
    {
        &lt;span class="kwrd"&gt;return&lt;/span&gt; q.Where(p =&amp;gt; p.Email == email);
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;We can now modify our &lt;strong&gt;GetByEmail&lt;/strong&gt; method and use our Extension method :&lt;/p&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; User GetByEmail(String email)
{
    &lt;span class="kwrd"&gt;return&lt;/span&gt; Context.Users.WithEmail(email).SingleOrDefault();
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;This is now clear and Reusable !&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Some other Examples :&lt;/p&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; Boolean IsValidUser(String email, String password)
{
    var q = Context.Users.WithEmail(email).WithPassword(password);
    &lt;span class="kwrd"&gt;return&lt;/span&gt; q.SingleOrDefault() != &lt;span class="kwrd"&gt;null&lt;/span&gt;;
}

&lt;span class="kwrd"&gt;public&lt;/span&gt; Boolean UserExists(String email)
{
    &lt;span class="kwrd"&gt;return&lt;/span&gt; Context.Users.WithEmail(email).SingleOrDefault() != &lt;span class="kwrd"&gt;null&lt;/span&gt;;
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;So here is how to take Advantage of the &lt;strong&gt;IQueryable&lt;/strong&gt; Interface with Extension Methods.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Hope this help’s!&lt;/p&gt;</description>
      <link>http://blog.sb2.fr/post/2009/01/03/Using-IQueryable3cT3e-Extension-Methods-With-LinqToSql.aspx</link>
      <author>yb.nospam@nospam.sb2.fr (xTC)</author>
      <comments>http://blog.sb2.fr/post/2009/01/03/Using-IQueryable3cT3e-Extension-Methods-With-LinqToSql.aspx#comment</comments>
      <guid>http://blog.sb2.fr/post.aspx?id=b4e9d9c3-74d1-4ffc-b879-b7dd03420a03</guid>
      <pubDate>Sat, 03 Jan 2009 03:16:49 +0200</pubDate>
      <category>C#</category>
      <dc:publisher>xTC</dc:publisher>
      <pingback:server>http://blog.sb2.fr/pingback.axd</pingback:server>
      <pingback:target>http://blog.sb2.fr/post.aspx?id=b4e9d9c3-74d1-4ffc-b879-b7dd03420a03</pingback:target>
      <slash:comments>6</slash:comments>
      <trackback:ping>http://blog.sb2.fr/trackback.axd?id=b4e9d9c3-74d1-4ffc-b879-b7dd03420a03</trackback:ping>
      <wfw:comment>http://blog.sb2.fr/post/2009/01/03/Using-IQueryable3cT3e-Extension-Methods-With-LinqToSql.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.sb2.fr/syndication.axd?post=b4e9d9c3-74d1-4ffc-b879-b7dd03420a03</wfw:commentRss>
    </item>
    <item>
      <title>Most Interesting .NET StackOverFlow Questions</title>
      <description>&lt;p&gt;Hi,&lt;/p&gt;  &lt;p&gt;Today a short list of My Personal Most Interesting .NET Questions asked on &lt;a href="http://stackoverflow.com/" target="_blank"&gt;StackOverFlow&lt;/a&gt; I founded. &lt;/p&gt;  &lt;p&gt;StackOverFlow is a great place for IT Developers for sharing and collaboratively editing IT professionals Questions and Answers.&lt;/p&gt;  &lt;p&gt;&lt;img src="http://stackoverflow.com/Content/Img/stackoverflow-logo-250.png" /&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;1 - Visual Studio Optimizations&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;Visual studio is a pretty awesome IDE, but sometimes you just wish it would go faster. I was wondering if people have any tips or tricks to help speed up visual studio in day to day use.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Check it out : &lt;a href="http://stackoverflow.com/questions/8440/visual-studio-optimizations" target="_blank"&gt;http://stackoverflow.com/questions/8440/visual-studio-optimizations&lt;/a&gt;&lt;/p&gt;  &lt;h3&gt;2 - Hidden .NET Base Class Library Classes&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;What are your favorite, lesser-known .NET Base Class Library classes?&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Check it out : &lt;a href="http://stackoverflow.com/questions/122784/hidden-net-base-class-library-classes"&gt;http://stackoverflow.com/questions/122784/hidden-net-base-class-library-classes&lt;/a&gt;&lt;/p&gt;  &lt;h3&gt;3 - Is DateTime.Now the best way to measure a function’s performance?&lt;/h3&gt;  &lt;p&gt;Check it out : &lt;a href="http://stackoverflow.com/questions/28637/is-datetime-now-the-best-way-to-measure-a-functions-performance" target="_blank"&gt;http://stackoverflow.com/questions/28637/is-datetime-now-the-best-way-to-measure-a-functions-performance&lt;/a&gt;&lt;/p&gt;  &lt;h3&gt;4 - Most wanted feature for C# 4.0 ?&lt;/h3&gt;  &lt;p&gt;Check it out : &lt;a href="http://stackoverflow.com/questions/138367/most-wanted-feature-for-c-4-0" target="_blank"&gt;http://stackoverflow.com/questions/138367/most-wanted-feature-for-c-4-0&lt;/a&gt;&lt;/p&gt;  &lt;h3&gt;5 - Hidden Features of ASP.NET&lt;/h3&gt;  &lt;p&gt;Check it out : &lt;a href="http://stackoverflow.com/questions/54929/hidden-features-of-asp-net" target="_blank"&gt;http://stackoverflow.com/questions/54929/hidden-features-of-asp-net&lt;/a&gt;&lt;/p&gt;  &lt;h3&gt;6 - Visual Studio debugger tips &amp;amp; tricks for .NET&lt;/h3&gt;  &lt;p&gt;Check it out : &lt;a href="http://stackoverflow.com/questions/201450/visual-studio-debugger-tips-tricks-for-net" target="_blank"&gt;http://stackoverflow.com/questions/201450/visual-studio-debugger-tips-tricks-for-net&lt;/a&gt;&lt;/p&gt;  &lt;h3&gt;7 - Most Useful Attributes in C#&lt;/h3&gt;  &lt;p&gt;Check it out : &lt;a href="http://stackoverflow.com/questions/144833/most-useful-attributes-in-c" target="_blank"&gt;http://stackoverflow.com/questions/144833/most-useful-attributes-in-c&lt;/a&gt;&lt;/p&gt;  &lt;h3&gt;8 - What is the most useful .net library you’ve found?&lt;/h3&gt;  &lt;p&gt;Check it out : &lt;a href="http://stackoverflow.com/questions/233648/what-is-the-most-useful-net-library-youve-found" target="_blank"&gt;http://stackoverflow.com/questions/233648/what-is-the-most-useful-net-library-youve-found&lt;/a&gt;&lt;/p&gt;  &lt;h3&gt;9 - Entity Framework vs LINQ to SQL&lt;/h3&gt;  &lt;p&gt;Check it out : &lt;a href="http://stackoverflow.com/questions/8676/entity-framework-vs-linq-to-sql" target="_blank"&gt;http://stackoverflow.com/questions/8676/entity-framework-vs-linq-to-sql&lt;/a&gt;&lt;/p&gt;  &lt;h3&gt;10 - Most Useful .NET Utility Classes Developers Tend To Reinvent Rather Than Reuse&lt;/h3&gt;  &lt;p&gt;Check it out : &lt;a href="http://stackoverflow.com/questions/178524/most-useful-net-utility-classes-developers-tend-to-reinvent-rather-than-reuse" target="_blank"&gt;http://stackoverflow.com/questions/178524/most-useful-net-utility-classes-developers-tend-to-reinvent-rather-than-reuse&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;That’s all, hope this will be useful.&lt;/p&gt;  &lt;p&gt;If anyone got some other interesting Questions on &lt;a href="http://stackoverflow.com/" target="_blank"&gt;StackOverFlow&lt;/a&gt; I’ll be pretty happy to check them out too.&lt;/p&gt;  &lt;p&gt;Thanks and Good Reading.&lt;/p&gt;</description>
      <link>http://blog.sb2.fr/post/2009/01/02/Most-Interesting-NET-StackOverFlow-Questions.aspx</link>
      <author>yb.nospam@nospam.sb2.fr (xTC)</author>
      <comments>http://blog.sb2.fr/post/2009/01/02/Most-Interesting-NET-StackOverFlow-Questions.aspx#comment</comments>
      <guid>http://blog.sb2.fr/post.aspx?id=32fd59dd-fdb2-46d6-854c-fd225115c60b</guid>
      <pubDate>Fri, 02 Jan 2009 15:15:59 +0200</pubDate>
      <category>C#</category>
      <dc:publisher>xTC</dc:publisher>
      <pingback:server>http://blog.sb2.fr/pingback.axd</pingback:server>
      <pingback:target>http://blog.sb2.fr/post.aspx?id=32fd59dd-fdb2-46d6-854c-fd225115c60b</pingback:target>
      <slash:comments>14</slash:comments>
      <trackback:ping>http://blog.sb2.fr/trackback.axd?id=32fd59dd-fdb2-46d6-854c-fd225115c60b</trackback:ping>
      <wfw:comment>http://blog.sb2.fr/post/2009/01/02/Most-Interesting-NET-StackOverFlow-Questions.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.sb2.fr/syndication.axd?post=32fd59dd-fdb2-46d6-854c-fd225115c60b</wfw:commentRss>
    </item>
    <item>
      <title>Hidden Features of C#</title>
      <description>&lt;p&gt;Hi,&lt;/p&gt;  &lt;p&gt;In this article, I’ll just link to a pretty great &lt;a href="http://stackoverflow.com/" target="_blank"&gt;StackOverFlow&lt;/a&gt; Question about &lt;strong&gt;Hidden Features of C#.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Most of C# Features are obscure for us and need some explanations, the following list and explain how to use it.&lt;/p&gt;  &lt;p&gt;For Example, Using the @ for variable names that are keywords&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Using @ for variable names that are keywords.&lt;/p&gt;    &lt;pre&gt;&lt;code&gt;var @object = new object();&lt;br /&gt;var @string = &amp;quot;&amp;quot;;&lt;br /&gt;var @if = IpsoFacto();&lt;/code&gt;&lt;/pre&gt;

  &lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Or even Aliased Generics&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;aliased generics:&lt;/p&gt;

  &lt;pre&gt;&lt;code&gt;using ASimpleName = Dictionary&amp;lt;string, Dictionary&amp;lt;string, List&amp;lt;string&amp;gt;&amp;gt;&amp;gt;;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;

  &lt;p&gt;allows you to use &lt;code&gt;ASimpleName&lt;/code&gt;, instead of &lt;code&gt;Dictionary&amp;lt;string, Dictionary&amp;lt;string, List&amp;lt;string&amp;gt;&amp;gt;&amp;gt;&lt;/code&gt;&lt;/p&gt;

  &lt;p&gt;use it when you would use the same generic big long complex thing in a lot of places&lt;/p&gt;

  &lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;img src="http://stackoverflow.com/Content/Img/stackoverflow-logo-250.png" /&gt; &lt;/p&gt;

&lt;p&gt;Check this out here : &lt;a href="http://stackoverflow.com/questions/9033" target="_blank"&gt;http://stackoverflow.com/questions/9033&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Hope this Help’s.&lt;/p&gt;</description>
      <link>http://blog.sb2.fr/post/2009/01/01/Hidden-Features-of-C.aspx</link>
      <author>yb.nospam@nospam.sb2.fr (xTC)</author>
      <comments>http://blog.sb2.fr/post/2009/01/01/Hidden-Features-of-C.aspx#comment</comments>
      <guid>http://blog.sb2.fr/post.aspx?id=0152ae54-5a46-4484-a4fd-5f5c54da4f00</guid>
      <pubDate>Thu, 01 Jan 2009 23:52:09 +0200</pubDate>
      <category>C#</category>
      <dc:publisher>xTC</dc:publisher>
      <pingback:server>http://blog.sb2.fr/pingback.axd</pingback:server>
      <pingback:target>http://blog.sb2.fr/post.aspx?id=0152ae54-5a46-4484-a4fd-5f5c54da4f00</pingback:target>
      <slash:comments>35</slash:comments>
      <trackback:ping>http://blog.sb2.fr/trackback.axd?id=0152ae54-5a46-4484-a4fd-5f5c54da4f00</trackback:ping>
      <wfw:comment>http://blog.sb2.fr/post/2009/01/01/Hidden-Features-of-C.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.sb2.fr/syndication.axd?post=0152ae54-5a46-4484-a4fd-5f5c54da4f00</wfw:commentRss>
    </item>
    <item>
      <title>Enum String Values Revised</title>
      <description>&lt;p&gt;Hi,&lt;/p&gt;  &lt;p&gt;In this article I’ll provide an improvement about &lt;a href="http://blog.sb2.fr/post/2008/11/13/Valeurs-String-avec-les-Enum-en-C.aspx" target="_blank"&gt;my previous post&lt;/a&gt; talking about String Values from Enumerations.&lt;/p&gt;  &lt;p&gt;Previously we was only able to handle String Values for Enums but with the following we are now able to handle any type of values like DateTime, String, Decimal, etc..&lt;/p&gt;  &lt;p&gt;Here is a Sample of Custom Enum :&lt;/p&gt;  &lt;div class="csharpcode-wrapper"&gt;   &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;enum&lt;/span&gt; MyStringEnum
{
    [EnumValue(&lt;span class="str"&gt;&amp;quot;Hello&amp;quot;&lt;/span&gt;)]
    Foo,
    [EnumValue(&lt;span class="str"&gt;&amp;quot;Merry Christmas&amp;quot;&lt;/span&gt;)]
    Something
}

&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;enum&lt;/span&gt; MyDateTimeEnum
{
    [EnumValue(&lt;span class="str"&gt;&amp;quot;12/30/2008&amp;quot;&lt;/span&gt;)]
    Foo,
    [EnumValue(&lt;span class="str"&gt;&amp;quot;12/01/2008&amp;quot;&lt;/span&gt;)]
    Something
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Note :&lt;/strong&gt; We must still using String Values in EnumValue Constructor since Attribute cannot be Generic and Constructor Parameter must be a constant expression, typeof expression or array creation expression.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;EnumValueAttribute&lt;/strong&gt; is the same as described in &lt;a href="http://blog.sb2.fr/post/2008/11/13/Valeurs-String-avec-les-Enum-en-C.aspx" target="_blank"&gt;my previous post&lt;/a&gt;.&lt;/p&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; EnumValueAttribute : Attribute
{
    &lt;span class="preproc"&gt;#region&lt;/span&gt; Public Properties

    &lt;span class="kwrd"&gt;public&lt;/span&gt; String Value { get; &lt;span class="kwrd"&gt;private&lt;/span&gt; set; }

    &lt;span class="preproc"&gt;#endregion&lt;/span&gt;

    &lt;span class="kwrd"&gt;public&lt;/span&gt; EnumValueAttribute(String val)
    {
        Value = val;
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;The Trick resides in the GetValue Extension Method which is now Generic and use TypeConverter&lt;/p&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; T GetValue&amp;lt;T&amp;gt;(&lt;span class="kwrd"&gt;this&lt;/span&gt; Enum o)
{
    Type type = o.GetType();
    FieldInfo fieldInfo = type.GetField(o.ToString());
    EnumValueAttribute[] attribs = fieldInfo.GetCustomAttributes(
        &lt;span class="kwrd"&gt;typeof&lt;/span&gt;(EnumValueAttribute), &lt;span class="kwrd"&gt;false&lt;/span&gt;) &lt;span class="kwrd"&gt;as&lt;/span&gt; EnumValueAttribute[];

    &lt;span class="kwrd"&gt;if&lt;/span&gt; (attribs.Length &amp;gt; 0)
    {
        &lt;span class="kwrd"&gt;return&lt;/span&gt; (T)Convert.ChangeType(attribs[0].Value, &lt;span class="kwrd"&gt;typeof&lt;/span&gt;(T));
    }
    &lt;span class="kwrd"&gt;else&lt;/span&gt;
    {
        &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;default&lt;/span&gt;(T);
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Now we can use it simply like that :&lt;/p&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;MyStringEnum StringEnum = MyStringEnum.Foo;
String s = StringEnum.GetValue&amp;lt;String&amp;gt;();
Console.WriteLine(s);

MyDateTimeEnum DateEnum = MyDateTimeEnum.Something;
DateTime date = DateEnum.GetValue&amp;lt;DateTime&amp;gt;();
Console.WriteLine(date);&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Hope this help’s!.&lt;/p&gt;</description>
      <link>http://blog.sb2.fr/post/2008/12/30/Enum-String-Values-Revised.aspx</link>
      <author>yb.nospam@nospam.sb2.fr (xTC)</author>
      <comments>http://blog.sb2.fr/post/2008/12/30/Enum-String-Values-Revised.aspx#comment</comments>
      <guid>http://blog.sb2.fr/post.aspx?id=3d571190-e4a8-4059-9380-7d75fc6674ce</guid>
      <pubDate>Tue, 30 Dec 2008 14:12:02 +0200</pubDate>
      <category>C#</category>
      <dc:publisher>xTC</dc:publisher>
      <pingback:server>http://blog.sb2.fr/pingback.axd</pingback:server>
      <pingback:target>http://blog.sb2.fr/post.aspx?id=3d571190-e4a8-4059-9380-7d75fc6674ce</pingback:target>
      <slash:comments>4</slash:comments>
      <trackback:ping>http://blog.sb2.fr/trackback.axd?id=3d571190-e4a8-4059-9380-7d75fc6674ce</trackback:ping>
      <wfw:comment>http://blog.sb2.fr/post/2008/12/30/Enum-String-Values-Revised.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.sb2.fr/syndication.axd?post=3d571190-e4a8-4059-9380-7d75fc6674ce</wfw:commentRss>
    </item>
    <item>
      <title>DotNetKicks And AddToAny Buttons Extension For BlogEngine</title>
      <description>&lt;p&gt;Hi,&lt;/p&gt;  &lt;p&gt;Here is a very useful Extension for &lt;strong&gt;BlogEngine&lt;/strong&gt; in order to simply Add &lt;a href="http://www.dotnetkicks.com/" target="_blank"&gt;DotNetKicks&lt;/a&gt; Button and also &lt;a href="http://www.addtoany.com/" target="_blank"&gt;AddToAny&lt;/a&gt; Features (Share and Subscribe)&lt;/p&gt;  &lt;div class="csharpcode-wrapper"&gt;   &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System;
&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Collections.Generic;
&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Web;
&lt;span class="kwrd"&gt;using&lt;/span&gt; BlogEngine.Core.Web.Controls;
&lt;span class="kwrd"&gt;using&lt;/span&gt; BlogEngine.Core;
&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Text;

&lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
&lt;span class="rem"&gt;/// Summary description for AddToAny With DotNetKick&lt;/span&gt;
&lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
[Extension(&lt;span class="str"&gt;&amp;quot;Add AddtoAny Share and Subscribe and DotNetKick to Post&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;http://blog.sb2.fr&amp;quot;&lt;/span&gt;)]
&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Sharing
{
    &lt;span class="kwrd"&gt;public&lt;/span&gt; Sharing()
    {
        Post.Serving += &lt;span class="kwrd"&gt;new&lt;/span&gt; EventHandler&amp;lt;ServingEventArgs&amp;gt;(Post_Serving);
    }

    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Post_Serving(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, ServingEventArgs e)
    {
        Post post = sender &lt;span class="kwrd"&gt;as&lt;/span&gt; Post;
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (post == &lt;span class="kwrd"&gt;null&lt;/span&gt;)
            &lt;span class="kwrd"&gt;return&lt;/span&gt;;

        &lt;span class="kwrd"&gt;if&lt;/span&gt; (e.Location != ServingLocation.SinglePost)
            &lt;span class="kwrd"&gt;return&lt;/span&gt;;

        StringBuilder sb = &lt;span class="kwrd"&gt;new&lt;/span&gt; StringBuilder(e.Body);
        sb.Append(&lt;span class="str"&gt;&amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;quot;&lt;/span&gt;);

        &lt;span class="rem"&gt;// Add DotNetKick Button&lt;/span&gt;
        sb.AppendFormat(&lt;span class="str"&gt;&amp;quot;&amp;lt;a href=\&amp;quot;http://www.dotnetkicks.com/kick/?url={0}&amp;amp;amp;title={1}\&amp;quot;&amp;quot;&lt;/span&gt;, post.AbsoluteLink, post.Title);
        sb.Append(&lt;span class="str"&gt;&amp;quot;target=\&amp;quot;_blank\&amp;quot; style=\&amp;quot;background-color:Transparent;border:none;padding:0;margin:0\&amp;quot;&amp;gt;&amp;quot;&lt;/span&gt;);
        sb.AppendFormat(&lt;span class="str"&gt;&amp;quot;&amp;lt;img src=\&amp;quot;http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url={0}\&amp;quot;&amp;quot;&lt;/span&gt;, post.AbsoluteLink);
        sb.Append(&lt;span class="str"&gt;&amp;quot;border=\&amp;quot;0\&amp;quot; alt=\&amp;quot;kick it on DotNetKicks.com\&amp;quot; style=\&amp;quot;background-color:Transparent;border:none;padding:0;margin:0\&amp;quot; /&amp;gt;&amp;quot;&lt;/span&gt;);

        sb.Append(&lt;span class="str"&gt;&amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;quot;&lt;/span&gt;);

        &lt;span class="rem"&gt;// Add AddToAny Buttons&lt;/span&gt;
        sb.AppendFormat(&lt;span class="str"&gt;&amp;quot;&amp;lt;a class=\&amp;quot;a2a_dd\&amp;quot; href=\&amp;quot;http://www.addtoany.com/share_save?linkname=&amp;amp;amp;linkurl={0}\&amp;quot;&amp;gt;&amp;quot;&lt;/span&gt;, post.AbsoluteLink);
        sb.Append(&lt;span class="str"&gt;&amp;quot;&amp;lt;img src=\&amp;quot;http://static.addtoany.com/buttons/share_save_171_16.gif\&amp;quot; width=\&amp;quot;171\&amp;quot; height=\&amp;quot;16\&amp;quot; border=\&amp;quot;0\&amp;quot; alt=\&amp;quot;Share/Save/Bookmark\&amp;quot;/&amp;gt;&amp;lt;/a&amp;gt;&amp;quot;&lt;/span&gt;);
        sb.AppendFormat(&lt;span class="str"&gt;&amp;quot;&amp;lt;script type=\&amp;quot;text/javascript\&amp;quot;&amp;gt;a2a_linkname=document.title;a2a_linkurl=\&amp;quot;{0}\&amp;quot;;&amp;lt;/script&amp;gt;&amp;quot;&lt;/span&gt;, post.AbsoluteLink);
        sb.Append(&lt;span class="str"&gt;&amp;quot;&amp;lt;script type=\&amp;quot;text/javascript\&amp;quot; src=\&amp;quot;http://static.addtoany.com/menu/page.js\&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&amp;quot;&lt;/span&gt;);

        sb.Append(&lt;span class="str"&gt;&amp;quot;&amp;amp;nbsp;&amp;quot;&lt;/span&gt;);

        sb.AppendFormat(&lt;span class="str"&gt;&amp;quot;&amp;lt;a class=\&amp;quot;a2a_dd\&amp;quot; href=\&amp;quot;http://www.addtoany.com/subscribe?linkname=&amp;amp;amp;linkurl={0}\&amp;quot;&amp;gt;&amp;quot;&lt;/span&gt;, post.AbsoluteLink);
        sb.Append(&lt;span class="str"&gt;&amp;quot;&amp;lt;img src=\&amp;quot;http://static.addtoany.com/buttons/subscribe_171_16.gif\&amp;quot; width=\&amp;quot;171\&amp;quot; height=\&amp;quot;16\&amp;quot; border=\&amp;quot;0\&amp;quot; alt=\&amp;quot;Subscribe\&amp;quot;/&amp;gt;&amp;lt;/a&amp;gt;&amp;quot;&lt;/span&gt;);
        sb.AppendFormat(&lt;span class="str"&gt;&amp;quot;&amp;lt;script type=\&amp;quot;text/javascript\&amp;quot;&amp;gt;a2a_linkname=document.title;a2a_linkurl=\&amp;quot;{0}\&amp;quot;;&amp;lt;/script&amp;gt;&amp;quot;&lt;/span&gt;, post.AbsoluteLink);
        sb.Append(&lt;span class="str"&gt;&amp;quot;&amp;lt;script type=\&amp;quot;text/javascript\&amp;quot; src=\&amp;quot;http://static.addtoany.com/menu/feed.js\&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&amp;quot;&lt;/span&gt;);

        e.Body = sb.ToString();
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;You can See the Result of this Extension at this Post Bottom.&lt;/p&gt;

&lt;p&gt;Just put the &lt;strong&gt;Sharing.cs&lt;/strong&gt; into your &lt;strong&gt;“~/App_Code/Extensions”&lt;/strong&gt; Folder and It Works !&lt;/p&gt;

&lt;div class="wlWriterEditableSmartContent" id="scid:8eb9d37f-1541-4f29-b6f4-1eea890d4876:79abc911-1b71-42cc-a46d-2d81d8ddedc5" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;p&gt;&lt;div&gt;&lt;a href="http://blog.sb2.fr/file.axd?file=WindowsLiveWriter/DotNetKicksandAddToAnyButtonsExtensionFo_11D55/Sharing.cs" target="_self"&gt;Sharing.cs&lt;/a&gt;&lt;/div&gt;&lt;/p&gt;&lt;/div&gt;

&lt;p&gt;Hope this help’s!.&lt;/p&gt;</description>
      <link>http://blog.sb2.fr/post/2008/12/29/DotNetKicks-and-AddToAny-Buttons-Extension-For-BlogEngine.aspx</link>
      <author>yb.nospam@nospam.sb2.fr (xTC)</author>
      <comments>http://blog.sb2.fr/post/2008/12/29/DotNetKicks-and-AddToAny-Buttons-Extension-For-BlogEngine.aspx#comment</comments>
      <guid>http://blog.sb2.fr/post.aspx?id=9e573a6d-b5cc-4399-8352-50ccb360c37d</guid>
      <pubDate>Mon, 29 Dec 2008 20:19:28 +0200</pubDate>
      <category>BlogEngine</category>
      <dc:publisher>xTC</dc:publisher>
      <pingback:server>http://blog.sb2.fr/pingback.axd</pingback:server>
      <pingback:target>http://blog.sb2.fr/post.aspx?id=9e573a6d-b5cc-4399-8352-50ccb360c37d</pingback:target>
      <slash:comments>14</slash:comments>
      <trackback:ping>http://blog.sb2.fr/trackback.axd?id=9e573a6d-b5cc-4399-8352-50ccb360c37d</trackback:ping>
      <wfw:comment>http://blog.sb2.fr/post/2008/12/29/DotNetKicks-and-AddToAny-Buttons-Extension-For-BlogEngine.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.sb2.fr/syndication.axd?post=9e573a6d-b5cc-4399-8352-50ccb360c37d</wfw:commentRss>
    </item>
    <item>
      <title>How-To Get Human Friendly File Size With C#</title>
      <description>&lt;p&gt;Hi,&lt;/p&gt;  &lt;p&gt;In this article I’ll provide a simple way to Display Human Friendly File Sizes with C#.&lt;/p&gt;  &lt;p&gt;In order to do that I created a simple Class Called &lt;strong&gt;FriendlySize&lt;/strong&gt;.&lt;/p&gt;  &lt;h3&gt;FriendlySize&lt;/h3&gt;  &lt;div class="csharpcode-wrapper"&gt;   &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; FriendlySize
{
    &lt;span class="preproc"&gt;#region&lt;/span&gt; Private Fields

    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;long&lt;/span&gt; _length;
    &lt;span class="kwrd"&gt;private&lt;/span&gt; String[] _sizes = { &lt;span class="str"&gt;&amp;quot;B&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;KB&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;MB&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;GB&amp;quot;&lt;/span&gt; };

    &lt;span class="preproc"&gt;#endregion&lt;/span&gt;

    &lt;span class="preproc"&gt;#region&lt;/span&gt; Constructors

    &lt;span class="kwrd"&gt;public&lt;/span&gt; FriendlySize(FileInfo file)
    {
        _length = file.Length;
    }
    &lt;span class="kwrd"&gt;public&lt;/span&gt; FriendlySize(String file)
        : &lt;span class="kwrd"&gt;this&lt;/span&gt;(&lt;span class="kwrd"&gt;new&lt;/span&gt; FileInfo(file))
    {
    }
    &lt;span class="kwrd"&gt;public&lt;/span&gt; FriendlySize(&lt;span class="kwrd"&gt;long&lt;/span&gt; size)
    {
        _length = size;
    }

    &lt;span class="preproc"&gt;#endregion&lt;/span&gt;

    &lt;span class="preproc"&gt;#region&lt;/span&gt; Public Overrides Methods

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; ToString()
    {
        &lt;span class="kwrd"&gt;double&lt;/span&gt; len = _length;
        &lt;span class="kwrd"&gt;int&lt;/span&gt; order = 0;
        &lt;span class="kwrd"&gt;while&lt;/span&gt; (len &amp;gt;= 1024 &amp;amp;&amp;amp; order + 1 &amp;lt; _sizes.Length)
        {
            order++;
            len = len / 1024;
        }
        &lt;span class="kwrd"&gt;return&lt;/span&gt; String.Format(&lt;span class="str"&gt;&amp;quot;{0:0.##} {1}&amp;quot;&lt;/span&gt;, len, _sizes[order]);
    }

    &lt;span class="preproc"&gt;#endregion&lt;/span&gt;
}&lt;/pre&gt;
&lt;/div&gt;

&lt;h3&gt;Sample Usage :&lt;/h3&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;string&lt;/span&gt; path = &lt;span class="str"&gt;@&amp;quot;C:\test.zip&amp;quot;&lt;/span&gt;;
FriendlySize size = &lt;span class="kwrd"&gt;new&lt;/span&gt; FriendlySize(path);
Console.WriteLine(size);&lt;/pre&gt;
&lt;/div&gt;

&lt;h3&gt;Output :&lt;/h3&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;1,17 KB&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Hope this help’s!.&lt;/p&gt;</description>
      <link>http://blog.sb2.fr/post/2008/12/29/How-To-Get-Human-Friendly-File-Size-With-C.aspx</link>
      <author>yb.nospam@nospam.sb2.fr (xTC)</author>
      <comments>http://blog.sb2.fr/post/2008/12/29/How-To-Get-Human-Friendly-File-Size-With-C.aspx#comment</comments>
      <guid>http://blog.sb2.fr/post.aspx?id=cac0e2d4-3d27-4793-ad89-d4b53184df8b</guid>
      <pubDate>Mon, 29 Dec 2008 17:03:46 +0200</pubDate>
      <category>C#</category>
      <dc:publisher>xTC</dc:publisher>
      <pingback:server>http://blog.sb2.fr/pingback.axd</pingback:server>
      <pingback:target>http://blog.sb2.fr/post.aspx?id=cac0e2d4-3d27-4793-ad89-d4b53184df8b</pingback:target>
      <slash:comments>3</slash:comments>
      <trackback:ping>http://blog.sb2.fr/trackback.axd?id=cac0e2d4-3d27-4793-ad89-d4b53184df8b</trackback:ping>
      <wfw:comment>http://blog.sb2.fr/post/2008/12/29/How-To-Get-Human-Friendly-File-Size-With-C.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.sb2.fr/syndication.axd?post=cac0e2d4-3d27-4793-ad89-d4b53184df8b</wfw:commentRss>
    </item>
    <item>
      <title>Useful HttpResponse Extension Methods</title>
      <description>&lt;p&gt;Hi,&lt;/p&gt;  &lt;p&gt;In this article a few useful Extension Methods for HttpResponse. &lt;/p&gt;  &lt;p&gt;We often need to Write something to Response with New Line at the End or Switch Current Response to Ssl Mode.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Instread of using :&lt;/strong&gt;&lt;/p&gt;  &lt;div class="csharpcode-wrapper"&gt;   &lt;pre class="csharpcode"&gt;Response.Write(&lt;span class="str"&gt;&amp;quot;Something&amp;lt;br/&amp;gt;&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;/div&gt;

&lt;h3&gt;Response.WriteLine&lt;/h3&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; WriteLine(&lt;span class="kwrd"&gt;this&lt;/span&gt; HttpResponse response, Char o)
{
    response.Write(String.Concat(o, &lt;span class="str"&gt;&amp;quot;&amp;lt;br/&amp;gt;&amp;quot;&lt;/span&gt;));
}
&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; WriteLine(&lt;span class="kwrd"&gt;this&lt;/span&gt; HttpResponse response, String o)
{
    response.Write(String.Concat(o, &lt;span class="str"&gt;&amp;quot;&amp;lt;br/&amp;gt;&amp;quot;&lt;/span&gt;));
}
&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; WriteLine(&lt;span class="kwrd"&gt;this&lt;/span&gt; HttpResponse response, Object o)
{
    response.Write(String.Concat(o.ToString(), &lt;span class="str"&gt;&amp;quot;&amp;lt;br/&amp;gt;&amp;quot;&lt;/span&gt;));
}&lt;/pre&gt;
&lt;/div&gt;

&lt;h3&gt;Response.SwitchToSsl&lt;/h3&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; SwitchToSsl(&lt;span class="kwrd"&gt;this&lt;/span&gt; HttpResponse response)
{
    String baseUrl = HttpContext.Current.Request.Url.OriginalString;
    Uri uri = &lt;span class="kwrd"&gt;new&lt;/span&gt; Uri(baseUrl);
    String url = baseUrl.Replace(uri.Scheme, Uri.UriSchemeHttps);
    response.Redirect(url, &lt;span class="kwrd"&gt;true&lt;/span&gt;);
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Hope this help’s.&lt;/p&gt;</description>
      <link>http://blog.sb2.fr/post/2008/12/29/Useful-HttpResponse-Extension-Methods.aspx</link>
      <author>yb.nospam@nospam.sb2.fr (xTC)</author>
      <comments>http://blog.sb2.fr/post/2008/12/29/Useful-HttpResponse-Extension-Methods.aspx#comment</comments>
      <guid>http://blog.sb2.fr/post.aspx?id=ab590060-b771-4768-b97c-26b0484568b8</guid>
      <pubDate>Mon, 29 Dec 2008 15:58:43 +0200</pubDate>
      <category>ASP.NET</category>
      <dc:publisher>xTC</dc:publisher>
      <pingback:server>http://blog.sb2.fr/pingback.axd</pingback:server>
      <pingback:target>http://blog.sb2.fr/post.aspx?id=ab590060-b771-4768-b97c-26b0484568b8</pingback:target>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://blog.sb2.fr/trackback.axd?id=ab590060-b771-4768-b97c-26b0484568b8</trackback:ping>
      <wfw:comment>http://blog.sb2.fr/post/2008/12/29/Useful-HttpResponse-Extension-Methods.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.sb2.fr/syndication.axd?post=ab590060-b771-4768-b97c-26b0484568b8</wfw:commentRss>
    </item>
    <item>
      <title>Pluggable Generic ASP.NET Cache Manager</title>
      <description>&lt;p&gt;Hi,&lt;/p&gt;  &lt;p&gt;In this article I’ll provide a simple way in order to build a Pluggable Generic ASP.NET Cache Manager.&lt;/p&gt;  &lt;p&gt;I based my article on the &lt;a href="http://john-sheehan.com/blog/pluggable-aspnet-cachemanager/" target="_blank"&gt;John Sheehan article&lt;/a&gt; who make a pretty great work and Added Some Features to this Pluggable Cache Manager&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Thread Safe Singleton &lt;/li&gt;    &lt;li&gt;Multiple Cache Providers Support &lt;/li&gt;    &lt;li&gt;Multiple Cache Provider Instances &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;We often need to store and retrieve Cache Items, but there is a lot of Caching way : Cache, Session, Memcached, Velocity etc…&lt;/p&gt;  &lt;p&gt;The is the “Magic” Interface which only provide 3 common methods&lt;/p&gt;  &lt;div class="csharpcode-wrapper"&gt;   &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;interface&lt;/span&gt; ICacheProvider
{
    &lt;span class="kwrd"&gt;void&lt;/span&gt; Save&amp;lt;T&amp;gt;(String key, T data);
    &lt;span class="kwrd"&gt;void&lt;/span&gt; Remove(String key);
    T Get&amp;lt;T&amp;gt;(String key);
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Now the Implementation of the Cache Manager which will allow us to Register and Get Cache Providers.&lt;/p&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; CacheManager
{
    &lt;span class="preproc"&gt;#region&lt;/span&gt; Private Static Fields

    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; Dictionary&amp;lt;String, ICacheProvider&amp;gt; _providers;
    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; ReaderWriterLockSlim _lock;

    &lt;span class="preproc"&gt;#endregion&lt;/span&gt;

    &lt;span class="preproc"&gt;#region&lt;/span&gt; Singleton

    &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;readonly&lt;/span&gt; CacheManager instance = &lt;span class="kwrd"&gt;new&lt;/span&gt; CacheManager();

    &lt;span class="kwrd"&gt;static&lt;/span&gt; CacheManager()
    {
        _providers = &lt;span class="kwrd"&gt;new&lt;/span&gt; Dictionary&amp;lt;String, ICacheProvider&amp;gt;();
        _lock = &lt;span class="kwrd"&gt;new&lt;/span&gt; ReaderWriterLockSlim();
    }

    CacheManager()
    {
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; CacheManager Instance
    {
        get
        {
            &lt;span class="kwrd"&gt;return&lt;/span&gt; instance;
        }
    }

    &lt;span class="preproc"&gt;#endregion&lt;/span&gt;

    &lt;span class="preproc"&gt;#region&lt;/span&gt; Public Methods

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; RegisterCacheManager&amp;lt;T&amp;gt;(String cacheName) &lt;span class="kwrd"&gt;where&lt;/span&gt; T : ICacheProvider, &lt;span class="kwrd"&gt;new&lt;/span&gt;()
    {
        _lock.EnterUpgradeableReadLock();
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (!_providers.ContainsKey(cacheName))
        {
            _lock.EnterWriteLock();

            T provider = &lt;span class="kwrd"&gt;new&lt;/span&gt; T();
            _providers.Add(cacheName, provider);

            _lock.ExitWriteLock();
        }
        _lock.ExitUpgradeableReadLock();
    }
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; RegisterCacheManager&amp;lt;T&amp;gt;() &lt;span class="kwrd"&gt;where&lt;/span&gt; T : ICacheProvider, &lt;span class="kwrd"&gt;new&lt;/span&gt;()
    {
        RegisterCacheManager&amp;lt;T&amp;gt;(&lt;span class="kwrd"&gt;typeof&lt;/span&gt;(T).Name);
    }
    &lt;span class="kwrd"&gt;public&lt;/span&gt; T GetCacheManager&amp;lt;T&amp;gt;() &lt;span class="kwrd"&gt;where&lt;/span&gt; T : ICacheProvider
    {
        &lt;span class="kwrd"&gt;return&lt;/span&gt; GetCacheManager&amp;lt;T&amp;gt;(&lt;span class="kwrd"&gt;typeof&lt;/span&gt;(T).Name);
    }
    &lt;span class="kwrd"&gt;public&lt;/span&gt; T GetCacheManager&amp;lt;T&amp;gt;(String cacheName) &lt;span class="kwrd"&gt;where&lt;/span&gt; T : ICacheProvider
    {
        T provider = &lt;span class="kwrd"&gt;default&lt;/span&gt;(T);

        _lock.EnterUpgradeableReadLock();
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (_providers.ContainsKey(cacheName))
        {
            provider = (T)_providers[cacheName];
        }
        &lt;span class="kwrd"&gt;else&lt;/span&gt;
        {
            &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; Exception(&lt;span class="str"&gt;&amp;quot;Unable to Locate Cache Manager&amp;quot;&lt;/span&gt;);
        }
        _lock.ExitUpgradeableReadLock();

        &lt;span class="kwrd"&gt;return&lt;/span&gt; provider;
    }

    &lt;span class="preproc"&gt;#endregion&lt;/span&gt;
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;We have now the ICacheProvider interface and our CacheManager. Now let’s implements a simple CacheProvider for ASP.NET&lt;/p&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; MyCacheProvider : ICacheProvider
{
    &lt;span class="preproc"&gt;#region&lt;/span&gt; ICacheProvider Members

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Save&amp;lt;T&amp;gt;(&lt;span class="kwrd"&gt;string&lt;/span&gt; key, T data)
    {
        HttpContext.Current.Items.Add(key, data);
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Remove(&lt;span class="kwrd"&gt;string&lt;/span&gt; key)
    {
        HttpContext.Current.Items.Remove(key);
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; T Get&amp;lt;T&amp;gt;(&lt;span class="kwrd"&gt;string&lt;/span&gt; key)
    {
        T data = &lt;span class="kwrd"&gt;default&lt;/span&gt;(T);
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (HttpContext.Current.Items[key] != &lt;span class="kwrd"&gt;null&lt;/span&gt;)
        {
            data = (T)HttpContext.Current.Items[key];
        }
        &lt;span class="kwrd"&gt;return&lt;/span&gt; data;
    }

    &lt;span class="preproc"&gt;#endregion&lt;/span&gt;
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;We can now Register it in the CacheManager, Global.asax should be a great place for that.&lt;/p&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Application_Start(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, EventArgs e)
{
    &lt;span class="rem"&gt;// Register Default Cache&lt;/span&gt;
    CacheManager.Instance.RegisterCacheManager&amp;lt;MyCacheProvider&amp;gt;();

    &lt;span class="rem"&gt;// Register Configuration Cache&lt;/span&gt;
    CacheManager.Instance.RegisterCacheManager&amp;lt;MyCacheProvider&amp;gt;(&lt;span class="str"&gt;&amp;quot;Configuration&amp;quot;&lt;/span&gt;);
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;So, we have created our Custom Cache Provider and Registered it into the Cache Manager. Now let’s use it in a sample web page.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Using Default Cache&lt;/strong&gt;&lt;/p&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; _Default : Page
{
    &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; OnLoad(EventArgs e)
    {
        &lt;span class="rem"&gt;// Get Default Cache Provider&lt;/span&gt;
        MyCacheProvider DefaultCache = CacheManager.Instance.GetCacheManager&amp;lt;MyCacheProvider&amp;gt;();

        &lt;span class="rem"&gt;// Save something to the Cache&lt;/span&gt;
        DefaultCache.Save(&lt;span class="str"&gt;&amp;quot;MyKey&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;Hello !&amp;quot;&lt;/span&gt;);

        &lt;span class="rem"&gt;// Retrieve the Saved Value From Cache&lt;/span&gt;
        String s = DefaultCache.Get&amp;lt;String&amp;gt;(&lt;span class="str"&gt;&amp;quot;MyKey&amp;quot;&lt;/span&gt;);
        Response.Write(s);

        &lt;span class="rem"&gt;// Remove the Item from Cache&lt;/span&gt;
        DefaultCache.Remove(&lt;span class="str"&gt;&amp;quot;MyKey&amp;quot;&lt;/span&gt;);

        &lt;span class="kwrd"&gt;base&lt;/span&gt;.OnLoad(e);
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Using Configuration Cache&lt;/strong&gt;&lt;/p&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; _Default : Page
{
    &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; OnLoad(EventArgs e)
    {
        &lt;span class="rem"&gt;// Get Configuration Cache Provider&lt;/span&gt;
        MyCacheProvider ConfigCache = CacheManager.Instance.GetCacheManager&amp;lt;MyCacheProvider&amp;gt;(&lt;span class="str"&gt;&amp;quot;Configuration&amp;quot;&lt;/span&gt;);

        &lt;span class="rem"&gt;// Save something to the Cache&lt;/span&gt;
        ConfigCache.Save(&lt;span class="str"&gt;&amp;quot;MyKey&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;My Config Value&amp;quot;&lt;/span&gt;);

        &lt;span class="rem"&gt;// Retrieve the Saved Value From Cache&lt;/span&gt;
        String s = ConfigCache.Get&amp;lt;String&amp;gt;(&lt;span class="str"&gt;&amp;quot;MyKey&amp;quot;&lt;/span&gt;);
        Response.Write(s);

        &lt;span class="rem"&gt;// Remove the Item from Cache&lt;/span&gt;
        ConfigCache.Remove(&lt;span class="str"&gt;&amp;quot;MyKey&amp;quot;&lt;/span&gt;);

        &lt;span class="kwrd"&gt;base&lt;/span&gt;.OnLoad(e);
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Hope this will helpful :)&lt;/p&gt;</description>
      <link>http://blog.sb2.fr/post/2008/12/28/Pluggable-Generic-ASPNET-Cache-Manager.aspx</link>
      <author>yb.nospam@nospam.sb2.fr (xTC)</author>
      <comments>http://blog.sb2.fr/post/2008/12/28/Pluggable-Generic-ASPNET-Cache-Manager.aspx#comment</comments>
      <guid>http://blog.sb2.fr/post.aspx?id=8b5b59b4-c3f4-47d9-9e4e-94cac71e2cc1</guid>
      <pubDate>Sun, 28 Dec 2008 01:52:48 +0200</pubDate>
      <category>ASP.NET</category>
      <dc:publisher>xTC</dc:publisher>
      <pingback:server>http://blog.sb2.fr/pingback.axd</pingback:server>
      <pingback:target>http://blog.sb2.fr/post.aspx?id=8b5b59b4-c3f4-47d9-9e4e-94cac71e2cc1</pingback:target>
      <slash:comments>45</slash:comments>
      <trackback:ping>http://blog.sb2.fr/trackback.axd?id=8b5b59b4-c3f4-47d9-9e4e-94cac71e2cc1</trackback:ping>
      <wfw:comment>http://blog.sb2.fr/post/2008/12/28/Pluggable-Generic-ASPNET-Cache-Manager.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.sb2.fr/syndication.axd?post=8b5b59b4-c3f4-47d9-9e4e-94cac71e2cc1</wfw:commentRss>
    </item>
    <item>
      <title>Avoiding Busby SEO Test Comment Spamming For BlogEngine</title>
      <description>&lt;p&gt;Hi,&lt;/p&gt;  &lt;p&gt;Not very sure what is the &lt;strong&gt;Busby SEO Test Project&lt;/strong&gt;, but it seems to be a f***** project for Blog Comment Spamming.&lt;/p&gt;  &lt;p&gt;I’ve a lot of no sense spam comments on my blog... But I don’t want to moderate Comments, just block these spammers.&lt;/p&gt;  &lt;p&gt;Here is a simple way to avoid them to post spam comments for BlogEngine.&lt;/p&gt;  &lt;p&gt;Just Add the Following Lines in the &lt;strong&gt;“~/User Controls/CommentView.ascx”&lt;/strong&gt; Code Behind.&lt;/p&gt;  &lt;div class="csharpcode-wrapper"&gt;   &lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;// Block Busby SPAMMERS&lt;/span&gt;
&lt;span class="kwrd"&gt;if&lt;/span&gt; (comment.Author.ToUpperInvariant().Contains(&lt;span class="str"&gt;&amp;quot;BUSBY&amp;quot;&lt;/span&gt;)
    || comment.Author.ToUpperInvariant().Contains(&lt;span class="str"&gt;&amp;quot;SEO&amp;quot;&lt;/span&gt;))
{
    &lt;span class="kwrd"&gt;return&lt;/span&gt;;
}
&lt;span class="rem"&gt;//&lt;/span&gt;

&lt;span class="kwrd"&gt;if&lt;/span&gt; (!isPreview)
{
    Post.AddComment(comment);
    SetCookie(author, email, website, country);
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Hope this Helps!.&lt;/p&gt;</description>
      <link>http://blog.sb2.fr/post/2008/12/27/Avoiding-Busby-SEO-Test-Comment-Spammer-For-BlogEngine.aspx</link>
      <author>yb.nospam@nospam.sb2.fr (xTC)</author>
      <comments>http://blog.sb2.fr/post/2008/12/27/Avoiding-Busby-SEO-Test-Comment-Spammer-For-BlogEngine.aspx#comment</comments>
      <guid>http://blog.sb2.fr/post.aspx?id=9e6a5a81-d33b-4e22-abb9-2a12988624db</guid>
      <pubDate>Sat, 27 Dec 2008 15:52:06 +0200</pubDate>
      <category>ASP.NET</category>
      <dc:publisher>xTC</dc:publisher>
      <pingback:server>http://blog.sb2.fr/pingback.axd</pingback:server>
      <pingback:target>http://blog.sb2.fr/post.aspx?id=9e6a5a81-d33b-4e22-abb9-2a12988624db</pingback:target>
      <slash:comments>24</slash:comments>
      <trackback:ping>http://blog.sb2.fr/trackback.axd?id=9e6a5a81-d33b-4e22-abb9-2a12988624db</trackback:ping>
      <wfw:comment>http://blog.sb2.fr/post/2008/12/27/Avoiding-Busby-SEO-Test-Comment-Spammer-For-BlogEngine.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.sb2.fr/syndication.axd?post=9e6a5a81-d33b-4e22-abb9-2a12988624db</wfw:commentRss>
    </item>
    <item>
      <title>Dealing With Enterprise Library Injection Policy And Unity IoC</title>
      <description>&lt;p&gt;Hi,&lt;/p&gt;  &lt;p&gt;In this article I’ll provide a Generic Unity Factory Class in order to take advantage of Unity and Injection Policy easily.&lt;/p&gt;  &lt;p&gt;For Example purpose I created a simple Web Application Project and referenced the following assemblies&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Microsoft.Practices.EnterpriseLibrary.Common &lt;/li&gt;    &lt;li&gt;Microsoft.Practices.EnterpriseLibrary.PolicyInjection &lt;/li&gt;    &lt;li&gt;Microsoft.Practices.EnterpriseLibrary.PolicyInjection.CallHandlers &lt;/li&gt;    &lt;li&gt;Microsoft.Practices.EnterpriseLibrary.ObjectBuilder2 &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The goal of this article is to use Unity as an IoC Container and Use Policy Injection provided by Enterprise Library Policy Injection Application Block to handle CachingCallHandler on our Data Access Class Methods.&lt;/p&gt;  &lt;p&gt;Firstly assuming a Book Model Class.&lt;/p&gt;  &lt;div class="csharpcode-wrapper"&gt;   &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Book
{
    &lt;span class="kwrd"&gt;public&lt;/span&gt; Int32 BookId { get; set; }
    &lt;span class="kwrd"&gt;public&lt;/span&gt; String Title { get; set; }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Then the BookDAO&lt;/p&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;interface&lt;/span&gt; IBookDAO
{
    List&amp;lt;Book&amp;gt; GetBooks();
}&lt;/pre&gt;
&lt;/div&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; BookDAO : IBookDAO
{
    [CachingCallHandler(0, 0, 10)]
    &lt;span class="kwrd"&gt;public&lt;/span&gt; List&amp;lt;Book&amp;gt; GetBooks()
    {
        HttpContext.Current.Trace.Warn(&lt;span class="str"&gt;&amp;quot;Called GetBooks from BookDAO.&amp;quot;&lt;/span&gt;);
        &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; List&amp;lt;Book&amp;gt;();
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;For this Example purpose I defined the CachingCallHandler from InjectionPolicy Call Handlers to Expire every 10 seconds and the GetBooks method only Show a Trace Message when Method will be called then returns an empty List of Book.&lt;/p&gt;

&lt;p&gt;Now in my Default.aspx Page I enabled Tracing in order to display BookDAO Message.&lt;/p&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="asp"&gt;&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; AutoEventWireup=&amp;quot;true&amp;quot; Trace=&amp;quot;true&amp;quot; CodeBehind=&amp;quot;Default.aspx.cs&amp;quot; Inherits=&amp;quot;WebApplication9._Default&amp;quot; %&amp;gt;&lt;/span&gt;

&lt;span class="kwrd"&gt;&amp;lt;!&lt;/span&gt;&lt;span class="html"&gt;DOCTYPE&lt;/span&gt; &lt;span class="attr"&gt;html&lt;/span&gt; &lt;span class="attr"&gt;PUBLIC&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;html&lt;/span&gt; &lt;span class="attr"&gt;xmlns&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;head&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;head&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;body&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;form&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;form1&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;form&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;body&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;html&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;So we got our Basic Web Application.&lt;/p&gt;

&lt;p&gt;Now talk about Unity and the UnityFactory Class :)&lt;/p&gt;

&lt;p&gt;The UnityFactory Class use the Singleton Pattern since we only need a single instance of it.&lt;/p&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; UnityFactory&amp;lt;T&amp;gt; &lt;span class="kwrd"&gt;where&lt;/span&gt; T : &lt;span class="kwrd"&gt;class&lt;/span&gt;
{
    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;readonly&lt;/span&gt; UnityFactory&amp;lt;T&amp;gt; instance = &lt;span class="kwrd"&gt;new&lt;/span&gt; UnityFactory&amp;lt;T&amp;gt;();
    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;readonly&lt;/span&gt; IUnityContainer container = &lt;span class="kwrd"&gt;null&lt;/span&gt;;
    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;readonly&lt;/span&gt; List&amp;lt;Object&amp;gt; instances = &lt;span class="kwrd"&gt;new&lt;/span&gt; List&amp;lt;Object&amp;gt;();

    &lt;span class="kwrd"&gt;static&lt;/span&gt; UnityFactory()
    {
        var Config = ConfigurationManager.GetSection(&lt;span class="str"&gt;&amp;quot;unity&amp;quot;&lt;/span&gt;) &lt;span class="kwrd"&gt;as&lt;/span&gt; UnityConfigurationSection;
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (Config != &lt;span class="kwrd"&gt;null&lt;/span&gt; &amp;amp;&amp;amp; Config.Containers.Default != &lt;span class="kwrd"&gt;null&lt;/span&gt;)
        {
            Config.Containers.Default.Configure(container);
        }
        &lt;span class="kwrd"&gt;else&lt;/span&gt;
        {
            container = &lt;span class="kwrd"&gt;new&lt;/span&gt; UnityContainer();
        }
    }

    UnityFactory()
    {
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; T GetObject()
    {
        T o = &lt;span class="kwrd"&gt;default&lt;/span&gt;(T);

        var q = instances.Where(p =&amp;gt; p &lt;span class="kwrd"&gt;is&lt;/span&gt; T);
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (q.Count() &amp;gt; 0)
        {
            o = q.FirstOrDefault() &lt;span class="kwrd"&gt;as&lt;/span&gt; T;
        }
        &lt;span class="kwrd"&gt;else&lt;/span&gt;
        {
            o = container.Resolve&amp;lt;T&amp;gt;();
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (o != &lt;span class="kwrd"&gt;null&lt;/span&gt;) instances.Add(o);
        }
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (o != &lt;span class="kwrd"&gt;null&lt;/span&gt;)
            o = PolicyInjection.Wrap&amp;lt;T&amp;gt;(o);
        &lt;span class="kwrd"&gt;return&lt;/span&gt; o;
    }
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Register&amp;lt;TConcret&amp;gt;()
    {
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (container != &lt;span class="kwrd"&gt;null&lt;/span&gt;)
        {
            container.RegisterType(&lt;span class="kwrd"&gt;typeof&lt;/span&gt;(T), &lt;span class="kwrd"&gt;typeof&lt;/span&gt;(TConcret));
        }
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Note the GetObject Method : This will firstly check in the Instance Collection if there is an Instance of the Asked Object, if yes return it.&lt;/p&gt;

&lt;p&gt;Otherwise it will try to Resolve it according to the Unity Configuration in Web.config. If there is no configuration in Web.config it will Resolve the Object according to the RegisteredTypes in the Container.&lt;/p&gt;

&lt;p&gt;So in our Web Application we need to Add a Global.asax file in order to register the mapping between the interface IBookDAO and the concret class BookDAO.&lt;/p&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Application_Start(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, EventArgs e)
{
    &lt;span class="rem"&gt;// Register Mapping Between IBookDAO and the Concret Class BookDAO in Unity Container&lt;/span&gt;
    UnityFactory&amp;lt;IBookDAO&amp;gt;.Register&amp;lt;BookDAO&amp;gt;();
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Now we can use the UnityFactory to Inject Dependency of the IBookDao Interface in the Default.aspx Code-Behind.&lt;/p&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; _Default : System.Web.UI.Page
{
    &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; OnLoad(EventArgs e)
    {
        IBookDAO dao = UnityFactory&amp;lt;IBookDAO&amp;gt;.GetObject();
        List&amp;lt;Book&amp;gt; books = dao.GetBooks();
        &lt;span class="kwrd"&gt;base&lt;/span&gt;.OnLoad(e);
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Really simple isn’t it ? :)&lt;/p&gt;

&lt;p&gt;Now take a look at the ASP.NET Trace results&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blog.sb2.fr/image.axd?picture=WindowsLiveWriter/DealingWithEnterpriseLibraryInjectionPol_C20A/image_2.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="173" alt="image" src="http://blog.sb2.fr/image.axd?picture=WindowsLiveWriter/DealingWithEnterpriseLibraryInjectionPol_C20A/image_thumb.png" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;On first Page Call, we got the Trace Message from the BookDAO : “Called GetBooks from BookDAO.”&lt;/p&gt;

&lt;p&gt;The BookDAO.GetBooks() was Called and Cached.&lt;/p&gt;

&lt;p&gt;Now Refresh the Page.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blog.sb2.fr/image.axd?picture=WindowsLiveWriter/DealingWithEnterpriseLibraryInjectionPol_C20A/image_4.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="173" alt="image" src="http://blog.sb2.fr/image.axd?picture=WindowsLiveWriter/DealingWithEnterpriseLibraryInjectionPol_C20A/image_thumb_1.png" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Data are Cached ! There is no Trace Message from BookDAO anymore. If you wait a few second and refresh again the page, the message will reappear since the Cache Expired.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Conclusion : Enterprise Library Policy Injection is a pretty good way in order to simply Manage Cache Policies and moreover taking Advantage of Unity IoC for Dependencies Injection.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Hope this help’s!&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;div class="wlWriterEditableSmartContent" id="scid:8eb9d37f-1541-4f29-b6f4-1eea890d4876:d767f42c-429b-488b-8b58-3444c6efe549" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;p&gt;&lt;div&gt;&lt;a href="http://blog.sb2.fr/file.axd?file=WindowsLiveWriter/DealingWithEnterpriseLibraryInjectionPol_C20A/WebApplication9.rar" target="_self"&gt;WebApplication9.rar&lt;/a&gt;&lt;/div&gt;&lt;/p&gt;&lt;/div&gt;

&lt;p&gt;More Informations :&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.codeplex.com/entlib" target="_blank"&gt;http://www.codeplex.com/entlib&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.codeplex.com/unity" target="_blank"&gt;http://www.codeplex.com/unity&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://blog.sb2.fr/post/2008/12/26/Dealing-With-Enterprise-Library-Injection-Policy-And-Unity-IoC.aspx</link>
      <author>yb.nospam@nospam.sb2.fr (xTC)</author>
      <comments>http://blog.sb2.fr/post/2008/12/26/Dealing-With-Enterprise-Library-Injection-Policy-And-Unity-IoC.aspx#comment</comments>
      <guid>http://blog.sb2.fr/post.aspx?id=ecf39950-21a1-4e8a-9bea-dcd9571bb10b</guid>
      <pubDate>Fri, 26 Dec 2008 14:10:31 +0200</pubDate>
      <category>ASP.NET</category>
      <category>C#</category>
      <dc:publisher>xTC</dc:publisher>
      <pingback:server>http://blog.sb2.fr/pingback.axd</pingback:server>
      <pingback:target>http://blog.sb2.fr/post.aspx?id=ecf39950-21a1-4e8a-9bea-dcd9571bb10b</pingback:target>
      <slash:comments>4</slash:comments>
      <trackback:ping>http://blog.sb2.fr/trackback.axd?id=ecf39950-21a1-4e8a-9bea-dcd9571bb10b</trackback:ping>
      <wfw:comment>http://blog.sb2.fr/post/2008/12/26/Dealing-With-Enterprise-Library-Injection-Policy-And-Unity-IoC.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.sb2.fr/syndication.axd?post=ecf39950-21a1-4e8a-9bea-dcd9571bb10b</wfw:commentRss>
    </item>
    <item>
      <title>Generic EventHandler Raising Extension Method</title>
      <description>&lt;p&gt;Hi,&lt;/p&gt;  &lt;p&gt;Raising EventHandlers is a repetitive task in .NET Development. But this can be improved with C# 3 Feature with Extension Methods.&lt;/p&gt;  &lt;p&gt;Actually you need to do the following :&lt;/p&gt;  &lt;div class="csharpcode-wrapper"&gt;   &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;event&lt;/span&gt; EventHandler&amp;lt;EventArgs&amp;gt; MyEventHandler;
 
&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; DoSomething()
{
    var e = MyEventHandler;
    &lt;span class="kwrd"&gt;if&lt;/span&gt;(e != &lt;span class="kwrd"&gt;null&lt;/span&gt;)
    {
        e(&lt;span class="kwrd"&gt;this&lt;/span&gt;, &lt;span class="kwrd"&gt;new&lt;/span&gt; EventArgs());
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;In order to avoid this repetitive Task, my friend &lt;a href="http://brianc.me/blog/" target="_blank"&gt;Brian&lt;/a&gt; on this &lt;a href="http://brianc.me/blog/event-raising-and-dry-extension-method/" target="_blank"&gt;blog post&lt;/a&gt; talked about a useful Extension Method.&lt;/p&gt;

&lt;h3&gt;Generic EventArgs EventHandler&lt;/h3&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Raise&amp;lt;TEventArgs&amp;gt;(&lt;span class="kwrd"&gt;this&lt;/span&gt; EventHandler&amp;lt;TEventArgs&amp;gt; eventHandler, Object sender, TEventArgs args)
{
    var e = eventHandler;
    &lt;span class="kwrd"&gt;if&lt;/span&gt; (e != &lt;span class="kwrd"&gt;null&lt;/span&gt;)
    {
        e(sender, args);
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;However he didn’t provide a standard EventHandler EventArgs-less Implementation of the Extension Method.&lt;/p&gt;

&lt;p&gt;Here is the Code.&lt;/p&gt;

&lt;h3&gt;Standard EventHandler&lt;/h3&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Raise(&lt;span class="kwrd"&gt;this&lt;/span&gt; EventHandler eventHandler, Object sender)
{
    var e = eventHandler;
    &lt;span class="kwrd"&gt;if&lt;/span&gt; (e != &lt;span class="kwrd"&gt;null&lt;/span&gt;)
    {
        e(sender, &lt;span class="kwrd"&gt;null&lt;/span&gt;);
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Hope this help’s!&lt;/p&gt;</description>
      <link>http://blog.sb2.fr/post/2008/12/25/Generic-EventHandler-Raising-Extension-Method.aspx</link>
      <author>yb.nospam@nospam.sb2.fr (xTC)</author>
      <comments>http://blog.sb2.fr/post/2008/12/25/Generic-EventHandler-Raising-Extension-Method.aspx#comment</comments>
      <guid>http://blog.sb2.fr/post.aspx?id=c3f4b75a-8bfe-4d0c-a5f4-770512569137</guid>
      <pubDate>Thu, 25 Dec 2008 22:51:09 +0200</pubDate>
      <category>C#</category>
      <dc:publisher>xTC</dc:publisher>
      <pingback:server>http://blog.sb2.fr/pingback.axd</pingback:server>
      <pingback:target>http://blog.sb2.fr/post.aspx?id=c3f4b75a-8bfe-4d0c-a5f4-770512569137</pingback:target>
      <slash:comments>6</slash:comments>
      <trackback:ping>http://blog.sb2.fr/trackback.axd?id=c3f4b75a-8bfe-4d0c-a5f4-770512569137</trackback:ping>
      <wfw:comment>http://blog.sb2.fr/post/2008/12/25/Generic-EventHandler-Raising-Extension-Method.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.sb2.fr/syndication.axd?post=c3f4b75a-8bfe-4d0c-a5f4-770512569137</wfw:commentRss>
    </item>
    <item>
      <title>Useful ASP.NET Videos And WebCasts</title>
      <description>&lt;p&gt;Hi,&lt;/p&gt;  &lt;p&gt;Today a pretty big list of some useful Videos and WebCasts talking about ASP.NET.&lt;/p&gt;  &lt;h3&gt;Beginning with ASP.NET&lt;/h3&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-14.aspx" target="_blank"&gt;Getting Started with Visual Web Developer Express&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-13.aspx" target="_blank"&gt;Creating a Web Forms User Interface&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-12.aspx" target="_blank"&gt;Understanding More about Events and Postback&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-11.aspx" target="_blank"&gt;Understanding&amp;#160; Web Application State&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-10.aspx" target="_blank"&gt;Debugging and Tracing Your WebSite&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-09.aspx" target="_blank"&gt;Working with Stylesheets and Master Pages&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-08.aspx" target="_blank"&gt;Databinding to User Interface Controls&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-07.aspx" target="_blank"&gt;Working with the GridView and FormView&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-06.aspx" target="_blank"&gt;Securing your Web Site with Membership and Login Controls&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-05.aspx" target="_blank"&gt;Configuring, Building and Deploying a Web Site&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-04.aspx" target="_blank"&gt;Building a Quiz Engine (Part 1)&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-03.aspx" target="_blank"&gt;Building a Quiz Engine (Part 2)&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-02.aspx" target="_blank"&gt;Building a Quiz Engine (Part 3)&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-01.aspx" target="_blank"&gt;Building a Quiz Engine (Part 4)&lt;/a&gt; &lt;/li&gt; &lt;/ol&gt;  &lt;h3&gt;So Far With ASP.NET&lt;/h3&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-39.aspx" target="_blank"&gt;Learn the Tips and Tricks of Experts&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-40.aspx" target="_blank"&gt;Create a Multi-Lingual Site with Localization&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-42.aspx" target="_blank"&gt;Make use of Caching&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-41.aspx" target="_blank"&gt;Make Greater use of Caching&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-43.aspx" target="_blank"&gt;Utilize Web Parts and Personalization&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-44.aspx" target="_blank"&gt;Customize my Site with Profiles and Themes&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-45.aspx" target="_blank"&gt;Secure my Site using Membership and Roles&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-46.aspx" target="_blank"&gt;Create a “Contact Us” Page&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-47.aspx" target="_blank"&gt;Create a Full Featured Customer Login Portal&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-48.aspx" target="_blank"&gt;Use Master Pages and Site Navigation&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-49.aspx" target="_blank"&gt;Create Data Driven Web Sites&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-147.aspx" target="_blank"&gt;Implement an HttpModule&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-148.aspx" target="_blank"&gt;Setup the SQL Membership Provider&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-154.aspx" target="_blank"&gt;Implement URL Rewriting by Hand&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-185.aspx" target="_blank"&gt;Utilize the CSS Friendly Control Adapters&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-187.aspx" target="_blank"&gt;Handle Application Events using an HttpModule&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-188.aspx" target="_blank"&gt;Use CSS for Web Page Layout&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-189.aspx" target="_blank"&gt;Create a Custom Membership Provider&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-190.aspx" target="_blank"&gt;Create a Custom Profile Provider&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-192.aspx" target="_blank"&gt;Implement Site Navigation in ASP.NET&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-193.aspx" target="_blank"&gt;Use Validation Controls in ASP.NET&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-194.aspx" target="_blank"&gt;Create a Custom User Control in ASP.NET&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-195.aspx" target="_blank"&gt;Implement Health Monitoring for an ASP.NET Application&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-196.aspx" target="_blank"&gt;Implement Tracing in ASP.NET&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-236.aspx" target="_blank"&gt;Event Handlers in ASP.NET Web Pages and Controls&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-255.aspx" target="_blank"&gt;Simple File Uploads in ASP.NET&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-252.aspx" target="_blank"&gt;Multiple File Uploads in ASP.NET (Part 1)&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-253.aspx" target="_blank"&gt;Multiple File Uploads in ASP.NET (Part 2)&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-254.aspx" target="_blank"&gt;File Upload with an Ajax Style Interface&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-265.aspx" target="_blank"&gt;Work with Master Page Declaratively and Programmatically&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-266.aspx" target="_blank"&gt;Handle Events in Master and Content Pages&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-267.aspx" target="_blank"&gt;Use the ObjectDataSource with a Data Access Class and Business Object&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-274.aspx" target="_blank"&gt;Create User Selectable Themes for a Web Site&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-275.aspx" target="_blank"&gt;Share Data Between Client JavaScript and Server Code Using a Hidden Field&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-276.aspx" target="_blank"&gt;Add JavaScript to an ASP.NET Page&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-279.aspx" target="_blank"&gt;Add JavaScript Event Handlers to ASP.NET Server Controls&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-280.aspx" target="_blank"&gt;Create and Call a Simple Web Service in ASP.NET&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-281.aspx" target="_blank"&gt;Deploy a Web Site Using the Copy Web Site Tool&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-284.aspx" target="_blank"&gt;Create and Use a Custom Configuration Section in an ASP.NET Configuration File&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-287.aspx" target="_blank"&gt;Configure an ASP.NET Web Site for a .NET Framework Version&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-288.aspx" target="_blank"&gt;Use the ASP.NET IIS Registration Tool to Configure ASP.NET&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-297.aspx" target="_blank"&gt;Extend and Customize an ASP.NET Server Control for a Specific Purpose&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-298.aspx" target="_blank"&gt;Use the Ability to Create Groups with the ListView Control for Different Data&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-501.aspx" target="_blank"&gt;Make HTML Elements Accessible from Server Side Code&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-502.aspx" target="_blank"&gt;Use Roles to Segment Functionality in an ASP.NET Web Site&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-367.aspx" target="_blank"&gt;Work with Nested Master Pages to Create Standard Content Layouts&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-368.aspx" target="_blank"&gt;Detect Browser Capabilities in ASP.NET Web Pages&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-369.aspx" target="_blank"&gt;Map an ASP.NET Server Control to the Adaptor Used to Render It&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-370.aspx" target="_blank"&gt;Pass Information From One Page to Another using the Query String&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-371.aspx" target="_blank"&gt;Use the aspnet_merge.exe Utility to Merge Assemblies&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-375.aspx" target="_blank"&gt;Implement a Cross Page PostBack in ASP.NET&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-383.aspx" target="_blank"&gt;Add Controls to an ASP.NET Web Page Programmatically&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-384.aspx" target="_blank"&gt;Use a Hidden Field to Store and Manipulate Client-Side Information&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-385.aspx" target="_blank"&gt;Use the Fixednames Option with the Compiler Utility for Maximum Flexibility&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-386.aspx" target="_blank"&gt;Implement Command Buttons for Individuals Items&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-393.aspx" target="_blank"&gt;Use Skins with CSS for a Flexible and Maintainable ASP.NET Web Site&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-410.aspx" target="_blank"&gt;Determine wheter to use a web site or a web application project&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-415.aspx" target="_blank"&gt;Write Web Events to a SQL Server Database using the SqlWebEventProvider&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-416.aspx" target="_blank"&gt;Use ASP.NET to Send Email from a Web Site&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-417.aspx" target="_blank"&gt;Configure Email notification for Health monitoring on an ASP.NET Web Site&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-418.aspx" target="_blank"&gt;Use a Visual Studio 2008 Web Deployment Project&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-419.aspx" target="_blank"&gt;Send Templated Emails for Health Monitoring Events&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-420.aspx" target="_blank"&gt;Send Email Asynchronously&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-439.aspx" target="_blank"&gt;Embed an Image in an Email with ASP.NET&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-440.aspx" target="_blank"&gt;Implement Error Handling when Sending Email&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-441.aspx" target="_blank"&gt;Create a Custom Provider for Logging Health Monitoring Events&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-442.aspx" target="_blank"&gt;Create a Reusable Component for Sending Email to a Distribution List&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-447.aspx" target="_blank"&gt;Precompile an ASP.NET Website&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net/learn/videos/video-448.aspx" target="_blank"&gt;Use the FtpWebRequest Class to Create an FTP Connection to a FTP Server&lt;/a&gt; &lt;/li&gt; &lt;/ol&gt;  &lt;h3&gt;Advanced ASP.NET&lt;/h3&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;a href="http://channel9.msdn.com/pdc2008/PC31/" target="_blank"&gt;ASP.NET and JQuery&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://channel9.msdn.com/pdc2008/PC32/" target="_blank"&gt;ASP.NET AJAX Futures&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://channel9.msdn.com/pdc2008/PC41/" target="_blank"&gt;ASP.NET: Cache Extensibility&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://channel9.msdn.com/pdc2008/PC30/" target="_blank"&gt;ASP.NET Dynamic Data&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://channel9.msdn.com/pdc2008/ES06/" target="_blank"&gt;Developing with Microsoft .NET and ASP.NET for Server Core&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://channel9.msdn.com/posts/TheOliver/ASPNET-AJAX-Browser-History/" target="_blank"&gt;ASP.NET AJAX: Browser History&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://channel9.msdn.com/posts/BomBom/Building-your-own-MemberShipProvider-in-ASPNET-20-and-use-it-in-SharePoint/" target="_blank"&gt;Building your own MemberShipPr…T 2.0 and use it in SharePoint&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://channel9.msdn.com/shows/geekSpeak/geekSpeak-recording-httpHandlers-and-httpModules-with-Chris-Love/" target="_blank"&gt;geekSpeak recording - httpHandlers and httpModules with Chris Love&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://channel9.msdn.com/posts/AndrewDavey/Client-side-Model-View-Presenter/" target="_blank"&gt;Client-side Model-View-Presenter&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://channel9.msdn.com/posts/AdamKinney/Creating-a-Video-Playlist-with-Silverlight-and-ASPNET/" target="_blank"&gt;Creating a Video Playlist with Silverlight and ASP.NET&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://channel9.msdn.com/posts/AdamKinney/Delivering-Parameterized-Silverlight-Content-with-ASPNET/" target="_blank"&gt;Delivering Parameterized Silverlight Content with ASP.NET&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://channel9.msdn.com/posts/NikhilKothari/UpdateControls-UpdateHistory-and-AnimatedUpdatePanel/" target="_blank"&gt;UpdateControls: UpdateHistory and AnimatedUpdatePanel&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://channel9.msdn.com/posts/gduthie/DataBinding-to-a-Web-Service-in-ASPNET-20/" target="_blank"&gt;DataBinding to a Web Service in ASP.NET 2.0&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://channel9.msdn.com/posts/keydet/Enabling-Partial-Page-Updates-with-the-ASPNET-Atlas-UpdatePanel/" target="_blank"&gt;Enabling Partial Page Updates with the ASP.NET “Atlas” UpdatePanel&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://channel9.msdn.com/posts/keydet/AJAX-Enabling-ASPNET-20-Web-Parts-with-quotAtlasquot/" target="_blank"&gt;AJAX Enabling ASP.NET 2.0 Web Parts with &amp;quot;Atlas&amp;quot;&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://channel9.msdn.com/posts/gduthie/Drag-amp-Drop-Databinding-in-ASPNET-20/" target="_blank"&gt;Drag &amp;amp; Drop Databinding in ASP.NET 2.0&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://channel9.msdn.com/posts/trobbins/More-About-Web-Parts-with-ASP-20/" target="_blank"&gt;More About Web Parts with ASP 2.0&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://channel9.msdn.com/posts/trobbins/Setting-up-a-Custom-Membership-Provider/" target="_blank"&gt;Setting up a Custom Membership Provider&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://channel9.msdn.com/shows/Continuum/Oxite/" target="_blank"&gt;Oxite, an ASP.NET MVC based blog&lt;/a&gt; &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Hope this will be Helpful :)&lt;/p&gt;</description>
      <link>http://blog.sb2.fr/post/2008/12/25/Useful-ASPNET-Videos-And-WebCasts.aspx</link>
      <author>yb.nospam@nospam.sb2.fr (xTC)</author>
      <comments>http://blog.sb2.fr/post/2008/12/25/Useful-ASPNET-Videos-And-WebCasts.aspx#comment</comments>
      <guid>http://blog.sb2.fr/post.aspx?id=cbea5410-6ec7-41db-a8e3-8885de272045</guid>
      <pubDate>Thu, 25 Dec 2008 17:59:16 +0200</pubDate>
      <category>ASP.NET</category>
      <dc:publisher>xTC</dc:publisher>
      <pingback:server>http://blog.sb2.fr/pingback.axd</pingback:server>
      <pingback:target>http://blog.sb2.fr/post.aspx?id=cbea5410-6ec7-41db-a8e3-8885de272045</pingback:target>
      <slash:comments>7</slash:comments>
      <trackback:ping>http://blog.sb2.fr/trackback.axd?id=cbea5410-6ec7-41db-a8e3-8885de272045</trackback:ping>
      <wfw:comment>http://blog.sb2.fr/post/2008/12/25/Useful-ASPNET-Videos-And-WebCasts.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.sb2.fr/syndication.axd?post=cbea5410-6ec7-41db-a8e3-8885de272045</wfw:commentRss>
    </item>
    <item>
      <title>BlogEngine.NET Backup Manager</title>
      <description>&lt;p&gt;Hi,&lt;/p&gt;  &lt;p&gt;I wrote a simple Backup Manager for BlogEngine.NET in order to perform some entire Weblog Backups.&lt;/p&gt;  &lt;p&gt;The Following Backup Manager only support &lt;strong&gt;Xml Based DataStore&lt;/strong&gt; at this moment, but I&amp;rsquo;ll improve it to support any Datastore providers.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blog.sb2.fr/image.axd?picture=WindowsLiveWriter/BlogEngine.NETBackupManager_DD0C/image_2.png"&gt;&lt;img style="display: inline; border-width: 0px" src="http://blog.sb2.fr/image.axd?picture=WindowsLiveWriter/BlogEngine.NETBackupManager_DD0C/image_thumb.png" border="0" alt="image" title="image" width="644" height="274" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;h3&gt;Here is the Steps in order to make this working :&lt;/h3&gt;  &lt;p&gt;&amp;nbsp;&lt;/p&gt;  &lt;ul&gt;	   	&lt;li&gt;Put the &amp;ldquo;&lt;strong&gt;Admin/BackupManager&lt;/strong&gt;&amp;rdquo; Folder to your &amp;ldquo;&lt;strong&gt;Admin&lt;/strong&gt;&amp;rdquo; Folder. &lt;/li&gt;    	&lt;li&gt;Put the &amp;ldquo;&lt;strong&gt;App_Code/BackupManager&lt;/strong&gt;&amp;rdquo; Folder to your &amp;ldquo;&lt;strong&gt;App_Code&lt;/strong&gt;&amp;rdquo; Folder &lt;/li&gt;    	&lt;li&gt;Copy the &lt;strong&gt;ICSharpCode.SharpZipLib.dll&lt;/strong&gt; to your &amp;ldquo;&lt;strong&gt;Bin&lt;/strong&gt;&amp;rdquo; Folder &lt;/li&gt;    	&lt;li&gt;Create an Empty &amp;ldquo;&lt;strong&gt;Backups&lt;/strong&gt;&amp;rdquo; Folder into &amp;ldquo;&lt;strong&gt;/App_Data&lt;/strong&gt;&amp;rdquo; &lt;/li&gt;    	&lt;li&gt;Then make the Following changes in &lt;strong&gt;Web.sitemap&lt;/strong&gt; and &lt;strong&gt;Web.config&lt;/strong&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;h3&gt;Web.Sitemap &lt;/h3&gt;  &lt;div class="csharpcode-wrapper"&gt;   &lt;br /&gt;    &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;siteMapNode&lt;/span&gt; &lt;span class="attr"&gt;url&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;~/admin/BackupManager/Default.aspx&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Backup Manager&amp;quot;&lt;/span&gt;  &lt;span class="attr"&gt;description&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;&amp;quot;&lt;/span&gt;  &lt;span class="attr"&gt;roles&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;administrators&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3&gt;Web.Config &lt;/h3&gt;&lt;div class="csharpcode-wrapper"&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;httpHandlers&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;add&lt;/span&gt; &lt;span class="attr"&gt;verb&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;*&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;path&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;backup.axd&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;BackupManager&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;validate&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;false&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;httpHandlers&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Now all should works :)&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;UPDATED :&lt;/strong&gt; The Backup Manager now Displays Backup File Size. &lt;/p&gt;&lt;p&gt;Just Replace &lt;strong&gt;Default.aspx&lt;/strong&gt; and &lt;strong&gt;Default.aspx.cs&lt;/strong&gt; into &amp;ldquo;~/Admin/BackupManager&amp;rdquo;.&lt;/p&gt;&lt;p&gt;&lt;a href="http://blog.sb2.fr/image.axd?picture=WindowsLiveWriter/BlogEngine.NETBackupManager_DD0C/image_6.png"&gt;&lt;img style="display: inline; border-width: 0px; border-color: initial; border-style: initial" src="http://blog.sb2.fr/image.axd?picture=WindowsLiveWriter/BlogEngine.NETBackupManager_DD0C/image_thumb_2.png" border="0" alt="image" title="image" width="644" height="255" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Download It :&lt;/strong&gt;&lt;/p&gt;&lt;div id="scid:8eb9d37f-1541-4f29-b6f4-1eea890d4876:2b69e140-b694-46b4-a216-72614eaa4fcd" class="wlWriterEditableSmartContent" style="display: inline; float: none; padding: 0px; margin: 0px"&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div&gt;&lt;a href="http://blog.sb2.fr/file.axd?file=WindowsLiveWriter/BlogEngine.NETBackupManager_DD0C/BackupManager.rar" target="_self"&gt;BackupManager.rar&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;</description>
      <link>http://blog.sb2.fr/post/2008/12/25/BlogEngineNET-Backup-Manager.aspx</link>
      <author>yb.nospam@nospam.sb2.fr (xTC)</author>
      <comments>http://blog.sb2.fr/post/2008/12/25/BlogEngineNET-Backup-Manager.aspx#comment</comments>
      <guid>http://blog.sb2.fr/post.aspx?id=d963476f-a039-4886-b9d6-c0c632da73ab</guid>
      <pubDate>Thu, 25 Dec 2008 15:52:00 +0200</pubDate>
      <category>ASP.NET</category>
      <category>BlogEngine</category>
      <dc:publisher>xTC</dc:publisher>
      <pingback:server>http://blog.sb2.fr/pingback.axd</pingback:server>
      <pingback:target>http://blog.sb2.fr/post.aspx?id=d963476f-a039-4886-b9d6-c0c632da73ab</pingback:target>
      <slash:comments>50</slash:comments>
      <trackback:ping>http://blog.sb2.fr/trackback.axd?id=d963476f-a039-4886-b9d6-c0c632da73ab</trackback:ping>
      <wfw:comment>http://blog.sb2.fr/post/2008/12/25/BlogEngineNET-Backup-Manager.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.sb2.fr/syndication.axd?post=d963476f-a039-4886-b9d6-c0c632da73ab</wfw:commentRss>
    </item>
    <item>
      <title>Storing ViewState On Server Instead Of Client With ASP.NET</title>
      <description>&lt;p&gt;ViewState is a great way in order to save Control State. But when working with large ViewState Data (GridView, DataList etc..) this will add a lot of overhead to your Web Application.&lt;/p&gt;  &lt;p&gt;In order to avoid this overhead, we can store ViewState on the Server instead of Client. Because ViewState is only useful for Control Rendering or Server processing there is no sense to store it on the client.&lt;/p&gt;  &lt;p&gt;To Store the ViewState in the Server we are going to use the &lt;strong&gt;PageStatePersister&lt;/strong&gt; class.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;MSDN :&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;PageStatePersister Class&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;Provides the base functionality for ASP.NET view state persistence mechanisms.&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Namespace:&lt;/strong&gt; &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.aspx"&gt;System.Web.UI&lt;/a&gt;       &lt;br /&gt;&lt;strong&gt;Assembly:&lt;/strong&gt; System.Web (in System.Web.dll)&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;In order to use it you only need to Override the &lt;strong&gt;PageStatePersister&lt;/strong&gt; Property of your Page (System.Web.UI.Page) as the following&lt;/p&gt;  &lt;h3&gt;Override PageStatePersister&lt;/h3&gt;  &lt;div class="csharpcode-wrapper"&gt;   &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; PageStatePersister PageStatePersister
{
    get
    {
        &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; SessionPageStatePersister(&lt;span class="kwrd"&gt;this&lt;/span&gt;);
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;h3&gt;Page ViewState Before our Customization&lt;/h3&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;input&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;hidden&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;__VIEWSTATE&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;__VIEWSTATE&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;value&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;/wEPDwUJMjkyMzAwMzQxZBgEBR5fX0NvbnRyb2xzUmVxdWl
yZVBvc3RCYWNrS2V5X18WDQURTG9naW4xJFJlbWVtYmVyTWUFF0xvZ2luMSRMb2dpbkltYWdlQnV0dG9uBTxDcmVhdGVVc2VyV2l6YXJkMSRfX0
N1c3RvbU5hdjAkU3RlcFByZXZpb3VzQnV0dG9uSW1hZ2VCdXR0b24FOENyZWF0ZVVzZXJXaXphcmQxJF9fQ3VzdG9tTmF2MCRTdGVwTmV4dEJ1d
HRvbkltYWdlQnV0dG9uBTZDcmVhdGVVc2VyV2l6YXJkMSRfX0N1c3RvbU5hdjAkQ2FuY2VsQnV0dG9uSW1hZ2VCdXR0b24FSUNyZWF0ZVVzZXJX
aXphcmQxJFN0YXJ0TmF2aWdhdGlvblRlbXBsYXRlQ29udGFpbmVySUQkU3RhcnROZXh0SW1hZ2VCdXR0b24FRkNyZWF0ZVVzZXJXaXphcmQxJFN
0YXJ0TmF2aWdhdGlvblRlbXBsYXRlQ29udGFpbmVySUQkQ2FuY2VsSW1hZ2VCdXR0b24FT0NyZWF0ZVVzZXJXaXphcmQxJEZpbmlzaE5hdmlnY
XRpb25UZW1wbGF0ZUNvbnRhaW5lcklEJEZpbmlzaFByZXZpb3VzSW1hZ2VCdXR0b24FR0NyZWF0ZVVzZXJXaXphcmQxJEZpbmlzaE5hdmlnYXRp
b25UZW1wbGF0ZUNvbnRhaW5lcklEJEZpbmlzaEltYWdlQnV0dG9uBUdDcmVhdGVVc2VyV2l6YXJkMSRGaW5pc2hOYXZpZ2F0aW9uVGVtcGxhdGV
Db250YWluZXJJRCRDYW5jZWxJbWFnZUJ1dHRvbgVLQ3JlYXRlVXNlcldpemFyZDEkU3RlcE5hdmlnYXRpb25UZW1wbGF0ZUNvbnRhaW5lcklEJF
N0ZXBQcmV2aW91c0ltYWdlQnV0dG9uBUdDcmVhdGVVc2VyV2l6YXJkMSRTdGVwTmF2aWdhdGlvblRlbXBsYXRlQ29udGFpbmVySUQkU3RlcE5le
HRJbWFnZUJ1dHRvbgVFQ3JlYXRlVXNlcldpemFyZDEkU3RlcE5hdmlnYXRpb25UZW1wbGF0ZUNvbnRhaW5lcklEJENhbmNlbEltYWdlQnV0dG9
uBRFDcmVhdGVVc2VyV2l6YXJkMQ8QZBQrAAFmZmQFIUNyZWF0ZVVzZXJXaXphcmQxJFdpemFyZE11bHRpVmlldw8PZGZkBQpMb2dpblZpZXcxD
w9kAgFkeRepZwn7jve5rLMjGzMIzhcPCXo=&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3&gt;Page ViewState After our Customization&lt;/h3&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;br /&gt;

  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;input&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;hidden&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;__VIEWSTATE&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;__VIEWSTATE&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;value&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;/wEPaA8FDzhjYjM0YjBjYmRiNWFlYmTsPQ5CpZN/tzgLGEb8hwbihwVFuw==&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE :&lt;/strong&gt; Note that Server-Side Stored ViewState Data will be lost if your Web Application Restart. I’ll provide later a simple way in order to Implement a Database ViewState Persister.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE 2 :&lt;/strong&gt; Note that if you use SQL Server Session State Management, the SessionPageStatePersister should store ViewState in Session Items in SQL Server. So even a Application Restart, ViewState Data should be kept.&lt;/p&gt;

&lt;p&gt;Hope this help’s!&lt;/p&gt;</description>
      <link>http://blog.sb2.fr/post/2008/12/25/Storing-ViewState-On-Server-Instead-Of-Client-With-ASPNET.aspx</link>
      <author>yb.nospam@nospam.sb2.fr (xTC)</author>
      <comments>http://blog.sb2.fr/post/2008/12/25/Storing-ViewState-On-Server-Instead-Of-Client-With-ASPNET.aspx#comment</comments>
      <guid>http://blog.sb2.fr/post.aspx?id=a95d135d-00ed-4db2-843f-3283f0343ab2</guid>
      <pubDate>Thu, 25 Dec 2008 14:09:29 +0200</pubDate>
      <category>ASP.NET</category>
      <dc:publisher>xTC</dc:publisher>
      <pingback:server>http://blog.sb2.fr/pingback.axd</pingback:server>
      <pingback:target>http://blog.sb2.fr/post.aspx?id=a95d135d-00ed-4db2-843f-3283f0343ab2</pingback:target>
      <slash:comments>5</slash:comments>
      <trackback:ping>http://blog.sb2.fr/trackback.axd?id=a95d135d-00ed-4db2-843f-3283f0343ab2</trackback:ping>
      <wfw:comment>http://blog.sb2.fr/post/2008/12/25/Storing-ViewState-On-Server-Instead-Of-Client-With-ASPNET.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.sb2.fr/syndication.axd?post=a95d135d-00ed-4db2-843f-3283f0343ab2</wfw:commentRss>
    </item>
    <item>
      <title>Some ASP.NET Optimizations And Best Practices</title>
      <description>&lt;p&gt;Hi,&lt;/p&gt;  &lt;p&gt;In this article I’ll talk about ASP.NET Optimization and Best Practices. As everyone know ASP.NET has a lot of hidden secrets and by revealing them you got performance and scalability boost ! Here some of them in order to make powerful ASP.NET Applications.&lt;/p&gt;  &lt;h3&gt;1 - Use Output Buffering&lt;/h3&gt;  &lt;div class="csharpcode-wrapper"&gt;   &lt;pre class="csharpcode"&gt;&amp;lt;% Response.Buffer = &lt;span class="kwrd"&gt;true&lt;/span&gt; %&amp;gt;

...

&amp;lt;% Response.Flush = &lt;span class="kwrd"&gt;true&lt;/span&gt; %&amp;gt; &lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h3&gt;2 - Use HttpResponse.IsClientConnected&lt;/h3&gt;

&lt;p&gt;Take advantage of this feature in order to make sure that the client is still connected before start large operations.&lt;/p&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt; (Response.IsClientConnected)
{
    &lt;span class="rem"&gt;// Do Large Operations&lt;/span&gt;
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;h3&gt;3 - Always Check Page.IsValid&lt;/h3&gt;

&lt;p&gt;In order to avoid Client Side Validation, you must always perform a Server-Side validation. cf. &lt;a href="http://blog.sb2.fr/post/2008/12/14/Dont-Forget-to-Check-PageIsValid-!.aspx" target="_blank"&gt;My previous Post&lt;/a&gt;&lt;/p&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt; (Page.IsValid)
{
    &lt;span class="rem"&gt;// Do Something&lt;/span&gt;
}&lt;/pre&gt;
&lt;/div&gt;

&lt;h3&gt;4 - Always Deploy in Release Build&lt;/h3&gt;

&lt;p&gt;Make sure you deploy your Web Application in Release Mode, this will ensure not deploying Debug Informations which really slow down your application..&lt;/p&gt;

&lt;h3&gt;5 – Turn Off ASP.NET Tracing&lt;/h3&gt;

&lt;p&gt;ASP.NET Tracing is pretty useful, but will add a lot of overhead to your Web Application. So don’t forget to Turn it Off.&lt;/p&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;configuration&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;system.web&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;trace&lt;/span&gt; &lt;span class="attr"&gt;enabled&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;false&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;pageOutput&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;false&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;trace&lt;/span&gt; &lt;span class="attr"&gt;enabled&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;false&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;requestLimit&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;10&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;pageOutput&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;false&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;traceMode&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;SortByTime&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;localOnly&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;compilation&lt;/span&gt; &lt;span class="attr"&gt;debug&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;false&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;system.web&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;configuration&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3&gt;6 – Turn off Compilation Debug&lt;/h3&gt;

&lt;p&gt;Make sure turn off Compilation Debug in Web.Config. Otherwise, it will add a lot of overhead to your Web Application due to Debug Informations at JIT Compilation..&lt;/p&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;configuration&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;system.web&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;compilation&lt;/span&gt; &lt;span class="attr"&gt;debug&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;false&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;system.web&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;configuration&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Trick : &lt;/strong&gt;In order to make sure you use Best Configuration in Web.Config and avoid Compilation mistakes use the following attribute&lt;/p&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;configuration&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;system.web&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;deployment&lt;/span&gt; &lt;span class="attr"&gt;retail&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;system.web&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;configuration&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3&gt;7 – Use Caching&lt;/h3&gt;

&lt;p&gt;Caching is probably the best performance key point in order to make your Web Application very powerful and optimized.&lt;/p&gt;

&lt;p&gt;Here is some article I written about Caching with ASP.NET&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href="http://blog.sb2.fr/post/2008/11/25/Useful-Cache-and-Session-Method-Extensions-for-ASPNET.aspx" target="_blank"&gt;Cache and Session Extension Method for ASP.NET&lt;/a&gt; &lt;/li&gt;

  &lt;li&gt;&lt;a href="http://blog.sb2.fr/post/2008/11/21/EN-Css-Caching-and-Compression-with-HttpModule-for-ASPNET.aspx" target="_blank"&gt;CSS Caching With ASP.NET&lt;/a&gt; &lt;/li&gt;

  &lt;li&gt;&lt;a href="http://blog.sb2.fr/post/2008/11/15/Generic-ASPNET-CacheWrapper.aspx" target="_blank"&gt;Generic ASP.NET Cache Wrapper&lt;/a&gt; &lt;/li&gt;

  &lt;li&gt;&lt;a href="http://blog.sb2.fr/post/2008/11/13/Cache-avec-LinqToSql-et-Entreprise-Library-Caching-Block.aspx" target="_blank"&gt;Caching With LinqToSql and Enterprise Library Caching Block&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;8 – Turn Off ViewState&lt;/h3&gt;

&lt;p&gt;ViewState is pretty useful when working with PostBacks. By Default ASP.NET Controls will turn on ViewState and may slow your Web Site.&lt;/p&gt;

&lt;p&gt;If you don’t use PostBacks, don’t forget to turn it off. This will make your Web Page weight lighter !&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Hope this help’s! :)&lt;/p&gt;</description>
      <link>http://blog.sb2.fr/post/2008/12/25/Some-ASPNET-Optimizations-And-Best-Practices.aspx</link>
      <author>yb.nospam@nospam.sb2.fr (xTC)</author>
      <comments>http://blog.sb2.fr/post/2008/12/25/Some-ASPNET-Optimizations-And-Best-Practices.aspx#comment</comments>
      <guid>http://blog.sb2.fr/post.aspx?id=7eb6e151-9dee-44a0-a084-6bd164e670fa</guid>
      <pubDate>Thu, 25 Dec 2008 02:39:10 +0200</pubDate>
      <category>ASP.NET</category>
      <dc:publisher>xTC</dc:publisher>
      <pingback:server>http://blog.sb2.fr/pingback.axd</pingback:server>
      <pingback:target>http://blog.sb2.fr/post.aspx?id=7eb6e151-9dee-44a0-a084-6bd164e670fa</pingback:target>
      <slash:comments>3</slash:comments>
      <trackback:ping>http://blog.sb2.fr/trackback.axd?id=7eb6e151-9dee-44a0-a084-6bd164e670fa</trackback:ping>
      <wfw:comment>http://blog.sb2.fr/post/2008/12/25/Some-ASPNET-Optimizations-And-Best-Practices.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.sb2.fr/syndication.axd?post=7eb6e151-9dee-44a0-a084-6bd164e670fa</wfw:commentRss>
    </item>
    <item>
      <title>Merry Christmas GeeK’s</title>
      <description>&lt;p align="center"&gt;&lt;/p&gt;  &lt;h3 align="center"&gt;Hi,&lt;/h3&gt;  &lt;h3 align="center"&gt;Today a very useless Post, but a little bit Funny :)&lt;/h3&gt;  &lt;p align="center"&gt;&amp;#160;&lt;/p&gt;  &lt;h1 align="center"&gt;Merry Christmas &amp;amp; Happy New Year    &lt;br /&gt;GeeK’s&lt;/h1&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blog.sb2.fr/image.axd?picture=WindowsLiveWriter/HappyChristmasDevelopersandGeeKs_1030B/ChristmasGeek_2.jpg"&gt;&lt;img title="ChristmasGeek" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="330" alt="ChristmasGeek" src="http://blog.sb2.fr/image.axd?picture=WindowsLiveWriter/HappyChristmasDevelopersandGeeKs_1030B/ChristmasGeek_thumb.jpg" width="438" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h2 align="center"&gt;&lt;em&gt;I hope I would not have bugs for Christmas :D&lt;/em&gt;&lt;/h2&gt;  &lt;p align="center"&gt;&amp;#160;&lt;/p&gt;  &lt;p align="left"&gt;See you next Year :)&lt;/p&gt;</description>
      <link>http://blog.sb2.fr/post/2008/12/23/Happy-Christmas-GeeKe28099s.aspx</link>
      <author>yb.nospam@nospam.sb2.fr (xTC)</author>
      <comments>http://blog.sb2.fr/post/2008/12/23/Happy-Christmas-GeeKe28099s.aspx#comment</comments>
      <guid>http://blog.sb2.fr/post.aspx?id=51ed2219-e7f7-4744-a87a-600736267243</guid>
      <pubDate>Tue, 23 Dec 2008 18:33:01 +0200</pubDate>
      <dc:publisher>xTC</dc:publisher>
      <pingback:server>http://blog.sb2.fr/pingback.axd</pingback:server>
      <pingback:target>http://blog.sb2.fr/post.aspx?id=51ed2219-e7f7-4744-a87a-600736267243</pingback:target>
      <slash:comments>3</slash:comments>
      <trackback:ping>http://blog.sb2.fr/trackback.axd?id=51ed2219-e7f7-4744-a87a-600736267243</trackback:ping>
      <wfw:comment>http://blog.sb2.fr/post/2008/12/23/Happy-Christmas-GeeKe28099s.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.sb2.fr/syndication.axd?post=51ed2219-e7f7-4744-a87a-600736267243</wfw:commentRss>
    </item>
    <item>
      <title>ReadOnlyDictionnary And ReadOnlyList Wrappers</title>
      <description>&lt;p&gt;In this article two Simple Implementations of &lt;strong&gt;ReadOnlyDictionary&amp;lt;TKey,TValue&amp;gt;&lt;/strong&gt; and &lt;strong&gt;ReadOnlyList&amp;lt;T&amp;gt;.&lt;/strong&gt;&lt;/p&gt;  &lt;h3&gt;ReadOnlyDictionary&amp;lt;TKey,TValue&amp;gt;&lt;/h3&gt;  &lt;div class="csharpcode-wrapper"&gt;   &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; ReadOnlyDictionary&amp;lt;TKey, TValue&amp;gt; : IDictionary&amp;lt;TKey, TValue&amp;gt;
{
    &lt;span class="preproc"&gt;#region&lt;/span&gt; Private Fields

    &lt;span class="kwrd"&gt;private&lt;/span&gt; IDictionary&amp;lt;TKey, TValue&amp;gt; _original;

    &lt;span class="preproc"&gt;#endregion&lt;/span&gt;

    &lt;span class="preproc"&gt;#region&lt;/span&gt; Constructors

    &lt;span class="kwrd"&gt;public&lt;/span&gt; ReadOnlyDictionary(IDictionary&amp;lt;TKey, TValue&amp;gt; original)
    {
        _original = original;
    }

    &lt;span class="preproc"&gt;#endregion&lt;/span&gt;

    &lt;span class="preproc"&gt;#region&lt;/span&gt; IDictionary&amp;lt;TKey,TValue&amp;gt; Members

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Add(TKey key, TValue &lt;span class="kwrd"&gt;value&lt;/span&gt;)
    {
        &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; NotSupportedException();
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; ContainsKey(TKey key)
    {
        &lt;span class="kwrd"&gt;return&lt;/span&gt; _original.ContainsKey(key);
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; ICollection&amp;lt;TKey&amp;gt; Keys
    {
        get { &lt;span class="kwrd"&gt;return&lt;/span&gt; _original.Keys; }
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; Remove(TKey key)
    {
        &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; NotSupportedException();
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; TryGetValue(TKey key, &lt;span class="kwrd"&gt;out&lt;/span&gt; TValue &lt;span class="kwrd"&gt;value&lt;/span&gt;)
    {
        &lt;span class="kwrd"&gt;return&lt;/span&gt; _original.TryGetValue(key, &lt;span class="kwrd"&gt;out&lt;/span&gt; &lt;span class="kwrd"&gt;value&lt;/span&gt;);
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; ICollection&amp;lt;TValue&amp;gt; Values
    {
        get { &lt;span class="kwrd"&gt;return&lt;/span&gt; _original.Values; }
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; TValue &lt;span class="kwrd"&gt;this&lt;/span&gt;[TKey key]
    {
        get
        {
            &lt;span class="kwrd"&gt;return&lt;/span&gt; _original[key];
        }
        set
        {
            &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; NotSupportedException();
        }
    }

    &lt;span class="preproc"&gt;#endregion&lt;/span&gt;

    &lt;span class="preproc"&gt;#region&lt;/span&gt; ICollection&amp;lt;KeyValuePair&amp;lt;TKey,TValue&amp;gt;&amp;gt; Members

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Add(KeyValuePair&amp;lt;TKey, TValue&amp;gt; item)
    {
        &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; NotSupportedException();
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Clear()
    {
        &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; NotSupportedException();
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; Contains(KeyValuePair&amp;lt;TKey, TValue&amp;gt; item)
    {
        &lt;span class="kwrd"&gt;return&lt;/span&gt; _original.Contains(item);
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; CopyTo(KeyValuePair&amp;lt;TKey, TValue&amp;gt;[] array, &lt;span class="kwrd"&gt;int&lt;/span&gt; arrayIndex)
    {
        _original.CopyTo(array, arrayIndex);
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; Count
    {
        get { &lt;span class="kwrd"&gt;return&lt;/span&gt; _original.Count; }
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; IsReadOnly
    {
        get { &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;true&lt;/span&gt;; }
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; Remove(KeyValuePair&amp;lt;TKey, TValue&amp;gt; item)
    {
        &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; NotSupportedException();
    }

    &lt;span class="preproc"&gt;#endregion&lt;/span&gt;

    &lt;span class="preproc"&gt;#region&lt;/span&gt; IEnumerable&amp;lt;KeyValuePair&amp;lt;TKey,TValue&amp;gt;&amp;gt; Members

    &lt;span class="kwrd"&gt;public&lt;/span&gt; IEnumerator&amp;lt;KeyValuePair&amp;lt;TKey, TValue&amp;gt;&amp;gt; GetEnumerator()
    {
        &lt;span class="kwrd"&gt;return&lt;/span&gt; _original.GetEnumerator();
    }

    &lt;span class="preproc"&gt;#endregion&lt;/span&gt;

    &lt;span class="preproc"&gt;#region&lt;/span&gt; IEnumerable Members

    System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
    {
        &lt;span class="kwrd"&gt;return&lt;/span&gt; _original.GetEnumerator();
    }

    &lt;span class="preproc"&gt;#endregion&lt;/span&gt;
}&lt;/pre&gt;
&lt;/div&gt;

&lt;h3&gt;ReadOnlyList&amp;lt;T&amp;gt;&lt;/h3&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; ReadOnlyList&amp;lt;T&amp;gt; : IList&amp;lt;T&amp;gt;
{
    &lt;span class="preproc"&gt;#region&lt;/span&gt; Private Fields

    &lt;span class="kwrd"&gt;private&lt;/span&gt; IList&amp;lt;T&amp;gt; _original;

    &lt;span class="preproc"&gt;#endregion&lt;/span&gt;

    &lt;span class="preproc"&gt;#region&lt;/span&gt; Constructors

    &lt;span class="kwrd"&gt;public&lt;/span&gt; ReadOnlyList(IList&amp;lt;T&amp;gt; original)
    {
        _original = original;
    }

    &lt;span class="preproc"&gt;#endregion&lt;/span&gt;

    &lt;span class="preproc"&gt;#region&lt;/span&gt; IList&amp;lt;T&amp;gt; Members

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; IndexOf(T item)
    {
        &lt;span class="kwrd"&gt;return&lt;/span&gt; _original.IndexOf(item);
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Insert(&lt;span class="kwrd"&gt;int&lt;/span&gt; index, T item)
    {
        &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; NotSupportedException();
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; RemoveAt(&lt;span class="kwrd"&gt;int&lt;/span&gt; index)
    {
        &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; NotSupportedException();
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; T &lt;span class="kwrd"&gt;this&lt;/span&gt;[&lt;span class="kwrd"&gt;int&lt;/span&gt; index]
    {
        get
        {
            &lt;span class="kwrd"&gt;return&lt;/span&gt; _original[index];
        }
        set
        {
            &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; NotSupportedException();
        }
    }

    &lt;span class="preproc"&gt;#endregion&lt;/span&gt;

    &lt;span class="preproc"&gt;#region&lt;/span&gt; ICollection&amp;lt;T&amp;gt; Members

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Add(T item)
    {
        &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; NotSupportedException();
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Clear()
    {
        &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; NotSupportedException();
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; Contains(T item)
    {
        &lt;span class="kwrd"&gt;return&lt;/span&gt; _original.Contains(item);
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; CopyTo(T[] array, &lt;span class="kwrd"&gt;int&lt;/span&gt; arrayIndex)
    {
        _original.CopyTo(array, arrayIndex);
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; Count
    {
        get { &lt;span class="kwrd"&gt;return&lt;/span&gt; _original.Count; }
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; IsReadOnly
    {
        get { &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;true&lt;/span&gt;; }
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; Remove(T item)
    {
        &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; NotSupportedException();
    }

    &lt;span class="preproc"&gt;#endregion&lt;/span&gt;

    &lt;span class="preproc"&gt;#region&lt;/span&gt; IEnumerable&amp;lt;T&amp;gt; Members

    &lt;span class="kwrd"&gt;public&lt;/span&gt; IEnumerator&amp;lt;T&amp;gt; GetEnumerator()
    {
        &lt;span class="kwrd"&gt;return&lt;/span&gt; _original.GetEnumerator();
    }

    &lt;span class="preproc"&gt;#endregion&lt;/span&gt;

    &lt;span class="preproc"&gt;#region&lt;/span&gt; IEnumerable Members

    System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
    {
        &lt;span class="kwrd"&gt;return&lt;/span&gt; _original.GetEnumerator();
    }

    &lt;span class="preproc"&gt;#endregion&lt;/span&gt;
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Hope this help’s!&lt;/p&gt;</description>
      <link>http://blog.sb2.fr/post/2008/12/23/ReadOnlyDictionnary-And-ReadOnlyList-Wrappers.aspx</link>
      <author>yb.nospam@nospam.sb2.fr (xTC)</author>
      <comments>http://blog.sb2.fr/post/2008/12/23/ReadOnlyDictionnary-And-ReadOnlyList-Wrappers.aspx#comment</comments>
      <guid>http://blog.sb2.fr/post.aspx?id=d2c86566-e4f9-42a0-a9da-c11352c7af95</guid>
      <pubDate>Tue, 23 Dec 2008 18:12:45 +0200</pubDate>
      <category>C#</category>
      <dc:publisher>xTC</dc:publisher>
      <pingback:server>http://blog.sb2.fr/pingback.axd</pingback:server>
      <pingback:target>http://blog.sb2.fr/post.aspx?id=d2c86566-e4f9-42a0-a9da-c11352c7af95</pingback:target>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://blog.sb2.fr/trackback.axd?id=d2c86566-e4f9-42a0-a9da-c11352c7af95</trackback:ping>
      <wfw:comment>http://blog.sb2.fr/post/2008/12/23/ReadOnlyDictionnary-And-ReadOnlyList-Wrappers.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.sb2.fr/syndication.axd?post=d2c86566-e4f9-42a0-a9da-c11352c7af95</wfw:commentRss>
    </item>
    <item>
      <title>How-To Ensure and Make Http Session State Read-Only</title>
      <description>&lt;p&gt;When working with Http Handlers or Http Modules, we often need to use Session State.&lt;/p&gt;  &lt;p&gt;The Simple way to make an Http Handler “SessionState Enabled” is to inherit it with the &lt;strong&gt;IRequiresSessionState&lt;/strong&gt; Interface&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;MSDN :&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;IRequiresSessionState Interface&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;Specifies that the target HTTP handler requires read and write access to session-state values. This is a marker interface and has no methods.&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Namespace:&lt;/strong&gt; &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.sessionstate.aspx"&gt;System.Web.SessionState&lt;/a&gt;       &lt;br /&gt;&lt;strong&gt;Assembly:&lt;/strong&gt; System.Web (in System.Web.dll)&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now we want to make an Http Handler with &lt;strong&gt;SessionState&lt;/strong&gt; support by just Read-Only. So after a quick search on the MSDN Library, I founded the &lt;strong&gt;IReadOnlySessionState&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;MSDN :&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;IReadOnlySessionState Interface&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;Specifies that the target HTTP handler requires only read access to session-state values. This is a marker interface and has no methods.&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Namespace:&lt;/strong&gt; &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.sessionstate.aspx"&gt;System.Web.SessionState&lt;/a&gt;       &lt;br /&gt;&lt;strong&gt;Assembly:&lt;/strong&gt; System.Web (in System.Web.dll)&lt;/p&gt;    &lt;p&gt;&amp;#160;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;But in fact this Interface just mark the HttpSessionState.IsReadOnly as “True” and we are still able to modify Session Items ... (or I missed something ..)&lt;/p&gt;  &lt;p&gt;This is why I created a Custom SessionState Class Called : &lt;strong&gt;ReadOnlySessionState&lt;/strong&gt;&lt;/p&gt;  &lt;div class="csharpcode-wrapper"&gt;   &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; ReadOnlySessionState : IHttpSessionState
{
    &lt;span class="preproc"&gt;#region&lt;/span&gt; Private Properties

    &lt;span class="kwrd"&gt;private&lt;/span&gt; HttpSessionState Session { get; set; }

    &lt;span class="preproc"&gt;#endregion&lt;/span&gt;

    &lt;span class="preproc"&gt;#region&lt;/span&gt; Contructors

    &lt;span class="kwrd"&gt;public&lt;/span&gt; ReadOnlySessionState(HttpSessionState sessionState)
    {
        Session = sessionState;
    } 

    &lt;span class="preproc"&gt;#endregion&lt;/span&gt;

    &lt;span class="preproc"&gt;#region&lt;/span&gt; IHttpSessionState Members

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Abandon()
    {
        Session.Abandon();
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Add(&lt;span class="kwrd"&gt;string&lt;/span&gt; name, &lt;span class="kwrd"&gt;object&lt;/span&gt; &lt;span class="kwrd"&gt;value&lt;/span&gt;)
    {
        &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; NotSupportedException();
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Clear()
    {
        &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; NotSupportedException();
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; CodePage
    {
        get
        {
            &lt;span class="kwrd"&gt;return&lt;/span&gt; Session.CodePage;
        }
        set
        {
            &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; NotSupportedException();
        }
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; System.Web.HttpCookieMode CookieMode
    {
        get { &lt;span class="kwrd"&gt;return&lt;/span&gt; Session.CookieMode; }
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; CopyTo(Array array, &lt;span class="kwrd"&gt;int&lt;/span&gt; index)
    {
        &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; NotSupportedException();
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; Count
    {
        get { &lt;span class="kwrd"&gt;return&lt;/span&gt; Session.Count; }
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; System.Collections.IEnumerator GetEnumerator()
    {
        &lt;span class="kwrd"&gt;return&lt;/span&gt; Session.GetEnumerator();
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; IsCookieless
    {
        get { &lt;span class="kwrd"&gt;return&lt;/span&gt; Session.IsCookieless; }
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; IsNewSession
    {
        get { &lt;span class="kwrd"&gt;return&lt;/span&gt; Session.IsNewSession; }
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; IsReadOnly
    {
        get { &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;true&lt;/span&gt;; }
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; IsSynchronized
    {
        get { &lt;span class="kwrd"&gt;return&lt;/span&gt; Session.IsSynchronized; }
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; System.Collections.Specialized.NameObjectCollectionBase.KeysCollection Keys
    {
        get { &lt;span class="kwrd"&gt;return&lt;/span&gt; Session.Keys; }
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; LCID
    {
        get
        {
            &lt;span class="kwrd"&gt;return&lt;/span&gt; Session.LCID;
        }
        set
        {
            &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; NotSupportedException();
        }
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; SessionStateMode Mode
    {
        get { &lt;span class="kwrd"&gt;return&lt;/span&gt; Session.Mode; }
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Remove(&lt;span class="kwrd"&gt;string&lt;/span&gt; name)
    {
        &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; NotSupportedException();
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; RemoveAll()
    {
        &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; NotSupportedException();
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; RemoveAt(&lt;span class="kwrd"&gt;int&lt;/span&gt; index)
    {
        &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; NotSupportedException();
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; SessionID
    {
        get { &lt;span class="kwrd"&gt;return&lt;/span&gt; Session.SessionID; }
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; System.Web.HttpStaticObjectsCollection StaticObjects
    {
        get { &lt;span class="kwrd"&gt;return&lt;/span&gt; Session.StaticObjects; }
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;object&lt;/span&gt; SyncRoot
    {
        get { &lt;span class="kwrd"&gt;return&lt;/span&gt; Session.SyncRoot; }
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; Timeout
    {
        get
        {
            &lt;span class="kwrd"&gt;return&lt;/span&gt; Session.Timeout;
        }
        set
        {
            &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; NotSupportedException();
        }
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;object&lt;/span&gt; &lt;span class="kwrd"&gt;this&lt;/span&gt;[&lt;span class="kwrd"&gt;int&lt;/span&gt; index]
    {
        get
        {
            &lt;span class="kwrd"&gt;return&lt;/span&gt; Session[index];
        }
        set
        {
            &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; NotSupportedException();
        }
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;object&lt;/span&gt; &lt;span class="kwrd"&gt;this&lt;/span&gt;[&lt;span class="kwrd"&gt;string&lt;/span&gt; name]
    {
        get
        {
            &lt;span class="kwrd"&gt;return&lt;/span&gt; Session[name];
        }
        set
        {
            &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; NotSupportedException();
        }
    }

    &lt;span class="preproc"&gt;#endregion&lt;/span&gt;
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now we can use it in an Http Handler as the following&lt;/p&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; MySessionStateReadOnlyHandler : IHttpHandler,&lt;strong&gt;IReadOnlySessionState&lt;/strong&gt;
{
    &lt;span class="kwrd"&gt;protected&lt;/span&gt; ReadOnlySessionState Session
    {
        get { &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; ReadOnlySessionState(HttpContext.Current.Session); }
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; ProcessRequest(HttpContext context)
    {
        Session[&lt;span class="str"&gt;&amp;quot;MyItem&amp;quot;&lt;/span&gt;] = &lt;span class="str"&gt;&amp;quot;Hello World&amp;quot;&lt;/span&gt;; &lt;span class="rem"&gt;// Will throw a NotSupportedException : Good !&lt;/span&gt;
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; IsReusable
    {
        get
        {
            &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;false&lt;/span&gt;;
        }
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Hope this help’s!&lt;/p&gt;</description>
      <link>http://blog.sb2.fr/post/2008/12/23/How-To-Ensure-and-Make-Http-Session-State-Read-Only.aspx</link>
      <author>yb.nospam@nospam.sb2.fr (xTC)</author>
      <comments>http://blog.sb2.fr/post/2008/12/23/How-To-Ensure-and-Make-Http-Session-State-Read-Only.aspx#comment</comments>
      <guid>http://blog.sb2.fr/post.aspx?id=590b86f0-f714-45ee-ac57-ce3d251aab76</guid>
      <pubDate>Tue, 23 Dec 2008 17:38:42 +0200</pubDate>
      <category>ASP.NET</category>
      <dc:publisher>xTC</dc:publisher>
      <pingback:server>http://blog.sb2.fr/pingback.axd</pingback:server>
      <pingback:target>http://blog.sb2.fr/post.aspx?id=590b86f0-f714-45ee-ac57-ce3d251aab76</pingback:target>
      <slash:comments>5</slash:comments>
      <trackback:ping>http://blog.sb2.fr/trackback.axd?id=590b86f0-f714-45ee-ac57-ce3d251aab76</trackback:ping>
      <wfw:comment>http://blog.sb2.fr/post/2008/12/23/How-To-Ensure-and-Make-Http-Session-State-Read-Only.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.sb2.fr/syndication.axd?post=590b86f0-f714-45ee-ac57-ce3d251aab76</wfw:commentRss>
    </item>
    <item>
      <title>Some Common Errors With ASP.NET</title>
      <description>&lt;p&gt;Hi,&lt;/p&gt;  &lt;p&gt;In this article I’ll start a list a few Common Errors about ASP.NET Developers are confronted and give solutions.&lt;/p&gt;  &lt;h3&gt;&amp;#160;&lt;/h3&gt;  &lt;h3&gt;1 - Are you missing a using directive or an assembly reference ?&lt;/h3&gt;  &lt;p&gt;When using Inline Code in ASPX Page we often got this Exception. This Exception occurs when you don’t Import Namespace as you do with “using” statement in Code-Behind.&lt;/p&gt;  &lt;h3&gt;Server Error in '/' Application.    &lt;hr width="100%" size="1" /&gt;&lt;/h3&gt;  &lt;h4&gt;&lt;i&gt;Compilation Error&lt;/i&gt;&lt;/h4&gt; &lt;b&gt;Description: &lt;/b&gt;An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.   &lt;br /&gt;&lt;b&gt;Compiler Error Message: &lt;/b&gt;CS1061: 'string' does not contain a definition for 'RemoveExtraHyphen' and no extension method 'RemoveExtraHyphen' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?)   &lt;br /&gt;&lt;b&gt;Source Error:&lt;/b&gt;   &lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;  &lt;pre&gt;Line 9:      &amp;lt;form id=&amp;quot;form1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;
Line 10:     &amp;lt;div&amp;gt;
Line 11:         &amp;lt;%= &amp;quot;Hello--World--!&amp;quot;.RemoveExtraHyphen()%&amp;gt;
Line 12:     &amp;lt;/div&amp;gt;
Line 13:     &amp;lt;/form&amp;gt;&lt;/pre&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;&amp;#160; : Add a Namespace Reference in the ASPX Page : &lt;/p&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="asp"&gt;&amp;lt;%@ Import Namespace=&amp;quot;Sb2.Core.Extensions&amp;quot; %&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3&gt;&amp;#160;&lt;/h3&gt;

&lt;h3&gt;2 - A potentially dangerous Request.Form value was detected from the client&lt;/h3&gt;

&lt;p&gt;This Exception occurs when “EnableEventValidation” directive in WebForm is set as “True” and when you tries to POST some potentially dangerous values.&lt;/p&gt;

&lt;h3&gt;Server Error in '/' Application. 
  &lt;hr width="100%" size="1" /&gt;&lt;/h3&gt;

&lt;h4&gt;&lt;i&gt;A potentially dangerous Request.Form value was detected from the client (TextBox1=&amp;quot;&amp;lt;!=&amp;quot;).&lt;/i&gt;&lt;/h4&gt;

&lt;p&gt;&lt;b&gt;Description: &lt;/b&gt;Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. You can disable request validation by setting validateRequest=false in the Page directive or in the configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case. 

  &lt;br /&gt;&lt;b&gt;Exception Details: &lt;/b&gt;System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (TextBox1=&amp;quot;&amp;lt;!=&amp;quot;). 

  &lt;br /&gt;&lt;b&gt;Source Error:&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution :&lt;/strong&gt; Set &lt;strong&gt;EnableEventValidation&lt;/strong&gt; directive a “False” in WebPage or in Web.config&lt;/p&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="asp"&gt;&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; EnableEventValidation=&amp;quot;false&amp;quot; AutoEventWireup=&amp;quot;true&amp;quot; CodeBehind=&amp;quot;Default.aspx.cs&amp;quot; Inherits=&amp;quot;Sb2.Web.Tests._Default&amp;quot; %&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;div class="csharpcode-wrapper"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;pages&lt;/span&gt; &lt;span class="attr"&gt;enableEventValidation&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;false&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h3&gt;3 – Usage of IsPostBack&lt;/h3&gt;

&lt;p&gt;Now a pretty common mistake when working with ASP.NET …&lt;/p&gt;

&lt;p&gt;Assuming the following ASP.NET WebForm&lt;/p&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="asp"&gt;&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; AutoEventWireup=&amp;quot;true&amp;quot; CodeBehind=&amp;quot;Default.aspx.cs&amp;quot; Inherits=&amp;quot;Sb2.Web.Tests._Default&amp;quot; %&amp;gt;&lt;/span&gt;

&lt;span class="kwrd"&gt;&amp;lt;!&lt;/span&gt;&lt;span class="html"&gt;DOCTYPE&lt;/span&gt; &lt;span class="attr"&gt;html&lt;/span&gt; &lt;span class="attr"&gt;PUBLIC&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;html&lt;/span&gt; &lt;span class="attr"&gt;xmlns&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;head&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;head&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;body&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;form&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;form1&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:TextBox&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;txtEmail&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:TextBox&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;br&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:Button&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;btSave&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Save&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;onclick&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;btSave_Click&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;form&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;body&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;html&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;And the Associated Code-Behind&lt;/p&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;[Serializable]
&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Customer
{
    &lt;span class="kwrd"&gt;public&lt;/span&gt; String Email { get; set; }
}
&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; _Default : Page
{
    &lt;span class="kwrd"&gt;public&lt;/span&gt; Customer CurrentCustomer
    {
        get { &lt;span class="kwrd"&gt;return&lt;/span&gt; ViewState[&lt;span class="str"&gt;&amp;quot;Customer&amp;quot;&lt;/span&gt;] &lt;span class="kwrd"&gt;as&lt;/span&gt; Customer; }
        set { ViewState[&lt;span class="str"&gt;&amp;quot;Customer&amp;quot;&lt;/span&gt;] = &lt;span class="kwrd"&gt;value&lt;/span&gt;; }
    }
    &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; OnLoad(EventArgs e)
    {
        &lt;span class="rem"&gt;// Load Customer Data&lt;/span&gt;
        LoadData();

        &lt;span class="kwrd"&gt;base&lt;/span&gt;.OnLoad(e);
    }

    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; LoadData()
    {
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (CurrentCustomer != &lt;span class="kwrd"&gt;null&lt;/span&gt;)
        {
            &lt;span class="kwrd"&gt;this&lt;/span&gt;.txtEmail.Text = CurrentCustomer.Email;
        }
    }

    &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; btSave_Click(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, EventArgs e)
    {
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (CurrentCustomer == &lt;span class="kwrd"&gt;null&lt;/span&gt;)
        {
            CurrentCustomer = &lt;span class="kwrd"&gt;new&lt;/span&gt; Customer();
        }

        CurrentCustomer.Email = &lt;span class="kwrd"&gt;this&lt;/span&gt;.txtEmail.Text;

        &lt;span class="rem"&gt;// Reload Data&lt;/span&gt;
        LoadData();
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;What I do here ?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;On Page Load, i retrieved the Customer Data (Email Address) and Display it in my WebForm TextBox. &lt;/li&gt;

  &lt;li&gt;I modify the Email Address on the Web Page and I Click “Save” button and then Reload Data in order to verify my changes &lt;/li&gt;

  &lt;li&gt;BUT I saw that the Email Address is always the previous value and not my modified value .. WHY ? &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When passing in Debug Mode we see that the &lt;strong&gt;PageLoad&lt;/strong&gt; is called &lt;strong&gt;before&lt;/strong&gt; Enter the Button Click Event, so the Email Address is replaced by the Previous Value of Customer.Email and then when Button Click Event fired it saves the previous value again ..&lt;/p&gt;

&lt;p&gt;Solution : Just Modify the &lt;strong&gt;OnLoad&lt;/strong&gt; method like that&lt;/p&gt;

&lt;div class="csharpcode-wrapper"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; OnLoad(EventArgs e)
{
    &lt;span class="kwrd"&gt;if&lt;/span&gt; (!IsPostBack)
    {
        &lt;span class="rem"&gt;// Load Customer Data&lt;/span&gt;
        LoadData();
    }

    &lt;span class="kwrd"&gt;base&lt;/span&gt;.OnLoad(e);
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;By this, when we are in a PostBack Event (Save Button Click), we don’t call LoadData on PageLoad ! So we keep the modified value in the TextBox.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Hope this help’s!&lt;/p&gt;</description>
      <link>http://blog.sb2.fr/post/2008/12/23/Some-Common-Errors-With-ASPNET.aspx</link>
      <author>yb.nospam@nospam.sb2.fr (xTC)</author>
      <comments>http://blog.sb2.fr/post/2008/12/23/Some-Common-Errors-With-ASPNET.aspx#comment</comments>
      <guid>http://blog.sb2.fr/post.aspx?id=1357b290-ec97-4577-8a6f-3dc877656330</guid>
      <pubDate>Tue, 23 Dec 2008 14:42:58 +0200</pubDate>
      <category>ASP.NET</category>
      <dc:publisher>xTC</dc:publisher>
      <pingback:server>http://blog.sb2.fr/pingback.axd</pingback:server>
      <pingback:target>http://blog.sb2.fr/post.aspx?id=1357b290-ec97-4577-8a6f-3dc877656330</pingback:target>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://blog.sb2.fr/trackback.axd?id=1357b290-ec97-4577-8a6f-3dc877656330</trackback:ping>
      <wfw:comment>http://blog.sb2.fr/post/2008/12/23/Some-Common-Errors-With-ASPNET.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.sb2.fr/syndication.axd?post=1357b290-ec97-4577-8a6f-3dc877656330</wfw:commentRss>
    </item>
  </channel>
</rss>