<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" 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:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Invest in people before investing in tools</title>
        <link>http://blogs.ugidotnet.org/bmatte/Default.aspx</link>
        <description>Il blog di Matteo Baglini</description>
        <language>it-IT</language>
        <copyright>Matteo Baglini</copyright>
        <generator>Subtext Version 2.1.0.5</generator>
        <image>
            <title>Invest in people before investing in tools</title>
            <url>http://blogs.ugidotnet.org/images/RSS2Image.gif</url>
            <link>http://blogs.ugidotnet.org/bmatte/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>Google Testing Blog - Clean Code Talks</title>
            <category>Agile</category>
            <link>http://blogs.ugidotnet.org/bmatte/archive/2008/12/02/google-testing-blog-clean-code-talks.aspx</link>
            <description>&lt;p&gt;Chiunque di voi scriva test unitari per il proprio codice (perché esiste ancora qualcuno che non lo fa?? &lt;img alt="smile_wink" src="http://spaces.live.com/rte/emoticons/smile_wink.gif" /&gt;) consiglio questi brevi video di Google:&lt;/p&gt;  &lt;h4&gt;&lt;a href="http://googletesting.blogspot.com/2008/11/clean-code-talks-unit-testing.html" target="_blank"&gt;Clean Code Talks - Unit Testing&lt;/a&gt;&lt;/h4&gt;  &lt;h4&gt;&lt;a href="http://googletesting.blogspot.com/2008/11/clean-code-talks-dependency-injection.html" target="_blank"&gt;Clean Code Talks - Dependency Injection&lt;/a&gt;&lt;/h4&gt;  &lt;h4&gt;&lt;a href="http://googletesting.blogspot.com/2008/11/clean-code-talks-global-state-and.html" target="_blank"&gt;Clean Code Talks - Global State and Singletons&lt;/a&gt;&lt;/h4&gt;  &lt;div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:d9aa398a-7f96-4e78-94c7-59f3d592192f" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tag: &lt;a href="http://technorati.com/tags/UnitTest" rel="tag"&gt;UnitTest&lt;/a&gt;,&lt;a href="http://technorati.com/tags/DependencyInjection" rel="tag"&gt;DependencyInjection&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Pattern" rel="tag"&gt;Pattern&lt;/a&gt;&lt;/div&gt;&lt;img src="http://blogs.ugidotnet.org/bmatte/aggbug/94828.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Matteo Baglini</dc:creator>
            <guid>http://blogs.ugidotnet.org/bmatte/archive/2008/12/02/google-testing-blog-clean-code-talks.aspx</guid>
            <pubDate>Tue, 02 Dec 2008 15:17:13 GMT</pubDate>
            <wfw:comment>http://blogs.ugidotnet.org/bmatte/comments/94828.aspx</wfw:comment>
            <comments>http://blogs.ugidotnet.org/bmatte/archive/2008/12/02/google-testing-blog-clean-code-talks.aspx#feedback</comments>
            <wfw:commentRss>http://blogs.ugidotnet.org/bmatte/comments/commentRss/94828.aspx</wfw:commentRss>
            <trackback:ping>http://blogs.ugidotnet.org/bmatte/services/trackbacks/94828.aspx</trackback:ping>
        </item>
        <item>
            <title>Pattern Model-View-ViewModel, INotifyPropertyChanged, Static Reflection e Extension methods</title>
            <category>.NET</category>
            <link>http://blogs.ugidotnet.org/bmatte/archive/2008/11/28/pattern-model-view-viewmodel-inotifypropertychanged-static-reflection-e-extension-methods.aspx</link>
            <description>&lt;p&gt;Anch’io nei miei progetti WPF per rendere testabile la logica della mia applicazione senza rinunciare alla pontenza del &lt;em&gt;DataBinding&lt;/em&gt; utilizzo (anche) il Pattern Model-View-ViewModel. L’interfaccia &lt;em&gt;INotifyPropertyChanged&lt;/em&gt; gioca un ruolo fondamentale nell’implementazione di questo pattern quindi ne faccio un uso massiccio. Quello che non mi è mai piaciuto di questa interfaccia è l’uso delle stringe per indicare qual è la proprietà modificata, vediamo un semplice esempio dell’uso di INotifyPropertyChanged:&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Person : INotifyPropertyChanged {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;  &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;event&lt;/span&gt; PropertyChangedEventHandler PropertyChanged;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;  &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;  &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; firstName = String.Empty;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;  &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; FirstName {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;    get { &lt;span class="kwrd"&gt;return&lt;/span&gt; firstName; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    set {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;      &lt;span class="kwrd"&gt;if&lt;/span&gt; (firstName != &lt;span class="kwrd"&gt;value&lt;/span&gt;) {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;        firstName = &lt;span class="kwrd"&gt;value&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;        RaisePropertyChanged(&lt;span class="str"&gt;"FirstName"&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;      }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;    }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;  }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;  &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; RaisePropertyChanged(&lt;span class="kwrd"&gt;string&lt;/span&gt; propertyName) {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (PropertyChanged != &lt;span class="kwrd"&gt;null&lt;/span&gt;)&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;      PropertyChanged(&lt;span class="kwrd"&gt;this&lt;/span&gt;, &lt;span class="kwrd"&gt;new&lt;/span&gt; PropertyChangedEventArgs(propertyName));&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;  }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p /&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[



.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;

&lt;p /&gt;

&lt;p&gt;Se cambio il nome della proprietà &lt;em&gt;FirstName&lt;/em&gt; Visual Studio si accorge del cambiamento e mi permette con un solo click di rinominare la proprietà ovunque venga utilizzata, però questo sistema di &lt;em&gt;refactoring&lt;/em&gt; non è abbastanza &lt;em&gt;smart&lt;/em&gt; da modificare la stringa &lt;em&gt;FirstName&lt;/em&gt; (riga 10). Grazie alla &lt;a href="http://ayende.com/Blog/archive/2005/10/29/StaticReflection.aspx" target="_blank"&gt;Static Reflection&lt;/a&gt; possiamo eliminare questo problema, il “trucco” sta nel passare al metodo &lt;em&gt;RaisePropertyChanged&lt;/em&gt; la proprietà come tipo &lt;em&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb335710.aspx" target="_blank"&gt;Expression&amp;lt;Func&amp;lt;T&amp;gt;&amp;gt;&lt;/a&gt;,&lt;/em&gt; convertire successivamente il &lt;em&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.linq.expressions.lambdaexpression.body.aspx" target="_blank"&gt;Body&lt;/a&gt;&lt;/em&gt; nel tipo &lt;em&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.linq.expressions.memberexpression.aspx" target="_blank"&gt;MemberExpression&lt;/a&gt;&lt;/em&gt; ed in fine recuperare il nome tramite le proprietà &lt;em&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.linq.expressions.memberexpression.member.aspx" target="_blank"&gt;Member&lt;/a&gt;&lt;/em&gt;. Risultato:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Person : INotifyPropertyChanged {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;  &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;event&lt;/span&gt; PropertyChangedEventHandler PropertyChanged;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;  &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;  &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; firstName = String.Empty;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;  &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; FirstName {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;    get { &lt;span class="kwrd"&gt;return&lt;/span&gt; firstName; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    set {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;      &lt;span class="kwrd"&gt;if&lt;/span&gt; (firstName != &lt;span class="kwrd"&gt;value&lt;/span&gt;) {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;        firstName = &lt;span class="kwrd"&gt;value&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;        RaisePropertyChanged(() =&amp;gt; FirstName);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;      }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;    }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;  }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;  &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; RaisePropertyChanged&amp;lt;T&amp;gt;(Expression&amp;lt;Func&amp;lt;T&amp;gt;&amp;gt; property) {  &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;    var expression = property.Body &lt;span class="kwrd"&gt;as&lt;/span&gt; MemberExpression;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;    var member = expression.Member;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (PropertyChanged != &lt;span class="kwrd"&gt;null&lt;/span&gt;)&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;      PropertyChanged(&lt;span class="kwrd"&gt;this&lt;/span&gt;, &lt;span class="kwrd"&gt;new&lt;/span&gt; PropertyChangedEventArgs(member.Name));&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;  }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p /&gt;&lt;style type="text/css"&gt;&lt;![CDATA[



.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;Adesso il nostro codice supporta pienamente il &lt;em&gt;rename refactoring&lt;/em&gt;. Come ultimo passo possiamo incapsulare la logica di manipolazione dei tipi &lt;em&gt;Expression&lt;/em&gt; in un &lt;em&gt;Extension methods &lt;/em&gt;rendendo il codice molto più leggibile:

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &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;class&lt;/span&gt; PropertyExtensions {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;  &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; PropertyChangedEventArgs CreateChangeEventArgs&amp;lt;T&amp;gt;(&lt;span class="kwrd"&gt;this&lt;/span&gt; Expression&amp;lt;Func&amp;lt;T&amp;gt;&amp;gt; property) {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    var expression = property.Body &lt;span class="kwrd"&gt;as&lt;/span&gt; MemberExpression;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    var member = expression.Member;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;    &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; PropertyChangedEventArgs(member.Name);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;  }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;}&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Person : INotifyPropertyChanged {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;  &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;event&lt;/span&gt; PropertyChangedEventHandler PropertyChanged;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;  &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;  &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; firstName = String.Empty;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;  &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; FirstName {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;    get { &lt;span class="kwrd"&gt;return&lt;/span&gt; firstName; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;    set {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;      &lt;span class="kwrd"&gt;if&lt;/span&gt; (firstName != &lt;span class="kwrd"&gt;value&lt;/span&gt;) {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;        firstName = &lt;span class="kwrd"&gt;value&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;        RaisePropertyChanged(() =&amp;gt; FirstName);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;      }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;    }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;  }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;  &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; RaisePropertyChanged&amp;lt;T&amp;gt;(Expression&amp;lt;Func&amp;lt;T&amp;gt;&amp;gt; property) {  &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (PropertyChanged != &lt;span class="kwrd"&gt;null&lt;/span&gt;)&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;      PropertyChanged(&lt;span class="kwrd"&gt;this&lt;/span&gt;, property.CreateChangeEventArgs());&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;  }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p /&gt;

&lt;div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:06f17728-e2aa-4822-ac20-75f4fcc5d3ad" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tag: &lt;a href="http://technorati.com/tags/Model-View-ViewModel" rel="tag"&gt;Model-View-ViewModel&lt;/a&gt;,&lt;a href="http://technorati.com/tags/M-V-VM" rel="tag"&gt;M-V-VM&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Extension+Methods" rel="tag"&gt;Extension Methods&lt;/a&gt;,&lt;a href="http://technorati.com/tags/INotifyPropertyChanged" rel="tag"&gt;INotifyPropertyChanged&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Expression" rel="tag"&gt;Expression&lt;/a&gt;&lt;/div&gt;&lt;img src="http://blogs.ugidotnet.org/bmatte/aggbug/94787.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Matteo Baglini</dc:creator>
            <guid>http://blogs.ugidotnet.org/bmatte/archive/2008/11/28/pattern-model-view-viewmodel-inotifypropertychanged-static-reflection-e-extension-methods.aspx</guid>
            <pubDate>Fri, 28 Nov 2008 14:06:28 GMT</pubDate>
            <wfw:comment>http://blogs.ugidotnet.org/bmatte/comments/94787.aspx</wfw:comment>
            <comments>http://blogs.ugidotnet.org/bmatte/archive/2008/11/28/pattern-model-view-viewmodel-inotifypropertychanged-static-reflection-e-extension-methods.aspx#feedback</comments>
            <slash:comments>5</slash:comments>
            <wfw:commentRss>http://blogs.ugidotnet.org/bmatte/comments/commentRss/94787.aspx</wfw:commentRss>
            <trackback:ping>http://blogs.ugidotnet.org/bmatte/services/trackbacks/94787.aspx</trackback:ping>
        </item>
        <item>
            <title>WPF Effects Library</title>
            <category>.NET</category>
            <link>http://blogs.ugidotnet.org/bmatte/archive/2008/10/23/wpf-effects-library.aspx</link>
            <description>Una delle &lt;a target="_blank" href="http://windowsclient.net/wpf/wpf35/wpf-whats-new-35sp1.aspx"&gt;novità di WPF 3.5 SP1&lt;/a&gt; sono gli Shader Effects, adesso il Team di WPF ha pubblicato su &lt;a target="_blank" href="http://www.codeplex.com/"&gt;CodePlex&lt;/a&gt; la &lt;a target="_blank" href="http://www.codeplex.com/wpffx"&gt;Windows Presentation Foundation Pixel Shader Effects Library&lt;/a&gt;, una libreria  contenente molti Shader Effects, direttamente dalla home del progetto:
&lt;p&gt;Initial seed includes:      &lt;br /&gt;
Effects:       &lt;br /&gt;
BandedSwirl, Bloom, BrightExtract, ColorKeyAlpha, ColorTone, ContrastAdjust, DirectionalBlur, Embossed, Gloom, GrowablePoissonDiskEffect, InvertColor, LightStreak, Magnify, Monochrome, Pinch, Pixelate, Ripple, Sharpen, SmoothMagnify, Swirl, Tone, Toon, and ZoomBlur &lt;br /&gt;
Transition Effects:       &lt;br /&gt;
BandedSwirl, Blings, Blood, CircleReveal, CircleStretch, CircularBlur, CloudReveral, Cloudy, Crumble, Dissolve, DropFade, Fade, LeastBright, LineReveal, MostBright, PixelateIn, PixelateOut, Pixelate, RadialBlur, RadialWiggle, RandomCircleReveal, Ripple, Rotate, Saturate, Shrink, SlideIn, SmoothSwirl, Swirl, Water, Wave. &lt;/p&gt;
&lt;p&gt;Ora non resta che provarli tutti &lt;img src="http://spaces.live.com/rte/emoticons/smile_teeth.gif" alt="smile_teeth" /&gt;.&lt;/p&gt;
&lt;div style="margin: 0px; padding: 0px; display: inline; float: none;" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:444a6ae9-6664-415d-8b8a-b0d9cb107bfb" class="wlWriterEditableSmartContent"&gt;Technorati Tag: &lt;a rel="tag" href="http://technorati.com/tags/WPF"&gt;WPF&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/Windows+Presentation+Foundation"&gt;Windows Presentation Foundation&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/Shader+Effects"&gt;Shader Effects&lt;/a&gt;&lt;/div&gt;&lt;img src="http://blogs.ugidotnet.org/bmatte/aggbug/94837.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Matteo Baglini</dc:creator>
            <guid>http://blogs.ugidotnet.org/bmatte/archive/2008/10/23/wpf-effects-library.aspx</guid>
            <pubDate>Thu, 23 Oct 2008 07:47:00 GMT</pubDate>
            <wfw:comment>http://blogs.ugidotnet.org/bmatte/comments/94837.aspx</wfw:comment>
            <comments>http://blogs.ugidotnet.org/bmatte/archive/2008/10/23/wpf-effects-library.aspx#feedback</comments>
            <wfw:commentRss>http://blogs.ugidotnet.org/bmatte/comments/commentRss/94837.aspx</wfw:commentRss>
            <trackback:ping>http://blogs.ugidotnet.org/bmatte/services/trackbacks/94837.aspx</trackback:ping>
        </item>
        <item>
            <title>Pubblicati i sorgenti del controllo WatermarkedTextBox</title>
            <category>.NET</category>
            <link>http://blogs.ugidotnet.org/bmatte/archive/2008/10/22/pubblicati-i-sorgenti-del-controllo-watermarkedtextbox.aspx</link>
            <description>Fra i vari controlli presenti nelle prime versioni di Silverlight c’era la WatermarkedTextBox. Dalla release Beta2 tale controllo è stato rimosso. Adesso, pressati dalle forti richieste, il team di Silverlight ha rilasciato il codice sorgente del suddetto controllo.
&lt;ul&gt;
    &lt;li&gt;Sorgenti: &lt;a href="http://s3.amazonaws.com/timheuer-img/WatermarkedTextBox-Source.zip"&gt;WatermarkedTextBox-Source.zip&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;Binari: &lt;a href="http://s3.amazonaws.com/timheuer-img/WatermarkedTextBox-Binary.zip"&gt;WatermarkedTextBox-Binary.zip&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Fonte: &lt;a href="http://timheuer.com/blog/archive/2008/10/22/silverlight-watermark-text-box-control.aspx" target="_blank"&gt;Silverlight 2 Watermarked TextBox Control&lt;/a&gt;&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:e686344b-7a42-45bd-8696-9b52f54809db" style="margin: 0px; padding: 0px; display: inline; float: none;"&gt;Technorati Tag: &lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;&lt;/div&gt;&lt;img src="http://blogs.ugidotnet.org/bmatte/aggbug/94836.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Matteo Baglini</dc:creator>
            <guid>http://blogs.ugidotnet.org/bmatte/archive/2008/10/22/pubblicati-i-sorgenti-del-controllo-watermarkedtextbox.aspx</guid>
            <pubDate>Wed, 22 Oct 2008 19:27:00 GMT</pubDate>
            <wfw:comment>http://blogs.ugidotnet.org/bmatte/comments/94836.aspx</wfw:comment>
            <comments>http://blogs.ugidotnet.org/bmatte/archive/2008/10/22/pubblicati-i-sorgenti-del-controllo-watermarkedtextbox.aspx#feedback</comments>
            <wfw:commentRss>http://blogs.ugidotnet.org/bmatte/comments/commentRss/94836.aspx</wfw:commentRss>
            <trackback:ping>http://blogs.ugidotnet.org/bmatte/services/trackbacks/94836.aspx</trackback:ping>
        </item>
        <item>
            <title>[WPF] Intercettare l’evento MouseDoubleClick di un ListBoxItem</title>
            <category>.NET</category>
            <link>http://blogs.ugidotnet.org/bmatte/archive/2008/10/22/wpf-intercettare-levento-mousedoubleclick-di-un-listboxitem.aspx</link>
            <description>&lt;p&gt;Visual Studio 2008 Sp1 non visualizza l’evento MouseDoubleClick per un ListBoxITem, come se non esistesse:&lt;/p&gt;
&lt;p&gt; &lt;a href="../../../../images/blogs_ugidotnet_org/bmatte/WindowsLiveWriter/a560dea00ac4_11015/ListBoxITemMouseDoubleClick_2.png"&gt;&lt;img height="62" border="0" width="244" src="../../../../images/blogs_ugidotnet_org/bmatte/WindowsLiveWriter/a560dea00ac4_11015/ListBoxITemMouseDoubleClick_thumb.png" alt="ListBoxITemMouseDoubleClick" style="border-width: 0px; display: inline;" title="ListBoxITemMouseDoubleClick" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;In realtà tale evento esiste, è solo un problema di IntelliSense, quindi basta digitare il nome e tutto funziona:&lt;/p&gt;
&lt;p&gt; &lt;a href="../../../../images/blogs_ugidotnet_org/bmatte/WindowsLiveWriter/a560dea00ac4_11015/ListBoxITemMouseDoubleClick2_2.png"&gt;&lt;img height="52" border="0" width="244" src="../../../../images/blogs_ugidotnet_org/bmatte/WindowsLiveWriter/a560dea00ac4_11015/ListBoxITemMouseDoubleClick2_thumb.png" alt="ListBoxITemMouseDoubleClick2" style="border-width: 0px; display: inline;" title="ListBoxITemMouseDoubleClick2" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Al seguente url è disponibile una piccola demo: &lt;a target="_blank" href="http://makesimple.googlecode.com/svn/trunk/WPF/ListItemDoubleClickDemo/"&gt;ListItemDoubleClickDemo&lt;/a&gt;&lt;/p&gt;
&lt;div style="margin: 0px; padding: 0px; display: inline; float: none;" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:c6d58023-12da-44ea-b225-0cf0fdfe31eb" class="wlWriterSmartContent"&gt;Technorati Tag: &lt;a rel="tag" href="http://technorati.com/tags/WPF"&gt;WPF&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/Windows+Presentation+Foundation"&gt;Windows Presentation Foundation&lt;/a&gt;&lt;/div&gt;&lt;img src="http://blogs.ugidotnet.org/bmatte/aggbug/94831.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Matteo Baglini</dc:creator>
            <guid>http://blogs.ugidotnet.org/bmatte/archive/2008/10/22/wpf-intercettare-levento-mousedoubleclick-di-un-listboxitem.aspx</guid>
            <pubDate>Wed, 22 Oct 2008 19:27:00 GMT</pubDate>
            <wfw:comment>http://blogs.ugidotnet.org/bmatte/comments/94831.aspx</wfw:comment>
            <comments>http://blogs.ugidotnet.org/bmatte/archive/2008/10/22/wpf-intercettare-levento-mousedoubleclick-di-un-listboxitem.aspx#feedback</comments>
            <wfw:commentRss>http://blogs.ugidotnet.org/bmatte/comments/commentRss/94831.aspx</wfw:commentRss>
            <trackback:ping>http://blogs.ugidotnet.org/bmatte/services/trackbacks/94831.aspx</trackback:ping>
        </item>
        <item>
            <title>XAML - differenze fra Silverlight e WPF</title>
            <category>.NET</category>
            <link>http://blogs.ugidotnet.org/bmatte/archive/2008/10/22/xaml-differenze-fra-silverlight-e-wpf.aspx</link>
            <description>&lt;p&gt;XAML è un linguaggio dichiarativo general-purpose, sviluppato da Microsoft e derivato dall’XML, atto alla rappresentazione di gerarchie di oggetti. Attualmente XAML è utilizzato in Silverlight, Windows Presentation Foundation (WPF) e Windows Workflow Foundation (WF), ognuno con il proprio parser e runtime. Sul sito MSDN possiamo trovare un &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/cc917841%28VS.95%29.aspx"&gt;articolo&lt;/a&gt; che spiega le differenze fra il parser di Silverlight e quello di WPF.&lt;/p&gt;
&lt;div style="margin: 0px; padding: 0px; display: inline; float: none;" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:5b705c79-6ae2-4913-a657-8c68ee716b86" class="wlWriterEditableSmartContent"&gt;Technorati Tag: &lt;a rel="tag" href="http://technorati.com/tags/Silverlight"&gt;Silverlight&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/WPF"&gt;WPF&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/Windows+Presentation+Foundation"&gt;Windows Presentation Foundation&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/XAML"&gt;XAML&lt;/a&gt;&lt;/div&gt;&lt;img src="http://blogs.ugidotnet.org/bmatte/aggbug/94835.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Matteo Baglini</dc:creator>
            <guid>http://blogs.ugidotnet.org/bmatte/archive/2008/10/22/xaml-differenze-fra-silverlight-e-wpf.aspx</guid>
            <pubDate>Wed, 22 Oct 2008 19:14:00 GMT</pubDate>
            <wfw:comment>http://blogs.ugidotnet.org/bmatte/comments/94835.aspx</wfw:comment>
            <comments>http://blogs.ugidotnet.org/bmatte/archive/2008/10/22/xaml-differenze-fra-silverlight-e-wpf.aspx#feedback</comments>
            <wfw:commentRss>http://blogs.ugidotnet.org/bmatte/comments/commentRss/94835.aspx</wfw:commentRss>
            <trackback:ping>http://blogs.ugidotnet.org/bmatte/services/trackbacks/94835.aspx</trackback:ping>
        </item>
        <item>
            <title>[WPF] RadioButton+Binding=BUG</title>
            <category>.NET</category>
            <link>http://blogs.ugidotnet.org/bmatte/archive/2008/10/20/wpf-radiobuttonbindingbug.aspx</link>
            <description>&lt;p&gt;Questo post doveva essere pubblicato già da po’ di settimane, ma gli impegni sono sempre pronti a mettere il bastone fra le ruote.&lt;/p&gt;
&lt;p&gt;In WPF se mettete in Binding una proprietà di tipo boolean con un controllo RadioButton vi accorgerete presto di un bug nel motore di Binding.&lt;/p&gt;
&lt;p&gt;Maggiori info su questo &lt;a target="_blank" href="http://groups.google.it/group/microsoft.public.it.dotnet.csharp/browse_frm/thread/93620107bb52fead/91937a77dd19f7ec?tvc=1#91937a77dd19f7ec"&gt;thread sul newsgroup di C#&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Grazie a &lt;a target="_blank" href="../../../../corrado"&gt;Corrado&lt;/a&gt; per la segnalazione&lt;/p&gt;
&lt;div style="margin: 0px; padding: 0px; display: inline; float: none;" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:e5e6233a-a132-4cda-8806-ba61169cece2" class="wlWriterEditableSmartContent"&gt;Technorati Tag: &lt;a rel="tag" href="http://technorati.com/tags/Windows+Presentation+Foundation"&gt;Windows Presentation Foundation&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/WPF"&gt;WPF&lt;/a&gt;&lt;/div&gt;&lt;img src="http://blogs.ugidotnet.org/bmatte/aggbug/94834.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Matteo Baglini</dc:creator>
            <guid>http://blogs.ugidotnet.org/bmatte/archive/2008/10/20/wpf-radiobuttonbindingbug.aspx</guid>
            <pubDate>Mon, 20 Oct 2008 19:22:00 GMT</pubDate>
            <wfw:comment>http://blogs.ugidotnet.org/bmatte/comments/94834.aspx</wfw:comment>
            <comments>http://blogs.ugidotnet.org/bmatte/archive/2008/10/20/wpf-radiobuttonbindingbug.aspx#feedback</comments>
            <wfw:commentRss>http://blogs.ugidotnet.org/bmatte/comments/commentRss/94834.aspx</wfw:commentRss>
            <trackback:ping>http://blogs.ugidotnet.org/bmatte/services/trackbacks/94834.aspx</trackback:ping>
        </item>
        <item>
            <title>Expression Blend framework vs CompositeWPF framework</title>
            <category>.NET</category>
            <category>Architecture</category>
            <link>http://blogs.ugidotnet.org/bmatte/archive/2008/10/20/expression-blend-framework-vs-compositewpf-framework.aspx</link>
            <description>&lt;p&gt;Un interessante confronto tra il framework di una WPF Composite Application (&lt;a target="_blank" href="http://www.microsoft.com/expression/products/Overview.aspx?key=blend"&gt;Expression Blend&lt;/a&gt;) e un framework per creare WPF Composite Application (&lt;a target="_blank" href="http://www.codeplex.com/CompositeWPF"&gt;CompositeWPF&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Fonte: &lt;a target="_blank" href="http://www.paulstovell.com/blog/expression-framework-versus-composite-wpf"&gt;Expression Framework versus Composite WPF&lt;/a&gt;&lt;/p&gt;
&lt;div style="margin: 0px; padding: 0px; display: inline; float: none;" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:114d5c6c-4de7-4ce9-8df9-6ae7b3f4b9e6" class="wlWriterEditableSmartContent"&gt;Technorati Tag: &lt;a rel="tag" href="http://technorati.com/tags/ExpressionBlend"&gt;ExpressionBlend&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/CompositeWPF"&gt;CompositeWPF&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/WPF"&gt;WPF&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/Windows+Presentation+Foundation"&gt;Windows Presentation Foundation&lt;/a&gt;&lt;/div&gt;&lt;img src="http://blogs.ugidotnet.org/bmatte/aggbug/94833.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Matteo Baglini</dc:creator>
            <guid>http://blogs.ugidotnet.org/bmatte/archive/2008/10/20/expression-blend-framework-vs-compositewpf-framework.aspx</guid>
            <pubDate>Mon, 20 Oct 2008 18:51:00 GMT</pubDate>
            <wfw:comment>http://blogs.ugidotnet.org/bmatte/comments/94833.aspx</wfw:comment>
            <comments>http://blogs.ugidotnet.org/bmatte/archive/2008/10/20/expression-blend-framework-vs-compositewpf-framework.aspx#feedback</comments>
            <wfw:commentRss>http://blogs.ugidotnet.org/bmatte/comments/commentRss/94833.aspx</wfw:commentRss>
            <trackback:ping>http://blogs.ugidotnet.org/bmatte/services/trackbacks/94833.aspx</trackback:ping>
        </item>
        <item>
            <title>Adesso ci siamo anche noi!!</title>
            <category>.NET</category>
            <category>Community</category>
            <link>http://blogs.ugidotnet.org/bmatte/archive/2008/10/20/adesso-ci-siamo-anche-noi.aspx</link>
            <description>&lt;p&gt;Non sono bravo a fare gli annunci formali quindi vado dritto al sodo, insieme ad un gruppo di &lt;a target="_blank" href="http://dotnettoscana.org/content/About.aspx"&gt;amici&lt;/a&gt; abbiamo dato vita allo &lt;a target="_blank" href="http://dotnettoscana.org/"&gt;User Group Toscano su .NET&lt;/a&gt;, il sito è ufficialmente online da Venerdì 10 Ottobre. Alcuni di &lt;a target="_blank" href="http://dotnettoscana.org/forums/t/6.aspx"&gt;noi&lt;/a&gt; erano presenti alla tappa Toscana dell’evento &lt;a target="_blank" href="http://www.microsoft.com/italy/eventi/days/technical.mspx"&gt;Microsoft Days&lt;/a&gt; dove &lt;a target="_blank" href="http://blogs.msdn.com/pietrobr/"&gt;Pietro Brambati&lt;/a&gt; ha accettato la nostra proposta di sfruttare l’occasione per presentare il neonato gruppo (con tanta insistenza da parte nostra non poteva rifiutare &lt;img src="http://spaces.live.com/rte/emoticons/smile_wink.gif" alt="smile_wink" /&gt;). Pietro si è dimostrato molto disponibile ed alla fine ha fatto &lt;a target="_blank" href="http://blogs.msdn.com/pietrobr/archive/2008/10/20/intervista-a-dotnettoscana-org.aspx"&gt;molto di più&lt;/a&gt; di quello che abbiamo chiesto…&lt;img src="http://spaces.live.com/rte/emoticons/smile_wink.gif" alt="smile_wink" /&gt;&lt;/p&gt;
&lt;p&gt;Sempre in quell’occasione ho avuto il piacere di conoscere &lt;a target="_blank" href="http://blogs.msdn.com/gabrielecastellani/"&gt;Gabriele Castellani&lt;/a&gt;, &lt;a target="_blank" href="http://blogs.msdn.com/giuseppeguerrasio/"&gt;Giuseppe Guerrasio&lt;/a&gt; e &lt;a target="_blank" href="http://community.visual-basic.it/alessandro/"&gt;Alessandro Del Sole&lt;/a&gt;, che ringrazio e saluto!&lt;/p&gt;
&lt;p&gt;Per finire un particolare grazie va a &lt;a target="_blank" href="mailto:peolo_13@hotmail.it"&gt;Paolo Carpitelli&lt;/a&gt;, una persona molto disponibile che, nonostante non abbia niente a che fare con il modo IT, ne tanto meno con quello delle communities, con pochissimo preavviso è stato in grado di fornirci un logo in tempo per l’evento di Giovedì, sopportando anche le nostre esigenze. Grazie Paolo!&lt;/p&gt;
&lt;p&gt;  &lt;/p&gt;
&lt;p&gt;PS: mentre &lt;a target="_blank" href="http://www.ugidotnet.org/"&gt;UGIdotNET&lt;/a&gt; era off-line per i problemi che sappiamo, &lt;a target="_blank" href="../../../../marcom/"&gt;Marco Minerva&lt;/a&gt; era in totale astinenza da blogging, dato che ormai aveva perso tutti i capelli e non sopportava più quello stato di ansia e tensione &lt;img src="http://spaces.live.com/rte/emoticons/smile_wink.gif" alt="smile_wink" /&gt; ha iniziato a &lt;a target="_blank" href="http://dotnettoscana.org/blogs/marco/"&gt;bloggare&lt;/a&gt; sulla nostra community :D&lt;/p&gt;
&lt;p&gt;  &lt;/p&gt;
&lt;div style="margin: 0px; padding: 0px; display: inline; float: none;" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:a3b787af-c252-46bf-8631-f04e32b0a173" class="wlWriterEditableSmartContent"&gt;Technorati Tag: &lt;a rel="tag" href="http://technorati.com/tags/DotNetToscana"&gt;DotNetToscana&lt;/a&gt;&lt;/div&gt;&lt;img src="http://blogs.ugidotnet.org/bmatte/aggbug/94832.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Matteo Baglini</dc:creator>
            <guid>http://blogs.ugidotnet.org/bmatte/archive/2008/10/20/adesso-ci-siamo-anche-noi.aspx</guid>
            <pubDate>Mon, 20 Oct 2008 12:47:00 GMT</pubDate>
            <wfw:comment>http://blogs.ugidotnet.org/bmatte/comments/94832.aspx</wfw:comment>
            <comments>http://blogs.ugidotnet.org/bmatte/archive/2008/10/20/adesso-ci-siamo-anche-noi.aspx#feedback</comments>
            <wfw:commentRss>http://blogs.ugidotnet.org/bmatte/comments/commentRss/94832.aspx</wfw:commentRss>
            <trackback:ping>http://blogs.ugidotnet.org/bmatte/services/trackbacks/94832.aspx</trackback:ping>
        </item>
        <item>
            <title>[OT] 100 Pushups challenge</title>
            <category>OT</category>
            <link>http://blogs.ugidotnet.org/bmatte/archive/2008/08/29/ot-100-pushups-challenge---initial-test.aspx</link>
            <description>&lt;p&gt;&lt;a href="http://blogs.ugidotnet.org/piyo/archive/2008/08/28/100-pushups-challenge.aspx#1391456"&gt;Accettare&lt;/a&gt; la &lt;a href="http://blogs.ugidotnet.org/piyo/archive/2008/08/28/100-pushups-challenge.aspx"&gt;sfida&lt;/a&gt; è stato facile &lt;img alt="smile_teeth" src="http://spaces.live.com/rte/emoticons/smile_teeth.gif" /&gt;...però ora arriva la parte difficile, raggiungere l'obbiettivo!! &lt;img alt="smile_confused" src="http://spaces.live.com/rte/emoticons/smile_confused.gif" /&gt; &lt;/p&gt;  &lt;p&gt;La prima fase è un test iniziale nel quale ho fatto 25 flessioni di fila!! ( + 1 infarto &lt;img alt="smile_wink" src="http://spaces.live.com/rte/emoticons/smile_wink.gif" /&gt;)&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:948f71a1-8343-4d8f-985d-bf09adfa29c4" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tag: &lt;a href="http://technorati.com/tags/flessioni" rel="tag"&gt;flessioni&lt;/a&gt;,&lt;a href="http://technorati.com/tags/100pushups" rel="tag"&gt;100pushups&lt;/a&gt;&lt;/div&gt;&lt;img src="http://blogs.ugidotnet.org/bmatte/aggbug/93868.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Matteo Baglini</dc:creator>
            <guid>http://blogs.ugidotnet.org/bmatte/archive/2008/08/29/ot-100-pushups-challenge---initial-test.aspx</guid>
            <pubDate>Fri, 29 Aug 2008 10:08:58 GMT</pubDate>
            <wfw:comment>http://blogs.ugidotnet.org/bmatte/comments/93868.aspx</wfw:comment>
            <comments>http://blogs.ugidotnet.org/bmatte/archive/2008/08/29/ot-100-pushups-challenge---initial-test.aspx#feedback</comments>
            <slash:comments>7</slash:comments>
            <wfw:commentRss>http://blogs.ugidotnet.org/bmatte/comments/commentRss/93868.aspx</wfw:commentRss>
            <trackback:ping>http://blogs.ugidotnet.org/bmatte/services/trackbacks/93868.aspx</trackback:ping>
        </item>
        <item>
            <title>Usare RhinoMocks per testare applicazioni multithreading</title>
            <category>.NET</category>
            <category>Agile</category>
            <link>http://blogs.ugidotnet.org/bmatte/archive/2008/08/25/usare-rhinomocks-per-testare-applicazioni-multithreading.aspx</link>
            <description>&lt;p&gt;Interessato dal post di Antonio sull'uso del &lt;a href="http://blogs.ugidotnet.org/AntonioGanci/archive/2008/06/06/92951.aspx"&gt;TDD per progettare applicazi multithreading&lt;/a&gt; ho deciso di riprovare senguendo il percorso logico da lui espresso, usando RhinoMocks come framework di mocking piuttosto che i mocks manuali usati da Antonio per non complicare il codice di test. La versione di RhinoMocks utilizzata è la 3.5 RC che potete scaricare a &lt;a href="http://www.ayende.com/projects/rhino-mocks/downloads.aspx"&gt;questo url&lt;/a&gt;, questa versione della libreria supporta la sintassi Arrange/Act/Assert permettendo di scrivere test molto più chiari, per maggiori info visitate &lt;a href="http://www.ayende.com/wiki/Rhino+Mocks+3.5.ashx"&gt;questa pagina&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;Adesso vediamo e commentiamo i vari metodi di test, cominciamo con il primo:&lt;/p&gt;  &lt;div class="CodeFormatContainer"&gt;&lt;style&gt;&lt;!--
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

.csharpcode .kwrd { color: #0000ff; }

.csharpcode .str { color: #006080; }

.csharpcode .op { color: #0000c0; }

.csharpcode .preproc { color: #cc6633; }

.csharpcode .asp { background-color: #ffff00; }

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}

.csharpcode .lnum { color: #606060; }

--&gt;&lt;/style&gt;    &lt;div class="csharpcode"&gt;     &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; When_Enqueue_A_Log_The_LogWriter_Is_Invoked()&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    var log = &lt;span class="kwrd"&gt;new&lt;/span&gt; Log();&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    var writer = MockRepository.GenerateMock&amp;lt;ILogWriter&amp;gt;();&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;    var thread = &lt;span class="kwrd"&gt;new&lt;/span&gt; LogThread(writer);&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt; &lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    thread.Enqueue(log);&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt; &lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    writer.AssertWasCalled(x =&amp;gt; x.Write((Arg&amp;lt;Log&amp;gt;.Is.Equal(log))));&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;}&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Le differenze sostaziali sono, alla riga 4 e 9, nella prima generiamo un mock dell'interfaccia ILogWriter e nella seconda "chiediamo" al mock object di verificare se è stato chiamato il metodo Write e se il parametro in ingresso era uguale a log. Proseguiamo con il secondo test:&lt;/p&gt;

&lt;div class="CodeFormatContainer"&gt;&lt;style&gt;&lt;!--
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

.csharpcode .kwrd { color: #0000ff; }

.csharpcode .str { color: #006080; }

.csharpcode .op { color: #0000c0; }

.csharpcode .preproc { color: #cc6633; }

.csharpcode .asp { background-color: #ffff00; }

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}

.csharpcode .lnum { color: #606060; }

--&gt;&lt;/style&gt;

  &lt;div class="csharpcode"&gt;
    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; The_Calls_To_The_Writer_Are_Asynchronous()&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    var log = &lt;span class="kwrd"&gt;new&lt;/span&gt; Log();&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    var writer = MockRepository.GenerateMock&amp;lt;ILogWriter&amp;gt;();&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;    var thread = &lt;span class="kwrd"&gt;new&lt;/span&gt; LogThread(writer);&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;    &lt;span class="kwrd"&gt;int&lt;/span&gt; writerCallCount = 0;&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    var resetEvent = &lt;span class="kwrd"&gt;new&lt;/span&gt; ManualResetEvent(&lt;span class="kwrd"&gt;false&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt; &lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    writer.Expect(x =&amp;gt; x.Write((Arg&amp;lt;Log&amp;gt;.Is.Anything))).Do(&lt;span class="kwrd"&gt;new&lt;/span&gt; Action&amp;lt;Log&amp;gt;(l =&amp;gt;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    {&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;        writerCallCount++;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;        resetEvent.WaitOne();&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;        writerCallCount--;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;    }));&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt; &lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;    thread.Enqueue(log);&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;    &lt;span class="kwrd"&gt;while&lt;/span&gt; (writerCallCount == 0)&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;    {&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;        Thread.Sleep(0);&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;    }&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;    Assert.AreEqual(1, writerCallCount);            &lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;    resetEvent.Set();&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;}&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;La parte interessante in questo test sono le righe dalla numero 9 alla 14, dove istruisco il mock object. In pratica non faccio altro che "dire" al mock object "quando viene invocato il metodo Write con una qualsiasi istanza di Log, esegui la seguente Action". Il delegate passato come Action al metodo Do esegue la solita logica del mock manuale usato da Antonio. Per il resto il codice di test è sostanzialmente identico. La logica del terzo metodo di test è la solita quindi vi posto solo il codice:&lt;/p&gt;

&lt;div class="CodeFormatContainer"&gt;&lt;style&gt;&lt;!--
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

.csharpcode .kwrd { color: #0000ff; }

.csharpcode .str { color: #006080; }

.csharpcode .op { color: #0000c0; }

.csharpcode .preproc { color: #cc6633; }

.csharpcode .asp { background-color: #ffff00; }

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}

.csharpcode .lnum { color: #606060; }

--&gt;&lt;/style&gt;

  &lt;div class="csharpcode"&gt;
    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Two_Logs_Enqueued_Are_Served_One_At_Time()&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    var writer = MockRepository.GenerateMock&amp;lt;ILogWriter&amp;gt;();&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    var thread = &lt;span class="kwrd"&gt;new&lt;/span&gt; LogThread(writer);&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;    &lt;span class="kwrd"&gt;int&lt;/span&gt; writerCallCount = 0;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;    var resetEvent = &lt;span class="kwrd"&gt;new&lt;/span&gt; ManualResetEvent(&lt;span class="kwrd"&gt;false&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt; &lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;    writer.Expect(x =&amp;gt; x.Write((Arg&amp;lt;Log&amp;gt;.Is.Anything))).Do(&lt;span class="kwrd"&gt;new&lt;/span&gt; Action&amp;lt;Log&amp;gt;(l =&amp;gt;&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    {&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;        writerCallCount++;&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;        resetEvent.WaitOne();&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;        writerCallCount--;&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;    }));&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt; &lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;    Log log1 = &lt;span class="kwrd"&gt;new&lt;/span&gt; Log();&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;    thread.Enqueue(log1);&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;    &lt;span class="kwrd"&gt;while&lt;/span&gt; (writerCallCount &amp;lt; 1)&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;    {&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;        Thread.Sleep(0);&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;    }&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt; &lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;    Log log2 = &lt;span class="kwrd"&gt;new&lt;/span&gt; Log();&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;    thread.Enqueue(log2);&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;    &lt;span class="kwrd"&gt;while&lt;/span&gt; (thread.RunningThreadCount &amp;lt; 2)&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;    {&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;        Thread.Sleep(0);&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;    }&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt; &lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;    Assert.AreEqual(1, writerCallCount);&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt; &lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  31:  &lt;/span&gt;    resetEvent.Set();&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  32:  &lt;/span&gt;    &lt;span class="kwrd"&gt;while&lt;/span&gt; (writerCallCount &amp;gt; 0)&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  33:  &lt;/span&gt;    {&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  34:  &lt;/span&gt;        Thread.Sleep(0);&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  35:  &lt;/span&gt;    }&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  36:  &lt;/span&gt;}&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;In fine passiamo all'ultimo metodo di test:&lt;/p&gt;

&lt;div class="CodeFormatContainer"&gt;&lt;style&gt;&lt;!--
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

.csharpcode .kwrd { color: #0000ff; }

.csharpcode .str { color: #006080; }

.csharpcode .op { color: #0000c0; }

.csharpcode .preproc { color: #cc6633; }

.csharpcode .asp { background-color: #ffff00; }

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}

.csharpcode .lnum { color: #606060; }

--&gt;&lt;/style&gt;

  &lt;div class="csharpcode"&gt;
    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; When_The_Writer_Throws_An_Exception_The_QueueLength_Is_Decreased()&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    var writer = MockRepository.GenerateMock&amp;lt;ILogWriter&amp;gt;();&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    var thread = &lt;span class="kwrd"&gt;new&lt;/span&gt; LogThread(writer);&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;    &lt;span class="kwrd"&gt;bool&lt;/span&gt; isWriting = &lt;span class="kwrd"&gt;false&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt; &lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    writer.Expect(x =&amp;gt; x.Write((Arg&amp;lt;Log&amp;gt;.Is.Anything))).Do(&lt;span class="kwrd"&gt;new&lt;/span&gt; Action&amp;lt;Log&amp;gt;(l =&amp;gt;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;    {&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;        isWriting = &lt;span class="kwrd"&gt;true&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;        &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; Exception();&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;    }));&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt; &lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;    thread.Enqueue(&lt;span class="kwrd"&gt;new&lt;/span&gt; Log());&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;    &lt;span class="kwrd"&gt;while&lt;/span&gt; (!isWriting)&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;    {&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;        Thread.Sleep(0);&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;    }&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;    &lt;span class="kwrd"&gt;while&lt;/span&gt; (thread.RunningThreadCount &amp;gt; 0)&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;    {&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;        Thread.Sleep(0);&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;    }&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;    Assert.AreEqual(0, thread.RunningThreadCount);&lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;}&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Anche qui la parte interessante è la configurazione del mock object, in questo test la sintassi del mock rimane uguale ai test precedenti, quello che cambia è la logica contenute nell' Action delegate passato al metodo Do, il quale scatena un' eccezione.&lt;/p&gt;

&lt;p&gt;Nel mio repository personale ho creato tre proggeti uno con la versione manuale dei mocks, uno che usa RhinoMocks ed in fine uno che usa Moq, il tutto è reperibile a questo url: &lt;a title="https://makesimple.googlecode.com/svn/trunk/UnitTestMultithreading" href="http://makesimple.googlecode.com/svn/trunk/UnitTestMultithreading"&gt;http://makesimple.googlecode.com/svn/trunk/UnitTestMultithreading&lt;/a&gt;&lt;/p&gt;

&lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:5767b1a4-17c7-4a13-9163-61ed850b9f99" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tag: &lt;a href="http://technorati.com/tags/Multithreading" rel="tag"&gt;Multithreading&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Mocks" rel="tag"&gt;Mocks&lt;/a&gt;,&lt;a href="http://technorati.com/tags/UnitTest" rel="tag"&gt;UnitTest&lt;/a&gt;,&lt;a href="http://technorati.com/tags/TDD" rel="tag"&gt;TDD&lt;/a&gt;&lt;/div&gt;&lt;img src="http://blogs.ugidotnet.org/bmatte/aggbug/93807.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Matteo Baglini</dc:creator>
            <guid>http://blogs.ugidotnet.org/bmatte/archive/2008/08/25/usare-rhinomocks-per-testare-applicazioni-multithreading.aspx</guid>
            <pubDate>Mon, 25 Aug 2008 09:19:32 GMT</pubDate>
            <wfw:comment>http://blogs.ugidotnet.org/bmatte/comments/93807.aspx</wfw:comment>
            <comments>http://blogs.ugidotnet.org/bmatte/archive/2008/08/25/usare-rhinomocks-per-testare-applicazioni-multithreading.aspx#feedback</comments>
            <wfw:commentRss>http://blogs.ugidotnet.org/bmatte/comments/commentRss/93807.aspx</wfw:commentRss>
            <trackback:ping>http://blogs.ugidotnet.org/bmatte/services/trackbacks/93807.aspx</trackback:ping>
        </item>
        <item>
            <title>Mixin, POCO e INotifyPropertyChanged mito o realt&amp;agrave;?</title>
            <category>.NET</category>
            <category>Architecture</category>
            <link>http://blogs.ugidotnet.org/bmatte/archive/2008/08/06/mixin-poco-e-inotifypropertychanged-mito-o-realtagrave.aspx</link>
            <description>&lt;p&gt;Dopo aver chiesto ad i &lt;a href="http://www.communitydays.it/events/communitydays2008milano.aspx"&gt;CDays2008&lt;/a&gt; a &lt;a href="http://blogs.ugidotnet.org/topics/Default.aspx"&gt;Mauro&lt;/a&gt; cosa pensava dei mixin, dopo aver letto i vari post di &lt;a href="http://blogs.ugidotnet.org/pape/archive/2008/07/29/beyond-persistence-ignorance-real-poco.aspx"&gt;Andrea&lt;/a&gt;, &lt;a href="http://blogs.ugidotnet.org/raffaele/archive/2008/07/29/93561.aspx"&gt;Raffaele&lt;/a&gt; e &lt;a href="http://blogs.ugidotnet.org/rgm/archive/2008/07/31/93587.aspx"&gt;Gian Maria&lt;/a&gt; che parlano di POCO e dopo aver letto i due post (&lt;a href="http://www.nablasoft.com/alkampfer/index.php/2008/08/04/implement-inotifypropertychanged-with-dynamic-code-generation/"&gt;qui&lt;/a&gt; e &lt;a href="http://www.nablasoft.com/alkampfer/index.php/2008/08/04/implement-inotifypropertychanged-with-castledynamicproxy/"&gt;qui&lt;/a&gt;) nel &lt;a href="http://www.nablasoft.com/alkampfer/"&gt;blog inglese&lt;/a&gt; di Gian Maria ho deciso di spiegare meglio cosa intendevo con il &lt;a href="http://blogs.ugidotnet.org/pape/archive/2008/07/29/beyond-persistence-ignorance-real-poco.aspx#1384111"&gt;mio commento&lt;/a&gt; al post di Andrea.&lt;/p&gt;  &lt;p&gt;Gian Maria mostra due modi diversi per rivolvere il "problema" dell'interfaccia &lt;a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged.aspx"&gt;INotifyPropertyChanged&lt;/a&gt; creando proxy a run-time, io avevo risolto il solito problema usando &lt;a href="http://blogs.ugidotnet.org/bmatte/archive/2008/04/16/spring.net-31-spring.aop-aspect-oriented-programming-framework-overview.aspx"&gt;Spring.NET AOP&lt;/a&gt;. Questo dimostra che come al solito ci sono svariati modi per ottenere il solito risultato.&lt;/p&gt;  &lt;p&gt;Finita questa piccola anticipazione arrivo al nocciolo del discorso e sparo la mia sentenza...nessuna di queste implementazioni è usabile!! Vi chiederete perchè ed io sono qui per dimostrarvelo. Piccola demo, provate a creare una semplice BindingList&amp;lt;Customer&amp;gt;, aggiungete ad essa un numero imprecisato di Customer-proxaty, agganciate l'evento ListChanged ed in fine provate a modificare la proprietà di un Customer della BindingList...et vualà l'evento non viene scatenato, cosa che dovrebbe accadere se Customer implementasse normalmente INotifyPropertyChanged. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.ugidotnet.org/images/blogs_ugidotnet_org/bmatte/WindowsLiveWriter/MixinPOCOeINotifyPropertyChanged_14128/init_4.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="127" alt="init" src="http://blogs.ugidotnet.org/images/blogs_ugidotnet_org/bmatte/WindowsLiveWriter/MixinPOCOeINotifyPropertyChanged_14128/init_thumb_1.png" width="244" align="right" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Quando per la prima volta mi sono trovato davanti a questo problema armato di Reflector sono andato a sbirciare il codice della classe BindingList&amp;lt;T&amp;gt; ed ho trovato l'inghippo. Guardando il codice mostrato nell'immagine vediamo che la seconda linea di codice verifica se il tipo INotifyPropertyChanged è assegnabile dal tipo Customer, questa verifica nel caso di Customer in versione POCO è assolutamente falsa dato che il tipo Customer non sa niente di INotifyPropertyChanged. Per confermare questa teoria mi sono creato un po di test unitari che riproducono il problema, vediamoli. In entrambi i casi di test la creazione del Customer è stata "nascosta" dentro dei metodi Factory dato che non mi interessa mostrarne l'implementazione in questo post. Per prima cosa ho creato due classi Customer la prima implementa INotifyPropertyChanged e la seconda no, però ha le properties marcate come virtual per permettere la creazione del proxy a run-time.  &lt;/p&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; height: 127px; background-color: #f4f4f4"&gt;   &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; 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; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span 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; Customer : INotifyPropertyChanged&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;event&lt;/span&gt; PropertyChangedEventHandler PropertyChanged;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; Guid id = Guid.NewGuid();&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; name;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;  &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; Guid Id {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;         get { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; id; }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Name {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;         get { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; name; }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;         set {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (name != &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;) {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt;                 name = &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt;                 RaisePropertyChanged(&lt;span style="color: #006080"&gt;"Name"&lt;/span&gt;);}&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  16:&lt;/span&gt;             }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  17:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  18:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; RaisePropertyChanged(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; propertyName)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  19:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  20:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (PropertyChanged != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  21:&lt;/span&gt;             PropertyChanged(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; PropertyChangedEventArgs(propertyName));&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  22:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  23:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; height: 119px; background-color: #f4f4f4"&gt;
  &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; 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; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span 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; CustomerPoco&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; Guid id = Guid.NewGuid();&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;  &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;virtual&lt;/span&gt; Guid Id {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;         get { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; id; }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;virtual&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Name { get; set; }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Dopodiché ho creato due metodi di test, uno verifica se il Customer è castabile a INotifyPropertyChanged mentre l'altro verifica se è assegnabile. &lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; 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; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; [Fact]&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; ShouldBeCompatibleWithTypeINotifyPropertyChanged()&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;     Customer customer = CustomerFactory.CreateCustomer();&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;     (customer &lt;span style="color: #0000ff"&gt;is&lt;/span&gt; INotifyPropertyChanged).ShouldBeTrue(&lt;span style="color: #006080"&gt;"Is not INotifyPropertyChanged"&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt; }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt; [Fact]&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; ShouldBeAssignableToTypeINotifyPropertyChanged()&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(INotifyPropertyChanged).IsAssignableFrom(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(Customer))&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;         .ShouldBeTrue(&lt;span style="color: #006080"&gt;"INotifyPropertyChanged is not assignable from Customer"&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;In questo caso entrabi i test passano perfettamente, proseguiamo eseguendo i soliti test su CustomerPoco:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; 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; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; [Fact]&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; ShouldBeCompatibleWithTypeINotifyPropertyChanged()&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;     CustomerPoco customer = CustomerFactory.CreateCustomerPoco();&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;     (customer &lt;span style="color: #0000ff"&gt;is&lt;/span&gt; INotifyPropertyChanged).ShouldBeTrue(&lt;span style="color: #006080"&gt;"Is not INotifyPropertyChanged"&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt; }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt; [Fact]&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; ShouldBeAssignableToTypeINotifyPropertyChanged()&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(INotifyPropertyChanged).IsAssignableFrom(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(CustomerPoco))&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;         .ShouldBeTrue(&lt;span style="color: #006080"&gt;"INotifyPropertyChanged is not assignable from CustomerPoco"&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;In quest'ultimo caso il primo test passa mentre il secondo no distruggendo i nostri sogni di sviluppatore lazy che non doveva più implementare INotifyPropertyChanged &lt;img alt="smile_wink" src="http://spaces.live.com/rte/emoticons/smile_wink.gif" /&gt;. Ecco perchè nel mio commento al post di Andrea ho detto: "...perchè il framework di per se non conosce i mixin quindi è stato scritto "bloccandone" l'uso". Problemi simili sono risolvibili con diversi hack, basta barare con un po di reflection dopo aver istanziato la collection:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; height: 107px; background-color: #f4f4f4"&gt;
  &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; 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; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&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;void&lt;/span&gt; EditRaiseItemChangedEvents(BindingList&amp;lt;Customer&amp;gt; list)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;     FieldInfo _fi = list.GetType().GetField(&lt;span style="color: #006080"&gt;"raiseItemChangedEvents"&lt;/span&gt;, BindingFlags.NonPublic | BindingFlags.Instance);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; raiseItemChangedEvents = (&lt;span style="color: #0000ff"&gt;bool&lt;/span&gt;)_fi.GetValue(list);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!raiseItemChangedEvents) _fi.SetValue(list, &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;ed il gioco è fatto ma in generale hanno un costo troppo alto, sia di implementazione che di manutenzione dato che il problema non si presenta solo per collection come la BindingList ma anche per controlli come il BindingSource delle WindowsForm.&lt;/p&gt;

&lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:c9fbb01c-61ed-423c-bc46-f470ded5533e" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tag: &lt;a href="http://technorati.com/tags/Mixin" rel="tag"&gt;Mixin&lt;/a&gt;,&lt;a href="http://technorati.com/tags/AOP" rel="tag"&gt;AOP&lt;/a&gt;,&lt;a href="http://technorati.com/tags/INotifyPropertyChanged" rel="tag"&gt;INotifyPropertyChanged&lt;/a&gt;,&lt;a href="http://technorati.com/tags/POCO" rel="tag"&gt;POCO&lt;/a&gt;&lt;/div&gt;&lt;img src="http://blogs.ugidotnet.org/bmatte/aggbug/93639.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Matteo Baglini</dc:creator>
            <guid>http://blogs.ugidotnet.org/bmatte/archive/2008/08/06/mixin-poco-e-inotifypropertychanged-mito-o-realtagrave.aspx</guid>
            <pubDate>Wed, 06 Aug 2008 21:54:54 GMT</pubDate>
            <wfw:comment>http://blogs.ugidotnet.org/bmatte/comments/93639.aspx</wfw:comment>
            <comments>http://blogs.ugidotnet.org/bmatte/archive/2008/08/06/mixin-poco-e-inotifypropertychanged-mito-o-realtagrave.aspx#feedback</comments>
            <slash:comments>6</slash:comments>
            <wfw:commentRss>http://blogs.ugidotnet.org/bmatte/comments/commentRss/93639.aspx</wfw:commentRss>
            <trackback:ping>http://blogs.ugidotnet.org/bmatte/services/trackbacks/93639.aspx</trackback:ping>
        </item>
        <item>
            <title>Google C++ Testing Framework</title>
            <category>Agile</category>
            <link>http://blogs.ugidotnet.org/bmatte/archive/2008/07/16/google-c-testing-framework.aspx</link>
            <description>Nei miei projetti C# faccio un largo uso di test unitari, utilizzando &lt;a href="http://www.nunit.org/index.php"&gt;NUnit&lt;/a&gt; o &lt;a href="http://www.codeplex.com/xunit"&gt;xUnit.NET&lt;/a&gt;, so già che entro la fine dell'anno prenderò in consegna una grande applicazione C++, quindi in passato avevo dato un'occhiata veloce a quello che era il framework di  testing di riferimento: &lt;a href="http://cppunit.sourceforge.net/cppunit-wiki"&gt;CppUnit &lt;/a&gt;. &lt;br /&gt;
Adesso Google ha rilasciato il proprio &lt;a href="http://code.google.com/p/googletest/"&gt;framework &lt;/a&gt;per fare testing automatico di codice C++, non l'ho ancora provato (...aaahhhh il tempo) ma sembra proprio ottimo!&lt;br /&gt;
&lt;br /&gt;
Fonte: &lt;a href="http://www.infoq.com/news/2008/07/google-test"&gt;InfoQ: Announcing: New Google C++ Testing Framework&lt;/a&gt;&lt;img src="http://blogs.ugidotnet.org/bmatte/aggbug/93426.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Matteo Baglini</dc:creator>
            <guid>http://blogs.ugidotnet.org/bmatte/archive/2008/07/16/google-c-testing-framework.aspx</guid>
            <pubDate>Wed, 16 Jul 2008 12:33:26 GMT</pubDate>
            <wfw:comment>http://blogs.ugidotnet.org/bmatte/comments/93426.aspx</wfw:comment>
            <comments>http://blogs.ugidotnet.org/bmatte/archive/2008/07/16/google-c-testing-framework.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://blogs.ugidotnet.org/bmatte/comments/commentRss/93426.aspx</wfw:commentRss>
            <trackback:ping>http://blogs.ugidotnet.org/bmatte/services/trackbacks/93426.aspx</trackback:ping>
        </item>
        <item>
            <title>Extension Methods and Instace Methods Conflicts</title>
            <category>.NET</category>
            <link>http://blogs.ugidotnet.org/bmatte/archive/2008/07/14/extension-methods-and-instace-methods-conflicts.aspx</link>
            <description>&lt;p&gt;Leggendo il libro &lt;a href="http://www.manning.com/marguerie/"&gt;LINQ in Action&lt;/a&gt; vinto ai &lt;a href="http://www.communitydays.it/events/communitydays2008milano.aspx"&gt;Community Days 2008&lt;/a&gt; (consegnato direttamente da &lt;a href="http://blogs.ugidotnet.org/pape"&gt;Andrea&lt;/a&gt;) ho scoperto un comportamento degli &lt;a href="http://msdn.microsoft.com/en-us/library/bb383977.aspx"&gt;Extension Methods&lt;/a&gt; che non conoscevo. Il quesito posto nel libro è: cosa succede se un Extension Method va in conflitto con un Instace Method? Semplicemente "perde la battaglia" in quanto un Extension Method ha una priorità più bassa. Riporto lo snippet e l'output presenti nel libro:&lt;/p&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;   &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; 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; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt;  &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; ExtensionMethods&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Class1&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Class2&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Method1(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; s)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;         {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;             Console.WriteLine(&lt;span style="color: #006080"&gt;"Class2.Method1"&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;         }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Class3&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  16:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  17:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Method1(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; o)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  18:&lt;/span&gt;         {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  19:&lt;/span&gt;             Console.WriteLine(&lt;span style="color: #006080"&gt;"Class3.Method1"&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  20:&lt;/span&gt;         }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  21:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  22:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Class4&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  23:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  24:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Method1(&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  25:&lt;/span&gt;         {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  26:&lt;/span&gt;             Console.WriteLine(&lt;span style="color: #006080"&gt;"Class4.Method1"&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  27:&lt;/span&gt;         }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  28:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  29:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Extension&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  30:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  31:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Method1(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt; &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; o, &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  32:&lt;/span&gt;         {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  33:&lt;/span&gt;             Console.WriteLine(&lt;span style="color: #006080"&gt;"Extension.Method1"&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  34:&lt;/span&gt;         }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  35:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  36:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Program&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  37:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  38:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Main(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;[] args)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  39:&lt;/span&gt;         {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  40:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Class1().Method1(12);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  41:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Class2().Method1(12);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  42:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Class3().Method1(12);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  43:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Class4().Method1(12);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  44:&lt;/span&gt;         }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  45:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  46:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; c