<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Olivier's Blog</title>
	<atom:link href="http://odalet.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://odalet.wordpress.com</link>
	<description>Dieu a inventé le chat pour que l’homme puisse caresser le tigre</description>
	<lastBuildDate>Wed, 07 Oct 2009 23:59:35 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language></language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='odalet.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/829696e6ebd100152afd70fd2c41fdb8?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Olivier's Blog</title>
		<link>http://odalet.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://odalet.wordpress.com/osd.xml" title="Olivier&#8217;s Blog" />
		<item>
		<title>The &quot;using&quot; pattern</title>
		<link>http://odalet.wordpress.com/2007/03/12/the-using-pattern/</link>
		<comments>http://odalet.wordpress.com/2007/03/12/the-using-pattern/#comments</comments>
		<pubDate>Sun, 11 Mar 2007 23:25:55 +0000</pubDate>
		<dc:creator>Olivier</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[en]]></category>

		<guid isPermaLink="false">http://odalet.wordpress.com/2007/03/12/the-using-pattern/</guid>
		<description><![CDATA[In the previous post, I&#8217;ve discussed how I misused the IDisposable.Dispose() method. Here, I will present some of the ways I use the using keyword in manners that may don&#8217;t come to mind at first (I may in a few years come back to this and realize I was totally wrong, but for now, it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=odalet.wordpress.com&blog=19103&post=38&subd=odalet&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In the <a href="http://odalet.wordpress.com/2007/03/08/mea-culpa-the-isdisposed-anti-pattern/">previous post</a>, I&#8217;ve discussed how I misused the <strong>IDisposable.Dispose() </strong>method. Here, I will present some of the ways I use the <strong>using</strong> keyword in manners that may don&#8217;t come to mind at first (I may in a few years come back to this and realize I was totally wrong, but for now, it seems to me the samples provided here may prove usefull).</p>
<p>According to <a href="http://msdn2.microsoft.com/en-us/library/yh598w02(VS.80).aspx">msdn</a>, the <strong>using</strong> statement &#8220;<em>Defines a scope, outside of which an object or objects will be disposed</em>&#8220;. In the remarks section of the documentation, it is also stated that &#8220;<em>The <strong>using</strong> statement allows the programmer to specify when objects that use resources should release them</em>&#8220;. And the next sentence: &#8220;<em>The object provided to the <strong>using</strong> statement must implement the <strong>IDisposable</strong> interface. This interface provides the <strong>Dispose</strong> method, which should release the object&#8217;s resources</em>&#8220;. Everything&#8217;s ok about all this, expect one little thing: by insisting on resources, it drives people to use the <strong>using</strong> keyword only with objects holding resources, or locks, or connections or whatever needs to be released to the system&#8230; </p>
<p>I think this statement can be used in an extensible manner for any object that:</p>
<ul>
<li>lives in a finite scope  </li>
<li>needs an action to be done when created and another one when you don&#8217;t need it any more.</li>
</ul>
<p>For instance, when it&#8217;s dark, and I want to write something, I need some light. So I turn it on, write my post, and turn it off before going to bed. This could be writtent this way in C#:</p>
<p><font face="Courier New">SwitchOnLight();<br />WriteThisPost();<br />SubmitIt();&nbsp;&nbsp;&nbsp;<br />SwitchOffLight();<br />GotoBed();</font></p>
<p>There are times when I&#8217;m quite tired, and I may forget to switch off the light before going to bed. This results in this code:</p>
<p><font face="Courier New">SwitchOnLight();<br />WriteThisPost();<br />SubmitIt();&nbsp;&nbsp;&nbsp;<br />GotoBed();</font></p>
<p>Here, C# programmers will have recognized that some kind of <strong>Dispose()</strong> call is missing. Enters the <strong>using </strong>keyword which allows me to write:</p>
<p><font face="Courier New">using(Light) <br />{&nbsp;</font><font face="Courier New"><br />&nbsp;&nbsp;&nbsp; WriteThisPost();<br />&nbsp;&nbsp;&nbsp; SubmitIt();&nbsp;&nbsp;&nbsp;&nbsp;<br />}<br />GoToBed();</font></p>
<p>And thus, I never forget to turn off the light before going to bed. </p>
<p>I really like the metaphor the <strong>using</strong>&nbsp;keyword provides, and I&#8217;d like to be able to use it even for objects that don&#8217;t hold any system resource. As the samples below demonstrate it, there&#8217;s nothing preventing me from doing so. The main idea is that any object that needs to do something when created, and something else when released is a good candidate for the <strong>using</strong> keyword: these two tasks are implemented in the constructor and in the <strong>IDisposable.Dispose()</strong> method. The task executed in the <strong>Dispose()</strong> method hasn&#8217;t to release resources. In fact, most of the times, It just restores a saved state.</p>
<p><u>Example 1:</u></p>
<p>In most of my windows forms applications, I&nbsp;use a base form class providing some goodies to inheritors (one of them is a wonderfull linear gradient I apply on the background of my forms &#8211; question of taste). Among these services is <strong>WaitCursor</strong>. Usually when you want to show an hourglass cursor while processing a lengthy task, you have to follow three steps:</p>
<ol>
<li>Change the cusor: <strong>this.Cursor = Cursors.WaitCursor;</strong>  </li>
<li>Execute the lengthy task in a <strong>try</strong> block  </li>
<li>Restore the normal cursor in a finally clause: <strong>finally { this.Cursor = Cursors.Default; }</strong></li>
</ol>
<p>I&#8217;ve built up a little helper class (completed with a property) which allows you to write this code, (which seems more readable to me : it&#8217;s almost well formed English):</p>
<p><font face="Courier New">using(WaitCursor) { /* execute lengthy task */ }</font></p>
<p>First, in the base form class, <strong>WaitCursor</strong>&nbsp;is a property returning an <strong>IDisposable</strong>:</p>
<p><font face="Courier New">protected IDisposable WaitCursor <br />{ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; get { return new CursorProvider(this, Cursors.Wait); } <br />}</font></p>
<p>And <strong>CursorProvider</strong> is a private inner class also defined in the base form class:</p>
<p><font face="Courier New">private class CursorProvider : IDisposable<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Control owner = null;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Cursor savedCursor = Cursors.Default;</font></p>
<p><font face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public CursorProvider(Control control, Cursor newCursor)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (control == null) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; throw new ArgumentNullException(&#8220;control&#8221;);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (newCursor == null)&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw new ArgumentNullException(&#8220;newCursor&#8221;);</font></p>
<p><font face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; owner = control;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; savedCursor = control.Cursor;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; control.Cursor = newCursor;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; control.Refresh();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</font></p>
<p><font face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #region IDisposable Members</font></p>
<p><font face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public void Dispose() { owner.Cursor = savedCursor; }</font></p>
<p><font face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion</font><font face="Courier New"><br />}</font></p>
<p>A few explanations:</p>
<ul>
<li>The property is returning an <strong>IDisposable</strong> instance: indeed, callers don&#8217;t have to know anything else (it is intendeed to be part of a <strong>using</strong> statement) so, why would I expose more?  </li>
<li>Each time the property is called, a new object is created: you can overlap as many <strong>using</strong> statements as you wish,&nbsp;after the last closing bracket, the correct cursor will be restored.  </li>
<li>We never need the object created by the call to the property, thus the <strong>using(WaitCursor)</strong> and not some <strong>using(IDisposable foo = WaitCursor)</strong>.  </li>
<li>The class is straightforward: the constructor, after checking for null parameters, saves the current state (the current control&#8217;s cursor) then sets the new state. Inside&nbsp;<strong>Dispose()</strong> (which will always be called at the end of the <strong>using</strong> block, wether an exception has been thrown or not), the state is restored.</li>
</ul>
<p><u>Example 2:</u> <a href="http://odalet.wordpress.com/2006/08/23/saving-the-state-of-a-graphics-object/">Saving the state of a Graphics object</a>. In this old post, I exposed a way of using the <strong>GraphicsContainer</strong> class. And I wrapped it in an <strong>IDisposable</strong> object (one time again, the idea is to save a state in the constructor, and to restore it in <strong>Dispose()</strong>).</p>
<p><u>Example 3:</u> <a href="http://msdn.microsoft.com/msdnmag/issues/06/09/NETMatters">.NET Matters: Scope and more</a>. In this article from MSDN Magazine, Stephen Toub explains how to code a <strong>Scope&lt;T&gt;</strong> class to provide transactionnal behavior. This is an advanced example of&nbsp;a class&nbsp;that fits perfectly well with the <strong>using </strong>syntax. Besides the link with this post regarding the <strong>using</strong> statement, this article also discusses many other interesting .NET concepts (and in particular, the notion of thread static members). The second short article about the <strong>Semaphore</strong> class is again an example of a pretty use of the <strong>using</strong> statement.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/odalet.wordpress.com/38/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/odalet.wordpress.com/38/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/odalet.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/odalet.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/odalet.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/odalet.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/odalet.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/odalet.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/odalet.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/odalet.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/odalet.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/odalet.wordpress.com/38/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=odalet.wordpress.com&blog=19103&post=38&subd=odalet&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://odalet.wordpress.com/2007/03/12/the-using-pattern/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/84b83058bc6f6bf7a2d9a998c3a63854?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">odalet</media:title>
		</media:content>
	</item>
		<item>
		<title>Mea culpa: the IsDisposed anti-pattern</title>
		<link>http://odalet.wordpress.com/2007/03/08/mea-culpa-the-isdisposed-anti-pattern/</link>
		<comments>http://odalet.wordpress.com/2007/03/08/mea-culpa-the-isdisposed-anti-pattern/#comments</comments>
		<pubDate>Thu, 08 Mar 2007 20:32:52 +0000</pubDate>
		<dc:creator>Olivier</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[en]]></category>

		<guid isPermaLink="false">http://odalet.wordpress.com/2007/03/08/mea-culpa-the-isdisposed-anti-pattern/</guid>
		<description><![CDATA[Back a few years ago, when I was still a new-born at C# and .NET programming, I had found myself very proud for having improved the .NET framework itself. Indeed, I had just invented the IDisposableEx interface:
public interface IDisposableEx : IDisposable{&#160;&#160;&#160;&#160; bool IsDisposed { get; }}
What did I use this interface for? It seemed to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=odalet.wordpress.com&blog=19103&post=37&subd=odalet&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Back a few years ago, when I was still a new-born at C# and .NET programming, I had found myself very proud for having improved the .NET framework itself. Indeed, I had just invented the <strong>IDisposableEx</strong> interface:</p>
<p><font face="Courier New">public interface IDisposableEx : IDisposable<br /></font><font face="Courier New">{<br /></font><font face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp; bool IsDisposed { get; }<br /></font><font face="Courier New">}</font></p>
<p>What did I use this interface for? It seemed to me a great improvement to be able to know whether or not an object had been disposed. And I was writing code like this:</p>
<p><font face="Courier New">if (!myObject.IsDisposed) myObject.Dispose();</font></p>
<p>Here lie two style errors: </p>
<ol>
<li>Not so a serious one: why calling <strong>Dispose()</strong> when a <strong>using</strong> construct would make it perfectly useless (As of now, I only call <strong>Dispose()</strong> when the object is not instanciated in the method that will dispose it)?  </li>
<li>The real big one: what is the use of the&nbsp;test on the disposed state of the object? Microsoft clearly states that a <strong>Dispose()</strong> method call should <strong>NEVER EVER</strong> fail (see <a href="http://msdn2.microsoft.com/en-us/library/system.idisposable.dispose.aspx">msdn</a>). One could call <strong>Dispose()</strong> thousands of times, there should never happen any exception. So, the test is useless.</li>
</ol>
<p>On the other hand, one could argue that testing the disposed state of the object isn&#8217;t that serious&#8230; and I agree with this; in fact, what is really misconcepted in the <strong>IDisposableEx</strong> interface is not how you use it, but what it supposes can happen inside the implementor: by allowing to test the disposed state, this interface suggests that the behavior of the<strong> Dispose()</strong> method depends on the state of the object. And even worse: if you call <strong>Dispose()</strong> and the<strong> IsDisposed</strong> property was true, then <strong>Dispose()</strong> might fail! And in some of my implementations, it did! In my mind providing a means of testing was good enough, and if your app ended with an uncaught exception, it was the developper&#8217;s fault: <em>why didn&#8217;t you test <strong>IsDisposed</strong>?</em>&#8230; my apologies go to&nbsp;them&#8230;&nbsp;</p>
<p>The correct way to handle&nbsp;multiple calls to <strong>Dispose()</strong>&nbsp;is actually to store a disposed state, but it must be inner to the object and calling code must never rely on it (so I&#8217;d &nbsp;better make this private, and remove the <strong>IDisposableEx</strong> interface &#8211; from source control if I can, so that no one ever discovers my crime):</p>
<p><font face="Courier New">private bool disposed = false;<br />&#8230;<br />public void Dispose()<br />{<br />&nbsp;&nbsp;&nbsp; if (disposed) return;<br /></font><font face="Courier New"><br />&nbsp;&nbsp;&nbsp; // disposing of allocated resources<br />&nbsp;&nbsp;&nbsp; &#8230;<br />&nbsp;&nbsp;&nbsp; // now, don&#8217;t forget to set the disposed state</font><font face="Courier New"><br />&nbsp;&nbsp;&nbsp; disposed = true; <br />}</font></p>
<p>I hope that having revealed a part of my dark past will help you not to&nbsp;make that&nbsp;mistake, or at least will it have made you laugh a bit.</p>
<p>&nbsp;</p>
<p><u>PS:</u> I can&#8217;t think of a scenario right now where a caller should be aware of the disposed state of the callee, but in such a case, the <strong>IsDisposed</strong> property seems acceptable (if you don&#8217;t want to catch numbers of <a href="http://msdn2.microsoft.com/en-us/library/system.objectdisposedexception.aspx"><strong>ObjectDisposedException</strong></a>). But I think&nbsp;this would be a really bad idea to provide this property as part of an interface&#8230; Or at least should this interface be named something like <strong>IDisposedStateNotifier</strong> so that developpers don&#8217;t think it modifies the <strong>IDisposable.Dispose</strong> standard&nbsp;behavior&#8230;</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/odalet.wordpress.com/37/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/odalet.wordpress.com/37/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/odalet.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/odalet.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/odalet.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/odalet.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/odalet.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/odalet.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/odalet.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/odalet.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/odalet.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/odalet.wordpress.com/37/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=odalet.wordpress.com&blog=19103&post=37&subd=odalet&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://odalet.wordpress.com/2007/03/08/mea-culpa-the-isdisposed-anti-pattern/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/84b83058bc6f6bf7a2d9a998c3a63854?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">odalet</media:title>
		</media:content>
	</item>
		<item>
		<title>Log4Net: IP parsing bug when used with framework .NET 2.0</title>
		<link>http://odalet.wordpress.com/2007/01/13/log4net-ip-parsing-bug-when-used-with-framework-net-20/</link>
		<comments>http://odalet.wordpress.com/2007/01/13/log4net-ip-parsing-bug-when-used-with-framework-net-20/#comments</comments>
		<pubDate>Sat, 13 Jan 2007 00:20:29 +0000</pubDate>
		<dc:creator>Olivier</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[en]]></category>

		<guid isPermaLink="false">http://odalet.wordpress.com/2007/01/13/log4net-ip-parsing-bug-when-used-with-framework-net-20/</guid>
		<description><![CDATA[ 
Update (2008/08/21):
As stated by SergeS in his comment, the solution I provide below (while working)  should not be used any more. Instead, replace your src/Appender/UdpAppender.cs file with the one found here:
https://svn.apache.org/viewvc/logging/log4net/trunk/src/Appender/UdpAppender.cs?revision=506603
I&#8217;m using log4net 1.2.10 for a few month now and couldn&#8217;t ever get rid of it. Today I was playing with the udp appender: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=odalet.wordpress.com&blog=19103&post=35&subd=odalet&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><span style="font-family:Trebuchet MS;font-size:x-small;"> </span></p>
<p><span style="color:#ff0000;"><strong>Update (2008/08/21):</strong></span></p>
<p>As stated by SergeS in his comment, the solution I provide below (while working)  should not be used any more. Instead, replace your src/Appender/UdpAppender.cs file with the one found here:</p>
<p><a href="https://svn.apache.org/viewvc/logging/log4net/trunk/src/Appender/UdpAppender.cs?revision=506603">https://svn.apache.org/viewvc/logging/log4net/trunk/src/Appender/UdpAppender.cs?revision=506603</a></p>
<p><span style="font-family:Trebuchet MS;font-size:x-small;">I&#8217;m using <a href="http://logging.apache.org/log4net/">log4net 1.2.10</a> for a few month now and couldn&#8217;t ever get rid of it. Today I was playing with the <a href="http://logging.apache.org/log4net/release/config-examples.html#udpappender">udp appender</a>: I was trying to have my application send logs via udp to <a href="http://www.devintelligence.com/log4netviewer/">Log4NetViewer</a>&#8230; and nothing happened. After having enabled the log4net debug mode <a href="#rem1">(1)</a>, I could see there was something wrong with the way log4net parsed my IP <a href="#rem2">(2)</a>: </span></p>
<p><code>log4nelog4net:ERROR [UdpAppender] Unable to send logging event to remote host ::1 on port 1234.<br />
System.Net.Sockets.SocketException: Une adresse incompatible avec le protocole demandé a été utilisée<br />
à System.Net.Sockets.Socket.SendTo(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, EndPoint remoteEP)<br />
à System.Net.Sockets.UdpClient.Send(Byte[] dgram, Int32 bytes, IPEndPoint endPoint)<br />
à log4net.Appender.UdpAppender.Append(LoggingEvent loggingEvent)</code></p>
<p><span style="font-family:Trebuchet MS;font-size:x-small;">log4net was transforming my &#8220;192.168.0.2&#8243; parameter IP into ::1, and the problem took place in the method IPAddressConverter.ConvertFrom() (the file is located under </span><span style="font-family:Courier New;">log4net-1.2.10\src\Util\TypeConverters\IPAddressConverter.cs</span>).<br />
<span style="font-family:Trebuchet MS;font-size:x-small;">The problem is that when compiled with .NET 2.0, the original code is returning the first IP address associated with the host (host itself returned by a dns lookup):</span></p>
<pre><span style="color:#008080;font-size:x-small;">IPHostEntry</span><span style="font-size:x-small;"> host = </span><span style="color:#008080;font-size:x-small;">Dns</span><span style="font-size:x-small;">.GetHostEntry(str);</span><span style="color:#0000ff;font-size:x-small;">
if</span><span style="font-size:x-small;"> (host != </span><span style="color:#0000ff;font-size:x-small;">null</span><span style="font-size:x-small;"> &amp;&amp;
    host.AddressList != </span><span style="color:#0000ff;font-size:x-small;">null</span><span style="font-size:x-small;"> &amp;&amp;
    host.AddressList.Length &gt; 0 &amp;&amp;
    host.AddressList[0] != </span><span style="color:#0000ff;font-size:x-small;">null</span><span style="font-size:x-small;">)
{ </span>
    <span style="color:#0000ff;font-size:x-small;">return</span><span style="font-size:x-small;"> host.AddressList[0];
}</span></pre>
<p><span style="font-family:Trebuchet MS;">When inspecting the content of this address list with the debugger I got:</span></p>
<p><span style="font-family:Courier New;font-size:x-small;">+        [0]    {::1}    System.Net.IPAddress<br />
+        [1]    {192.168.0.2}    System.Net.IPAddress<br />
+        [2]    {192.168.206.1}    System.Net.IPAddress<br />
+        [3]    {192.168.114.1}    System.Net.IPAddress</span><span style="font-family:Courier New;"><br />
</span></p>
<p><span style="font-family:Trebuchet MS;font-size:x-small;">So, with the existing code, the address ::1 is selected&#8230; and the UdpAppender throws an exception <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' />  To avoid this:<br />
first I added this property to IPAddressConverter:</span></p>
<p><span style="color:#0000ff;font-size:x-small;">public</span><span style="font-size:x-small;"> </span><span style="color:#0000ff;font-size:x-small;">bool</span><span style="font-size:x-small;"> IsIPv6Supported { </span><span style="color:#0000ff;font-size:x-small;">get</span><span style="font-size:x-small;"> { </span><span style="color:#0000ff;font-size:x-small;">return</span><span style="font-size:x-small;"> </span><span style="color:#0000ff;font-size:x-small;">false</span><span style="font-size:x-small;">; } }</span></p>
<p><span style="font-family:Trebuchet MS;font-size:x-small;">note that I&#8217;m not networking aware, and thus this may be replaced by some code able to detect wether or not IP v6 is supported&#8230;<br />
then I replaced &#8220;</span><span style="color:#0000ff;font-size:x-small;">return</span><span style="font-size:x-small;"> host.AddressList[0];</span>&#8221; with:</p>
<pre><span style="color:#0000ff;font-size:x-small;">foreach</span><span style="font-size:x-small;"> (</span><span style="color:#008080;font-size:x-small;">IPAddress</span><span style="font-size:x-small;"> address </span><span style="color:#0000ff;font-size:x-small;">in</span><span style="font-size:x-small;"> host.AddressList)
{
    </span><span style="color:#0000ff;font-size:x-small;">if</span><span style="font-size:x-small;"> ((address.AddressFamily ==
        System.Net.Sockets.</span><span style="color:#008080;font-size:x-small;">AddressFamily</span><span style="font-size:x-small;">.InterNetworkV6) &amp;&amp;
        !IsIPv6Supported) </span><span style="color:#0000ff;font-size:x-small;">
        continue</span><span style="font-size:x-small;">;
                                </span>
<span style="color:#0000ff;font-size:x-small;">    return</span><span style="font-size:x-small;"> address;
</span><span style="font-size:x-small;">}</span></pre>
<pre><span style="font-family:Trebuchet MS;font-size:x-small;">This way, I return the first IPv4 address instead of the first address.Hope this helps </span></pre>
<p><span style="font-family:Trebuchet MS;color:#000000;font-size:x-small;"><a id="rem1"><span style="color:#000000;">(1) to do so, just add the following xml to your app.config:</span> </a></span></p>
<p><span style="color:#0000ff;font-size:x-small;">&lt;</span><span style="color:#800000;font-size:x-small;">appSettings</span><span style="color:#0000ff;font-size:x-small;">&gt;<br />
</span><span style="color:#0000ff;font-size:x-small;">&lt;</span><span style="color:#800000;font-size:x-small;">add</span><span style="color:#0000ff;font-size:x-small;"> </span><span style="color:#ff0000;font-size:x-small;">key</span><span style="color:#0000ff;font-size:x-small;">=</span><span style="font-size:x-small;">&#8220;</span><span style="color:#0000ff;font-size:x-small;">log4net.Internal.Debug</span><span style="font-size:x-small;">&#8220;</span><span style="color:#0000ff;font-size:x-small;"> </span><span style="color:#ff0000;font-size:x-small;">value</span><span style="color:#0000ff;font-size:x-small;">=</span><span style="font-size:x-small;">&#8220;</span><span style="color:#0000ff;font-size:x-small;">true</span><span style="font-size:x-small;">&#8220;</span><span style="color:#0000ff;font-size:x-small;">/&gt;<br />
&lt;/</span><span style="color:#800000;font-size:x-small;">appSettings</span><span style="color:#0000ff;font-size:x-small;">&gt;</span></p>
<p><span style="font-family:Courier New;font-size:x-small;"> </span></p>
<p><span style="font-family:Courier New;font-size:x-small;"> </span></p>
<p><span style="font-family:Courier New;font-size:x-small;"> </span></p>
<p><span style="font-family:Courier New;font-size:x-small;"> </span></p>
<p><span style="font-family:Trebuchet MS;color:#000000;font-size:x-small;">(2) aproximatively translated from French into English: The used address is incompatible with the requested protocol</span><span style="font-family:Trebuchet MS;color:#000000;font-size:x-small;"> </span></p>
<p><span style="font-family:Trebuchet MS;color:#000000;font-size:x-small;">PS: if you want to compile the log4net visual studio project provided with the distribution, you have to apply these guidelines: <a href="http://logging.apache.org/log4net/release/building.html#vsnet-2005">http://logging.apache.org/log4net/release/building.html#vsnet-2005</a></span></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/odalet.wordpress.com/35/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/odalet.wordpress.com/35/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/odalet.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/odalet.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/odalet.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/odalet.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/odalet.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/odalet.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/odalet.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/odalet.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/odalet.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/odalet.wordpress.com/35/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=odalet.wordpress.com&blog=19103&post=35&subd=odalet&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://odalet.wordpress.com/2007/01/13/log4net-ip-parsing-bug-when-used-with-framework-net-20/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/84b83058bc6f6bf7a2d9a998c3a63854?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">odalet</media:title>
		</media:content>
	</item>
		<item>
		<title>Le dino a bien grandi</title>
		<link>http://odalet.wordpress.com/2007/01/05/le-dino-a-bien-grandi/</link>
		<comments>http://odalet.wordpress.com/2007/01/05/le-dino-a-bien-grandi/#comments</comments>
		<pubDate>Fri, 05 Jan 2007 19:06:07 +0000</pubDate>
		<dc:creator>Olivier</dc:creator>
				<category><![CDATA[fr]]></category>
		<category><![CDATA[misc]]></category>

		<guid isPermaLink="false">http://odalet.wordpress.com/2007/01/05/le-dino-a-bien-grandi/</guid>
		<description><![CDATA[Et voilà le résultat, après quelques jours passés à se gonfler d&#8217;eau :

       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=odalet.wordpress.com&blog=19103&post=32&subd=odalet&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Et voilà le résultat, après quelques jours passés à se gonfler d&#8217;eau :</p>
<p><a href="http://odalet.files.wordpress.com/2007/01/windowslivewriterledinoabiengrandi-e827dino11.jpg"><img src="http://odalet.files.wordpress.com/2007/01/windowslivewriterledinoabiengrandi-e827dino2.jpg?w=240&#038;h=208" style="border-width:0;" height="208" width="240" /></a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/odalet.wordpress.com/32/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/odalet.wordpress.com/32/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/odalet.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/odalet.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/odalet.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/odalet.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/odalet.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/odalet.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/odalet.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/odalet.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/odalet.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/odalet.wordpress.com/32/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=odalet.wordpress.com&blog=19103&post=32&subd=odalet&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://odalet.wordpress.com/2007/01/05/le-dino-a-bien-grandi/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/84b83058bc6f6bf7a2d9a998c3a63854?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">odalet</media:title>
		</media:content>

		<media:content url="http://odalet.files.wordpress.com/2007/01/windowslivewriterledinoabiengrandi-e827dino2.jpg" medium="image" />
	</item>
		<item>
		<title>.NET 3.0 is out!</title>
		<link>http://odalet.wordpress.com/2006/11/09/net-30-is-out/</link>
		<comments>http://odalet.wordpress.com/2006/11/09/net-30-is-out/#comments</comments>
		<pubDate>Wed, 08 Nov 2006 23:21:59 +0000</pubDate>
		<dc:creator>Olivier</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[en]]></category>

		<guid isPermaLink="false">http://odalet.wordpress.com/2006/11/09/net-30-is-out/</guid>
		<description><![CDATA[Great news: .NET Framework 3.0 has been released!
Formerly known as WinFx, the .NET framework 3.0 is a set of (3 main) components built on top of the .NET framework 2.0 (this means that this &#8220;3rd&#8221; version is 100% compatible with .NET 2.0: it is pure .NET 2.0 code&#8230;):

Windows communication foundation (formerly known as Indigo)
Windows workflow [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=odalet.wordpress.com&blog=19103&post=29&subd=odalet&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Great news: <a href="http://www.netfx3.com/blogs/news_and_announcements/archive/2006/11/06/.NET-Framework-3.0-has-been-released_2100_.aspx">.NET Framework 3.0 has been released!</a></p>
<p>Formerly known as WinFx, the .NET framework 3.0 is a set of (3 main) components built on top of the .NET framework 2.0 (this means that this &#8220;3rd&#8221; version is 100% compatible with .NET 2.0: it is pure .NET 2.0 code&#8230;):</p>
<ul>
<li>Windows communication foundation (formerly known as Indigo)</li>
<li>Windows workflow foundation</li>
<li>Windows presentation foundation (formerly known as Avalon)</li>
<li>and the little last one: Cardspace</li>
</ul>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/odalet.wordpress.com/29/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/odalet.wordpress.com/29/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/odalet.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/odalet.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/odalet.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/odalet.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/odalet.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/odalet.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/odalet.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/odalet.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/odalet.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/odalet.wordpress.com/29/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=odalet.wordpress.com&blog=19103&post=29&subd=odalet&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://odalet.wordpress.com/2006/11/09/net-30-is-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/84b83058bc6f6bf7a2d9a998c3a63854?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">odalet</media:title>
		</media:content>
	</item>
		<item>
		<title>Useful memo: Windows messages</title>
		<link>http://odalet.wordpress.com/2006/10/30/useful-memo-windows-messages/</link>
		<comments>http://odalet.wordpress.com/2006/10/30/useful-memo-windows-messages/#comments</comments>
		<pubDate>Mon, 30 Oct 2006 13:57:28 +0000</pubDate>
		<dc:creator>Olivier</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[en]]></category>

		<guid isPermaLink="false">http://odalet.wordpress.com/2006/10/30/useful-memo-windows-messages/</guid>
		<description><![CDATA[Grabbed from this url (may only contain most useful definitions): http://www.groupsrv.com/dotnet/about52848.html:
WM_NULL                   = 0&#215;0000,
WM_CREATE                 = 0&#215;0001,
WM_DESTROY       [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=odalet.wordpress.com&blog=19103&post=28&subd=odalet&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Grabbed from this url (may only contain most useful definitions): <a href="http://www.groupsrv.com/dotnet/about52848.html">http://www.groupsrv.com/dotnet/about52848.html</a>:</p>
<p>WM_NULL                   = 0&#215;0000,<br />
WM_CREATE                 = 0&#215;0001,<br />
WM_DESTROY                = 0&#215;0002,<br />
WM_MOVE                   = 0&#215;0003,<br />
WM_SIZE                   = 0&#215;0005,<br />
WM_ACTIVATE               = 0&#215;0006,<br />
WM_SETFOCUS               = 0&#215;0007,<br />
WM_KILLFOCUS              = 0&#215;0008,<br />
WM_ENABLE                 = 0&#215;000A,<br />
WM_SETREDRAW              = 0&#215;000B,<br />
WM_SETTEXT                = 0&#215;000C,<br />
WM_GETTEXT                = 0&#215;000D,<br />
WM_GETTEXTLENGTH          = 0&#215;000E,<br />
WM_PAINT                  = 0&#215;000F,<br />
WM_CLOSE                  = 0&#215;0010,<br />
WM_QUERYENDSESSION        = 0&#215;0011,<br />
WM_QUIT                   = 0&#215;0012,<br />
WM_QUERYOPEN              = 0&#215;0013,<br />
WM_ERASEBKGND             = 0&#215;0014,<br />
WM_SYSCOLORCHANGE         = 0&#215;0015,<br />
WM_ENDSESSION             = 0&#215;0016,<br />
WM_SHOWWINDOW             = 0&#215;0018,<br />
WM_CTLCOLOR               = 0&#215;0019,<br />
WM_WININICHANGE           = 0&#215;001A,<br />
WM_SETTINGCHANGE          = 0&#215;001A,<br />
WM_DEVMODECHANGE          = 0&#215;001B,<br />
WM_ACTIVATEAPP            = 0&#215;001C,<br />
WM_FONTCHANGE             = 0&#215;001D,<br />
WM_TIMECHANGE             = 0&#215;001E,<br />
WM_CANCELMODE             = 0&#215;001F,<br />
WM_SETCURSOR              = 0&#215;0020,<br />
WM_MOUSEACTIVATE          = 0&#215;0021,<br />
WM_CHILDACTIVATE          = 0&#215;0022,<br />
WM_QUEUESYNC              = 0&#215;0023,<br />
WM_GETMINMAXINFO          = 0&#215;0024,<br />
WM_PAINTICON              = 0&#215;0026,<br />
WM_ICONERASEBKGND         = 0&#215;0027,<br />
WM_NEXTDLGCTL             = 0&#215;0028,<br />
WM_SPOOLERSTATUS          = 0&#215;002A,<br />
WM_DRAWITEM               = 0&#215;002B,<br />
WM_MEASUREITEM            = 0&#215;002C,<br />
WM_DELETEITEM             = 0&#215;002D,<br />
WM_VKEYTOITEM             = 0&#215;002E,<br />
WM_CHARTOITEM             = 0&#215;002F,<br />
WM_SETFONT                = 0&#215;0030,<br />
WM_GETFONT                = 0&#215;0031,<br />
WM_SETHOTKEY              = 0&#215;0032,<br />
WM_GETHOTKEY              = 0&#215;0033,<br />
WM_QUERYDRAGICON          = 0&#215;0037,<br />
WM_COMPAREITEM            = 0&#215;0039,<br />
WM_GETOBJECT              = 0&#215;003D,<br />
WM_COMPACTING             = 0&#215;0041,<br />
WM_COMMNOTIFY             = 0&#215;0044 ,<br />
WM_WINDOWPOSCHANGING      = 0&#215;0046,<br />
WM_WINDOWPOSCHANGED       = 0&#215;0047,<br />
WM_POWER                  = 0&#215;0048,<br />
WM_COPYDATA               = 0&#215;004A,<br />
WM_CANCELJOURNAL          = 0&#215;004B,<br />
WM_NOTIFY                 = 0&#215;004E,<br />
WM_INPUTLANGCHANGEREQUEST = 0&#215;0050,<br />
WM_INPUTLANGCHANGE        = 0&#215;0051,<br />
WM_TCARD                  = 0&#215;0052,<br />
WM_HELP                   = 0&#215;0053,<br />
WM_USERCHANGED            = 0&#215;0054,<br />
WM_NOTIFYFORMAT           = 0&#215;0055,<br />
WM_CONTEXTMENU            = 0&#215;007B,<br />
WM_STYLECHANGING          = 0&#215;007C,<br />
WM_STYLECHANGED           = 0&#215;007D,<br />
WM_DISPLAYCHANGE          = 0&#215;007E,<br />
WM_GETICON                = 0&#215;007F,<br />
WM_SETICON                = 0&#215;0080,<br />
WM_NCCREATE               = 0&#215;0081,<br />
WM_NCDESTROY              = 0&#215;0082,<br />
WM_NCCALCSIZE             = 0&#215;0083,<br />
WM_NCHITTEST              = 0&#215;0084,<br />
WM_NCPAINT                = 0&#215;0085,<br />
WM_NCACTIVATE             = 0&#215;0086,<br />
WM_GETDLGCODE             = 0&#215;0087,<br />
WM_SYNCPAINT              = 0&#215;0088,<br />
WM_NCMOUSEMOVE            = 0&#215;00A0,<br />
WM_NCLBUTTONDOWN          = 0&#215;00A1,<br />
WM_NCLBUTTONUP            = 0&#215;00A2,<br />
WM_NCLBUTTONDBLCLK        = 0&#215;00A3,<br />
WM_NCRBUTTONDOWN          = 0&#215;00A4,<br />
WM_NCRBUTTONUP            = 0&#215;00A5,<br />
WM_NCRBUTTONDBLCLK        = 0&#215;00A6,<br />
WM_NCMBUTTONDOWN          = 0&#215;00A7,<br />
WM_NCMBUTTONUP            = 0&#215;00A8,<br />
WM_NCMBUTTONDBLCLK        = 0&#215;00A9,<br />
WM_KEYDOWN                = 0&#215;0100,<br />
WM_KEYUP                  = 0&#215;0101,<br />
WM_CHAR                   = 0&#215;0102,<br />
WM_DEADCHAR               = 0&#215;0103,<br />
WM_SYSKEYDOWN             = 0&#215;0104,<br />
WM_SYSKEYUP               = 0&#215;0105,<br />
WM_SYSCHAR                = 0&#215;0106,<br />
WM_SYSDEADCHAR            = 0&#215;0107,<br />
WM_KEYLAST                = 0&#215;0108,<br />
WM_IME_STARTCOMPOSITION   = 0&#215;010D,<br />
WM_IME_ENDCOMPOSITION     = 0&#215;010E,<br />
WM_IME_COMPOSITION        = 0&#215;010F,<br />
WM_IME_KEYLAST            = 0&#215;010F,<br />
WM_INITDIALOG             = 0&#215;0110,<br />
WM_COMMAND                = 0&#215;0111,<br />
WM_SYSCOMMAND             = 0&#215;0112,<br />
WM_TIMER                  = 0&#215;0113,<br />
WM_HSCROLL                = 0&#215;0114,<br />
WM_VSCROLL                = 0&#215;0115,<br />
WM_INITMENU               = 0&#215;0116,<br />
WM_INITMENUPOPUP          = 0&#215;0117,<br />
WM_MENUSELECT             = 0&#215;011F,<br />
WM_MENUCHAR               = 0&#215;0120,<br />
WM_ENTERIDLE              = 0&#215;0121,<br />
WM_MENURBUTTONUP          = 0&#215;0122,<br />
WM_MENUDRAG               = 0&#215;0123,<br />
WM_MENUGETOBJECT          = 0&#215;0124,<br />
WM_UNINITMENUPOPUP        = 0&#215;0125,<br />
WM_MENUCOMMAND            = 0&#215;0126,<br />
WM_CTLCOLORMSGBOX         = 0&#215;0132,<br />
WM_CTLCOLOREDIT           = 0&#215;0133,<br />
WM_CTLCOLORLISTBOX        = 0&#215;0134,<br />
WM_CTLCOLORBTN            = 0&#215;0135,<br />
WM_CTLCOLORDLG            = 0&#215;0136,<br />
WM_CTLCOLORSCROLLBAR      = 0&#215;0137,<br />
WM_CTLCOLORSTATIC         = 0&#215;0138,<br />
WM_MOUSEMOVE              = 0&#215;0200,<br />
WM_LBUTTONDOWN            = 0&#215;0201,<br />
WM_LBUTTONUP              = 0&#215;0202,<br />
WM_LBUTTONDBLCLK          = 0&#215;0203,<br />
WM_RBUTTONDOWN            = 0&#215;0204,<br />
WM_RBUTTONUP              = 0&#215;0205,<br />
WM_RBUTTONDBLCLK          = 0&#215;0206,<br />
WM_MBUTTONDOWN            = 0&#215;0207,<br />
WM_MBUTTONUP              = 0&#215;0208,<br />
WM_MBUTTONDBLCLK          = 0&#215;0209,<br />
WM_MOUSEWHEEL             = 0&#215;020A,<br />
WM_PARENTNOTIFY           = 0&#215;0210,<br />
WM_ENTERMENULOOP          = 0&#215;0211,<br />
WM_EXITMENULOOP           = 0&#215;0212,<br />
WM_NEXTMENU               = 0&#215;0213,<br />
WM_SIZING                 = 0&#215;0214,<br />
WM_CAPTURECHANGED         = 0&#215;0215,<br />
WM_MOVING                 = 0&#215;0216,<br />
WM_DEVICECHANGE           = 0&#215;0219,<br />
WM_MDICREATE              = 0&#215;0220,<br />
WM_MDIDESTROY             = 0&#215;0221,<br />
WM_MDIACTIVATE            = 0&#215;0222,<br />
WM_MDIRESTORE             = 0&#215;0223,<br />
WM_MDINEXT                = 0&#215;0224,<br />
WM_MDIMAXIMIZE            = 0&#215;0225,<br />
WM_MDITILE                = 0&#215;0226,<br />
WM_MDICASCADE             = 0&#215;0227,<br />
WM_MDIICONARRANGE         = 0&#215;0228,<br />
WM_MDIGETACTIVE           = 0&#215;0229,<br />
WM_MDISETMENU             = 0&#215;0230,<br />
WM_ENTERSIZEMOVE          = 0&#215;0231,<br />
WM_EXITSIZEMOVE           = 0&#215;0232,<br />
WM_DROPFILES              = 0&#215;0233,<br />
WM_MDIREFRESHMENU         = 0&#215;0234,<br />
WM_IME_SETCONTEXT         = 0&#215;0281,<br />
WM_IME_NOTIFY             = 0&#215;0282,<br />
WM_IME_CONTROL            = 0&#215;0283,<br />
WM_IME_COMPOSITIONFULL    = 0&#215;0284,<br />
WM_IME_SELECT             = 0&#215;0285,<br />
WM_IME_CHAR               = 0&#215;0286,<br />
WM_IME_REQUEST            = 0&#215;0288,<br />
WM_IME_KEYDOWN            = 0&#215;0290,<br />
WM_IME_KEYUP              = 0&#215;0291,<br />
WM_MOUSEHOVER             = 0&#215;02A1,<br />
WM_MOUSELEAVE             = 0&#215;02A3,<br />
WM_CUT                    = 0&#215;0300,<br />
WM_COPY                   = 0&#215;0301,<br />
WM_PASTE                  = 0&#215;0302,<br />
WM_CLEAR                  = 0&#215;0303,<br />
WM_UNDO                   = 0&#215;0304,<br />
WM_RENDERFORMAT           = 0&#215;0305,<br />
WM_RENDERALLFORMATS       = 0&#215;0306,<br />
WM_DESTROYCLIPBOARD       = 0&#215;0307,<br />
WM_DRAWCLIPBOARD          = 0&#215;0308,<br />
WM_PAINTCLIPBOARD         = 0&#215;0309,<br />
WM_VSCROLLCLIPBOARD       = 0&#215;030A,<br />
WM_SIZECLIPBOARD          = 0&#215;030B,<br />
WM_ASKCBFORMATNAME        = 0&#215;030C,<br />
WM_CHANGECBCHAIN          = 0&#215;030D,<br />
WM_HSCROLLCLIPBOARD       = 0&#215;030E,<br />
WM_QUERYNEWPALETTE        = 0&#215;030F,<br />
WM_PALETTEISCHANGING      = 0&#215;0310,<br />
WM_PALETTECHANGED         = 0&#215;0311,<br />
WM_HOTKEY                 = 0&#215;0312,<br />
WM_PRINT                  = 0&#215;0317,<br />
WM_PRINTCLIENT            = 0&#215;0318,<br />
WM_HANDHELDFIRST          = 0&#215;0358,<br />
WM_HANDHELDLAST           = 0&#215;035F,<br />
WM_AFXFIRST               = 0&#215;0360,<br />
WM_AFXLAST                = 0&#215;037F,<br />
WM_PENWINFIRST            = 0&#215;0380,<br />
WM_PENWINLAST             = 0&#215;038F,<br />
WM_APP                    = 0&#215;8000,<br />
WM_USER                   = 0&#215;0400,<br />
WM_REFLECT                = WM_USER + 0&#215;1c00</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/odalet.wordpress.com/28/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/odalet.wordpress.com/28/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/odalet.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/odalet.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/odalet.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/odalet.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/odalet.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/odalet.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/odalet.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/odalet.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/odalet.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/odalet.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=odalet.wordpress.com&blog=19103&post=28&subd=odalet&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://odalet.wordpress.com/2006/10/30/useful-memo-windows-messages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/84b83058bc6f6bf7a2d9a998c3a63854?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">odalet</media:title>
		</media:content>
	</item>
		<item>
		<title>Impossible de lancer le debugger de Visual Studio 2005</title>
		<link>http://odalet.wordpress.com/2006/09/01/impossible-de-lancer-le-debugger-de-visual-studio-2005/</link>
		<comments>http://odalet.wordpress.com/2006/09/01/impossible-de-lancer-le-debugger-de-visual-studio-2005/#comments</comments>
		<pubDate>Fri, 01 Sep 2006 20:28:18 +0000</pubDate>
		<dc:creator>Olivier</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[fr]]></category>

		<guid isPermaLink="false">http://odalet.wordpress.com/2006/09/01/impossible-de-lancer-le-debugger-de-visual-studio-2005/</guid>
		<description><![CDATA[Le message d&#8217;erreur qui apparaît lorsque l&#8217;on lance un programme depuis Visual Studio 2005 (ou depuis une version Express) est, en français : Handle de liaison invalide ; ce message correspond, en anglais à The binding handle is invalid.
Ce problème apparaît lorsque le service Terminal Server est désactivé. Il suffit donc de relancer ce service [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=odalet.wordpress.com&blog=19103&post=25&subd=odalet&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Le message d&#8217;erreur qui apparaît lorsque l&#8217;on lance un programme depuis Visual Studio 2005 (ou depuis une version Express) est, en français :<b> Handle de liaison invalide</b> ; ce message correspond, en anglais à <b>The binding handle is invalid</b>.</p>
<p>Ce problème apparaît lorsque le service Terminal Server est désactivé. Il suffit donc de relancer ce service pour que tout rentre dans l&#8217;ordre.</p>
<p>Pour plus de détails, voir les posts suivants (en anglais) :</p>
<p><a href="https://blogs.msdn.com/habibh/archive/2005/11/10/491572.aspx">Troubleshooting the &#8220;The Binding Handle Is Invalid&#8221; error in Visual Studio 2005</a></p>
<p><a href="http://blogs.msdn.com/greggm/archive/2006/01/04/509243.aspx">Explaining &#8216;The Binding Handle Is Invalid&#8217;</a></p>
<p><font color="#0000ff"><a href="http://kenno.wordpress.com/2006/06/25/the-binding-handle-is-invalid-error-in-visual-studio-2005/">“The Binding Handle Is Invalid” error in Visual Studio 2005</a></font></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/odalet.wordpress.com/25/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/odalet.wordpress.com/25/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/odalet.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/odalet.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/odalet.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/odalet.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/odalet.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/odalet.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/odalet.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/odalet.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/odalet.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/odalet.wordpress.com/25/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=odalet.wordpress.com&blog=19103&post=25&subd=odalet&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://odalet.wordpress.com/2006/09/01/impossible-de-lancer-le-debugger-de-visual-studio-2005/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/84b83058bc6f6bf7a2d9a998c3a63854?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">odalet</media:title>
		</media:content>
	</item>
		<item>
		<title>Saving the state of a Graphics object</title>
		<link>http://odalet.wordpress.com/2006/08/23/saving-the-state-of-a-graphics-object/</link>
		<comments>http://odalet.wordpress.com/2006/08/23/saving-the-state-of-a-graphics-object/#comments</comments>
		<pubDate>Wed, 23 Aug 2006 16:32:34 +0000</pubDate>
		<dc:creator>Olivier</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[en]]></category>

		<guid isPermaLink="false">https://odalet.wordpress.com/2006/08/23/saving-the-state-of-a-graphics-object/</guid>
		<description><![CDATA[Today I discovered a new class : GraphicsContainer; it allows you to save the state of a Graphics object (transformation, clipping region, and rendering properties) and to restore it later. This class is used in conjunction with 2 pairs of methods belonging to the Graphics class: BeginContainer saves the state of the graphics object (and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=odalet.wordpress.com&blog=19103&post=21&subd=odalet&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Today I discovered a new class : <a href="http://msdn2.microsoft.com/en-us/library/system.drawing.drawing2d.graphicscontainer.aspx">GraphicsContainer</a>; it allows you to save the state of a Graphics object (transformation, clipping region, and rendering properties) and to restore it later. This class is used in conjunction with 2 pairs of methods belonging to the Graphics class: <a href="http://msdn2.microsoft.com/en-us/library/system.drawing.graphics.begincontainer.aspx">BeginContainer</a> saves the state of the graphics object (and returns a GraphicsContainer object), <a href="http://msdn2.microsoft.com/en-us/library/system.drawing.graphics.endcontainer.aspx">EndContainer</a> restores the state (when provided with a <a href="http://msdn2.microsoft.com/en-us/library/system.drawing.drawing2d.graphicscontainer.aspx">GraphicsContainer</a> object). MSDN provides a sample here: <a href="http://msdn2.microsoft.com/en-us/library/azdschfw.aspx">http://msdn2.microsoft.com/en-us/library/azdschfw.aspx</a>. There exists overloads of <a href="http://msdn2.microsoft.com/en-us/library/system.drawing.graphics.begincontainer.aspx">BeginContainer</a> that accept two rectangles and unit allowing the Graphics object to be applied a new transformation after its state is saved. In the same maneer, but in a simpler way, the <a href="http://msdn2.microsoft.com/en-us/library/system.drawing.graphics.save.aspx">Graphics.Save</a> and <a href="http://msdn2.microsoft.com/en-us/library/system.drawing.graphics.restore.aspx">Graphics.Restore</a> methods do the same job (Honestly, I don&#8217;t understand why these two pairs of methods coexist&#8230;) This led me to write a little helper class allowing to save/restore a Graphics with the <font color="blue">using</font> syntax. Here is how to use this class (it is just a rewritten version of the MSDN): </p>
</p>
<div class="wlWriterSmartContent">
<pre>
<div><span>protected</span><span> </span><span>override</span><span> </span><span>void</span><span> OnPaint(
    System.Windows.Forms.PaintEventArgs e)
{
    Graphics g </span><span>=</span><span> e.Graphics;

    </span><span>//</span><span> Define transformation for container.</span><span>
</span><span>    RectangleF src </span><span>=</span><span> </span><span>new</span><span> RectangleF(
        0f, 0f, 200f, 200f);
    RectangleF dest </span><span>=</span><span> </span><span>new</span><span> RectangleF(
        100f, 100f, 150f, 150f);

    </span><span>using</span><span> (PaintHelper.SaveGraphics(
        g, dest, src, GraphicsUnit.Pixel))
    {
        </span><span>//</span><span> Fill red rectangle in container.</span><span>
</span><span>        g.FillRectangle(Brushes.Red,
            </span><span>0.0F</span><span>, </span><span>0.0F</span><span>, </span><span>200.0F</span><span>, </span><span>200.0F</span><span>);
    }
    </span><span>//</span><span> Fill untransformed rectangle with green.</span><span>
</span><span>    g.FillRectangle(Brushes.Green,
        </span><span>0.0F</span><span>, </span><span>0.0F</span><span>, </span><span>200.0F</span><span>, </span><span>200.0F</span><span>);
}</span></div>
</pre>
</div>
<p>And the source code for the PaintHelper class: </p>
<pre><span>using</span> System;
<span>using</span> System.Drawing;
<span>using</span> System.Drawing.Drawing2D;

<span>namespace</span> Delta.Internals
{
    <span>public</span> <span>static</span> <span>class</span> PaintHelper
    {
        <span>private</span> <span>class</span> GraphicsBackup : IDisposable
        {
            <span>private</span> Graphics graphics = <span>null</span>;
            <span>private</span> GraphicsContainer container = <span>null</span>;

            <span>public</span> GraphicsBackup(Graphics g)
            {
                Init(g);
                container = g.BeginContainer();
            }

            <span>public</span> GraphicsBackup(
                 Graphics g, Rectangle dest, Rectangle src,
                 GraphicsUnit unit)
            {
                container = g.BeginContainer(<span><font color="#000000">
                   </font></span>dest, src, unit);
            }

            <span>public</span> GraphicsBackup(
                 Graphics g, RectangleF dest, RectangleF src,
                 GraphicsUnit unit)
            {
                container = g.BeginContainer(<span>
                   <font color="#000000"> </font></span>dest, src, unit);
            }

            <span>private</span> <span>void</span> Init(Graphics g)
            {
                <span>if</span> (g == <span>null</span>)
                   <span><font color="#000000"> </font>throw</span> <span>new</span> ArgumentNullException("<span>g</span>");
                graphics = g;
            }

            <span>public</span> <span>void</span> Dispose()
            {
                graphics.EndContainer(container);
            }
        }

        <span>public</span> <span>static</span> IDisposable SaveGraphics(Graphics g)
        {
            <span>return</span> <span>new</span> GraphicsBackup(g);
        }

        <span>public</span> <span>static</span> IDisposable SaveGraphics(Graphics g,
            Rectangle dest, Rectangle src,
            GraphicsUnit unit)
        {
            <span>return</span> <span>new</span> GraphicsBackup(
                g, dest, src, unit);
        }

        <span>public</span> <span>static</span> IDisposable SaveGraphics(Graphics g,
            RectangleF dest, RectangleF src,
            GraphicsUnit unit)
        {
            <span>return</span> <span>new</span> GraphicsBackup(
                g, dest, src, unit);
        }
    }
}</pre>
<p>Hope this helps.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/odalet.wordpress.com/21/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/odalet.wordpress.com/21/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/odalet.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/odalet.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/odalet.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/odalet.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/odalet.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/odalet.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/odalet.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/odalet.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/odalet.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/odalet.wordpress.com/21/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=odalet.wordpress.com&blog=19103&post=21&subd=odalet&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://odalet.wordpress.com/2006/08/23/saving-the-state-of-a-graphics-object/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/84b83058bc6f6bf7a2d9a998c3a63854?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">odalet</media:title>
		</media:content>
	</item>
		<item>
		<title>Pattern singleton thread safe en C# : c&#8217;est facile</title>
		<link>http://odalet.wordpress.com/2006/06/20/pattern-singleton-thread-safe-en-c-cest-facile/</link>
		<comments>http://odalet.wordpress.com/2006/06/20/pattern-singleton-thread-safe-en-c-cest-facile/#comments</comments>
		<pubDate>Tue, 20 Jun 2006 20:03:27 +0000</pubDate>
		<dc:creator>Olivier</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[fr]]></category>

		<guid isPermaLink="false">https://odalet.wordpress.com/2006/06/20/pattern-singleton-thread-safe-en-c-cest-facile/</guid>
		<description><![CDATA[Lu ici : http://www.dofactory.com/Patterns/PatternSingleton.aspx
Voici la manière classique d&#8217;écrire un pattern singleton thread-safe en C# :
class MySingleton
{
    private static MySingleton instance;

// Lock synchronization object
    private static object syncLock = new object();

private MySingleton() { DoSomething(); }

public static MySingleton Instance
    {
        get
 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=odalet.wordpress.com&blog=19103&post=20&subd=odalet&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Lu ici : <a title="http://www.dofactory.com/Patterns/PatternSingleton.aspx" href="http://www.dofactory.com/Patterns/PatternSingleton.aspx">http://www.dofactory.com/Patterns/PatternSingleton.aspx</a></p>
<p>Voici la manière classique d&#8217;écrire un pattern singleton thread-safe en C# :</p>
<pre>class MySingleton
{
    private static MySingleton instance;

// Lock synchronization object
    private static object syncLock = new object();

private MySingleton() { DoSomething(); }

public static MySingleton Instance
    {
        get
        {
            // Support multithreaded applications
            // through 'Double checked locking'
            // pattern which (once the instance
            // exists) avoids locking each
            // time the method is invoked
            if (instance == null)
            {
                lock (syncLock)
                {
                    if (instance == null)
                        instance = new MySingleton();
                }
            }
            return instance;
        }
    }
}</pre>
<p>Et maintenant, voici la manière &#8220;.NET&#8221; d&#8217;écrire ce même singleton :</p>
<pre>class MySingleton
{
    // Static members are lazily initialized.
    // .NET guarantees thread safety for
    // static initialization
    private static readonly MySingleton instance =
                        new MySingleton();

// Constructor (private)
    private MySingleton() { DoSomething(); }

public static <span style="color:#ff0000;">MySingleton</span> Instance { get { return instance; } }
}</pre>
<p>ça marche parce que &#8220;<span style="color:blue;">private</span> <span style="color:blue;">static</span> <span style="color:blue;">readonly&#8221; </span>entraîne :</p>
<ul>
<li>Initialisation paresseuse</li>
<li>Thread-safety garantie par .NET pour les initialisations statiques.</li>
</ul>
<p>C&#8217;est pas beau ça ?</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/odalet.wordpress.com/20/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/odalet.wordpress.com/20/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/odalet.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/odalet.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/odalet.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/odalet.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/odalet.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/odalet.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/odalet.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/odalet.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/odalet.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/odalet.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=odalet.wordpress.com&blog=19103&post=20&subd=odalet&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://odalet.wordpress.com/2006/06/20/pattern-singleton-thread-safe-en-c-cest-facile/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/84b83058bc6f6bf7a2d9a998c3a63854?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">odalet</media:title>
		</media:content>
	</item>
		<item>
		<title>Comment accéder aux fichiers réels du GAC ?</title>
		<link>http://odalet.wordpress.com/2006/05/19/comment-acceder-aux-fichiers-reels-du-gac/</link>
		<comments>http://odalet.wordpress.com/2006/05/19/comment-acceder-aux-fichiers-reels-du-gac/#comments</comments>
		<pubDate>Fri, 19 May 2006 14:08:06 +0000</pubDate>
		<dc:creator>Olivier</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[fr]]></category>

		<guid isPermaLink="false">https://odalet.wordpress.com/2006/05/19/comment-acceder-aux-fichiers-reels-du-gac/</guid>
		<description><![CDATA[Lu ici : (Using Explorer to get to physical files in the GAC http://weblogs.asp.net/jkey/archive/2003/02/25/3006.aspx), un truc idiot, mais qui marche remarquablement bien, pour voir les fichiers réels du GAC :

ouvrir une commande DOS, et taper subst G: %windir%\assembly
Si l&#8217;explorateur est ouvert, le fermer et le rouvrir, aller sur G:, et voilà, on a maintenant accès [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=odalet.wordpress.com&blog=19103&post=19&subd=odalet&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Lu ici : (<a title="Using Explorer to get to physical files in the GAC" href="http://weblogs.asp.net/jkey/archive/2003/02/25/3006.aspx">Using Explorer to get to physical files in the GAC http://weblogs.asp.net/jkey/archive/2003/02/25/3006.aspx</a>), un truc idiot, mais qui marche remarquablement bien, pour voir les fichiers réels du GAC :</p>
<ul>
<li>ouvrir une commande DOS, et taper <code>subst G: %windir%\assembly</code></li>
<li>Si l&#8217;explorateur est ouvert, le fermer et le rouvrir, aller sur G:, et voilà, on a maintenant accès à la strucure physique du GAC !</li>
</ul>
<p>Attention, il vaut mieux être sûr de son coup avant de faire joujou avec la structure interne du GAC&#8230;</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/odalet.wordpress.com/19/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/odalet.wordpress.com/19/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/odalet.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/odalet.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/odalet.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/odalet.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/odalet.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/odalet.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/odalet.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/odalet.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/odalet.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/odalet.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=odalet.wordpress.com&blog=19103&post=19&subd=odalet&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://odalet.wordpress.com/2006/05/19/comment-acceder-aux-fichiers-reels-du-gac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/84b83058bc6f6bf7a2d9a998c3a63854?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">odalet</media:title>
		</media:content>
	</item>
	</channel>
</rss>