<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Matthieu MEZIL : VB .Net</title><link>http://msmvps.com/blogs/matthieu/archive/tags/VB+.Net/default.aspx</link><description>Tags: VB .Net</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>EDM Designer</title><link>http://msmvps.com/blogs/matthieu/archive/2009/01/07/edm-designer.aspx</link><pubDate>Wed, 07 Jan 2009 09:36:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1658730</guid><dc:creator>Matthieu MEZIL</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/matthieu/rsscomments.aspx?PostID=1658730</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/matthieu/commentapi.aspx?PostID=1658730</wfw:comment><comments>http://msmvps.com/blogs/matthieu/archive/2009/01/07/edm-designer.aspx#comments</comments><description>&lt;p&gt;I didn&amp;rsquo;t blog for a (too) long time which is strange for me. &lt;/p&gt;
&lt;p&gt;I received some emails asking if I was ok and I found in this &lt;a target="_blank" href="http://weblogs.asp.net/scottgu/archive/2008/09/02/quick-update.aspx"&gt;a similitude between Scott Guthrie and myself&lt;/a&gt;. Lol&lt;/p&gt;
&lt;p&gt;So what did I do during my nights this last month? No I don&amp;rsquo;t sleep more and no &lt;a target="_blank" href="http://weblogs.asp.net/scottgu/archive/2008/09/02/quick-update.aspx"&gt;I wasn&amp;rsquo;t in a 6 weeks&amp;rsquo; vacation&lt;/a&gt;.&amp;nbsp; &lt;img src="http://msmvps.com/emoticons/emotion-1.gif" alt="Smile" /&gt;&lt;/p&gt;
&lt;p&gt;In fact, I&amp;#39;m beginning a very funny project: doing an EDM designer! And I thought that it was time I did my first WPF project. &lt;img src="http://msmvps.com/emoticons/emotion-1.gif" alt="Smile" /&gt;&lt;/p&gt;
&lt;p&gt;If you look at the code, you will see a VB project. Yes Julie, you read well.&amp;nbsp;&lt;img src="http://msmvps.com/emoticons/emotion-1.gif" alt="Smile" /&gt; This project is used to write an edmx file from my classes and, instead of using serialization, I choose to play with VB9 XML Literal. For all other projects, I use C# of course.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.codeplex.com/edmdesigner"&gt;The first version&lt;/a&gt; is only a CSDL read-only designer. &lt;/p&gt;
&lt;p&gt;I think it makes two interesting points compared to the current MS designer:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The ability to show only some entity types and not all&lt;/li&gt;
&lt;li&gt;The ability to show Complex Type&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img width="556" src="http://blogs.developpeur.org/photos/matthieu_mezil/images/43407/original.aspx" height="434" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;What do I want to add in the following versions?&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The ability to add or remove csdl type / property / relation / inheritance (fixing &lt;a target="_blank" href="http://msmvps.com/blogs/matthieu/archive/2008/09/17/tpt-with-designer-can-generate-errors-3034-or-3021.aspx"&gt;these bugs&lt;/a&gt; of course) and to save it into an edmx file&lt;/li&gt;
&lt;li&gt;The ability to change csdl type / property properties like the name, the visibility, etc.&lt;/li&gt;
&lt;li&gt;The ability to show and change the mapping (including TPC which isn&amp;rsquo;t supported by current MS designer)&lt;/li&gt;
&lt;li&gt;The ability to (re)generate csdl entity types from ssdl entity types. (In current MS designer, it generates it when you add the table / view from the wizard but if you delete your csdl entity type, you have to regenerate it yourself or to delete your ssdl entity type and to use the wizard to add it again. Moreover, for SSDL View, you have nothing to generate the CSDL entity type)&lt;/li&gt;
&lt;li&gt;The ability to add SSDL Views or Functions&lt;/li&gt;
&lt;li&gt;Integrate it in VS&lt;/li&gt;
&lt;li&gt;The ability to save your designer&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can download it &lt;a target="_blank" href="http://www.codeplex.com/edmdesigner"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;As I said previously, I am a WPF beginner so if you have time to audit it and if you have some remarks, advices, criticism, post a comment please.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1658730" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/matthieu/archive/tags/.Net/default.aspx">.Net</category><category domain="http://msmvps.com/blogs/matthieu/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://msmvps.com/blogs/matthieu/archive/tags/Entity+Framework+_2800_EF_2900_/default.aspx">Entity Framework (EF)</category><category domain="http://msmvps.com/blogs/matthieu/archive/tags/Entity+Data+Model+_2800_EDM_2900_/default.aspx">Entity Data Model (EDM)</category><category domain="http://msmvps.com/blogs/matthieu/archive/tags/VB+.Net/default.aspx">VB .Net</category><category domain="http://msmvps.com/blogs/matthieu/archive/tags/WPF/default.aspx">WPF</category><category domain="http://msmvps.com/blogs/matthieu/archive/tags/EDM+Designer/default.aspx">EDM Designer</category></item><item><title>Reflector IL to C# Bug</title><link>http://msmvps.com/blogs/matthieu/archive/2008/06/04/reflector-il-to-c-bug.aspx</link><pubDate>Wed, 04 Jun 2008 17:05:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1631259</guid><dc:creator>Matthieu MEZIL</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/matthieu/rsscomments.aspx?PostID=1631259</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/matthieu/commentapi.aspx?PostID=1631259</wfw:comment><comments>http://msmvps.com/blogs/matthieu/archive/2008/06/04/reflector-il-to-c-bug.aspx#comments</comments><description>&lt;p&gt;I was watching Entity Framework code&amp;nbsp;when I found this code:&lt;/p&gt;
&lt;p&gt;&lt;font color="#1000a0"&gt;switch&lt;/font&gt; (&lt;font color="#1000a0"&gt;this&lt;/font&gt;.&amp;lt;&amp;gt;1__state)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#1000a0"&gt;case&lt;/font&gt; &lt;font color="#800000"&gt;3&lt;/font&gt;:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#1000a0"&gt;case&lt;/font&gt; &lt;font color="#800000"&gt;4&lt;/font&gt;:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#1000a0"&gt;break&lt;/font&gt;;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#1000a0"&gt;default&lt;/font&gt;:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;strong&gt; &lt;font color="#1000a0"&gt;return&lt;/font&gt;;&lt;br /&gt;&lt;/strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#1000a0"&gt;try&lt;/font&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#1000a0"&gt;finally&lt;/font&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#1000a0"&gt;this&lt;/font&gt;.&lt;a title="void System.Data.EntityModel.SchemaObjectModel.EntityContainerAssociationSe"&gt;d__0.&amp;lt;&amp;gt;m__Finally6();&amp;quot; href=&amp;quot;http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Data.Entity:3.5.0.0:b77a5c561934e089/System.Data.EntityModel.SchemaObjectModel.EntityContainerAssociationSet.d__0/&amp;lt;&amp;gt;m__Finally6()&amp;quot;&amp;gt;&amp;lt;&amp;gt;m__Finally6&lt;/a&gt;();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#1000a0"&gt;break&lt;/font&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Very strange. It was the same with VB.Net. So I watched IL&amp;nbsp;and I undestood that&amp;nbsp;Reflector has a bug.&lt;/p&gt;
&lt;p&gt;Indeed the IL was next:&lt;/p&gt;
&lt;p&gt;L_0023: &lt;a title="ldfld (0x007b): Finds the value of a field in the object whose reference is currently on the evaluation stack."&gt;ldfld&lt;/a&gt; int32 System.Data.EntityModel.SchemaObjectModel.EntityContainerAssociationSet/&amp;lt;get_Ends&amp;gt;d__0::&amp;lt;&amp;gt;1__state&lt;br /&gt;L_0028: &lt;a title="stloc.1 (0x000b): Pops the current value from the top of the evaluation stack and stores it in a the local variable list at index 1."&gt;stloc.1&lt;/a&gt; &lt;br /&gt;L_0029: &lt;a title="ldloc.1 (0x0007): Loads the local variable at index 1 onto the evaluation stack."&gt;ldloc.1&lt;/a&gt; &lt;br /&gt;L_002a: &lt;a title="ldc.i4.3 (0x0019): Pushes the integer value of 3 onto the evaluation stack as an int32."&gt;ldc.i4.3&lt;/a&gt; &lt;br /&gt;L_002b: &lt;a title="sub (0x0059): Subtracts one value from another and pushes the result onto the evaluation stack."&gt;sub&lt;/a&gt; &lt;br /&gt;L_002c: &lt;a title="switch (0x0045): Implements a jump table."&gt;switch&lt;/a&gt; (L_003a, L_003a)&lt;br /&gt;L_0039: &lt;a title="ret (0x002a): Returns from the current method, pushing a return value (if present) from the caller&amp;#39;s evaluation stack onto the callee&amp;#39;s evaluation stack."&gt;ret&lt;/a&gt; &lt;br /&gt;L_003a: &lt;a title="leave.s (0x00de): Exits a protected region of code, unconditionally tranferring control to a target instruction (short form)."&gt;leave.s&lt;/a&gt; L_0043&lt;br /&gt;L_003c: &lt;a title="ldarg.0 (0x0002): Loads the argument at index 0 onto the evaluation stack."&gt;ldarg.0&lt;/a&gt; &lt;br /&gt;L_003d: &lt;a title="call (0x0028): Calls the method indicated by the passed method descriptor."&gt;call&lt;/a&gt; &lt;font color="#1000a0"&gt;instance&lt;/font&gt; void System.Data.EntityModel.SchemaObjectModel.EntityContainerAssociationSet/&amp;lt;get_Ends&amp;gt;d__0::&amp;lt;&amp;gt;m__Finally6()&lt;br /&gt;L_0042: &lt;a title="endfinally (0x00dc): Transfers control from the fault or finally clause of an exception block back to the Common Language Infrastructure (CLI) exception handler."&gt;endfinally&lt;/a&gt; &lt;br /&gt;L_0043: &lt;a title="ret (0x002a): Returns from the current method, pushing a return value (if present) from the caller&amp;#39;s evaluation stack onto the callee&amp;#39;s evaluation stack."&gt;ret&lt;/a&gt; &lt;br /&gt;&lt;font color="#1000a0"&gt;.try&lt;/font&gt; L_003a &lt;font color="#1000a0"&gt;to&lt;/font&gt; L_003c &lt;font color="#1000a0"&gt;finally&lt;/font&gt; &lt;font color="#1000a0"&gt;handler&lt;/font&gt; L_003c &lt;font color="#1000a0"&gt;to&lt;/font&gt; L_0043&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;So C# code should be:&lt;/p&gt;
&lt;p&gt;&lt;font color="#1000a0"&gt;switch&lt;/font&gt; (&lt;font color="#1000a0"&gt;this&lt;/font&gt;.&amp;lt;&amp;gt;1__state)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#1000a0"&gt;case&lt;/font&gt; &lt;font color="#800000"&gt;3&lt;/font&gt;:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#1000a0"&gt;case&lt;/font&gt; &lt;font color="#800000"&gt;4&lt;/font&gt;:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#1000a0"&gt;try&lt;/font&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#1000a0"&gt;finally&lt;/font&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#1000a0"&gt;this&lt;/font&gt;.&lt;a title="void System.Data.EntityModel.SchemaObjectModel.EntityContainerAssociationSe"&gt;d__0.&amp;lt;&amp;gt;m__Finally6();&amp;quot; href=&amp;quot;http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Data.Entity:3.5.0.0:b77a5c561934e089/System.Data.EntityModel.SchemaObjectModel.EntityContainerAssociationSet.d__0/&amp;lt;&amp;gt;m__Finally6()&amp;quot;&amp;gt;&amp;lt;&amp;gt;m__Finally6&lt;/a&gt;();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#1000a0"&gt;break&lt;/font&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#1000a0"&gt;default&lt;/font&gt;:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#1000a0"&gt;return&lt;/font&gt;;&lt;br /&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1631259" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/matthieu/archive/tags/.Net/default.aspx">.Net</category><category domain="http://msmvps.com/blogs/matthieu/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://msmvps.com/blogs/matthieu/archive/tags/MSIL/default.aspx">MSIL</category><category domain="http://msmvps.com/blogs/matthieu/archive/tags/VB+.Net/default.aspx">VB .Net</category><category domain="http://msmvps.com/blogs/matthieu/archive/tags/Bug/default.aspx">Bug</category></item><item><title>What do you think about private and protected?</title><link>http://msmvps.com/blogs/matthieu/archive/2008/05/22/what-do-you-think-about-private-and-protected.aspx</link><pubDate>Thu, 22 May 2008 14:28:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1625991</guid><dc:creator>Matthieu MEZIL</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/matthieu/rsscomments.aspx?PostID=1625991</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/matthieu/commentapi.aspx?PostID=1625991</wfw:comment><comments>http://msmvps.com/blogs/matthieu/archive/2008/05/22/what-do-you-think-about-private-and-protected.aspx#comments</comments><description>&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;"&gt;&lt;font face="Calibri"&gt;I think it should be a great thing to have two notions: class private and instance private (and the same for protected).&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;"&gt;&lt;font face="Calibri"&gt;In my mind, in a lot of case, I shouldn’t be able to do this:&lt;/font&gt;&lt;/p&gt;&lt;span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;"&gt;
&lt;div style="FONT-SIZE:10pt;BACKGROUND:white;COLOR:black;FONT-FAMILY:Courier New;"&gt;
&lt;p style="MARGIN:0px;"&gt;&lt;span style="COLOR:blue;"&gt;class&lt;/span&gt; &lt;span style="COLOR:#2b91af;"&gt;C1&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN:0px;"&gt;{&lt;/p&gt;
&lt;p style="MARGIN:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR:blue;"&gt;private&lt;/span&gt; &lt;span style="COLOR:blue;"&gt;int&lt;/span&gt; _test = 0;&lt;/p&gt;
&lt;p style="MARGIN:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR:blue;"&gt;public&lt;/span&gt; &lt;span style="COLOR:blue;"&gt;int&lt;/span&gt; Test(&lt;span style="COLOR:#2b91af;"&gt;C1&lt;/span&gt; c1)&lt;/p&gt;
&lt;p style="MARGIN:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="MARGIN:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR:blue;"&gt;return&lt;/span&gt; c1._test;&lt;/p&gt;
&lt;p style="MARGIN:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="MARGIN:0px;"&gt;}&lt;/p&gt;
&lt;p style="MARGIN:0px;"&gt;&lt;/span&gt;&lt;font face="Calibri"&gt;Indeed, when I define _test as (instance) private, I don’t want any different instance than me could access my member.&lt;/font&gt;&lt;/p&gt;&lt;/div&gt;
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;"&gt;&lt;font face="Calibri"&gt;It’s probably more important for protected because I don’t know my derived class code.&lt;/font&gt;&lt;/p&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&lt;/font&gt; 
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;"&gt;&lt;font face="Calibri"&gt;It’s sure that we must keep the class private (or protected) for singleton case for example.&lt;/font&gt;&lt;/p&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&lt;/font&gt; 
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;"&gt;&lt;font face="Calibri"&gt;What do you think about this?&lt;/font&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1625991" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/matthieu/archive/tags/.Net/default.aspx">.Net</category><category domain="http://msmvps.com/blogs/matthieu/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://msmvps.com/blogs/matthieu/archive/tags/MSIL/default.aspx">MSIL</category><category domain="http://msmvps.com/blogs/matthieu/archive/tags/VB+.Net/default.aspx">VB .Net</category></item></channel></rss>