<?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>Leaning Into Windows - All Comments</title><link>http://msmvps.com/blogs/kathleen/default.aspx</link><description>Kathleen Dollard&amp;#39;s view of life and .NET development</description><dc:language>en</dc:language><generator>CommunityServer 2008 SP1 (Build: 30619.63)</generator><item><title>re: Interfacing with Insanity</title><link>http://msmvps.com/blogs/kathleen/archive/2008/08/22/interfacing-with-insanity.aspx#1646013</link><pubDate>Wed, 27 Aug 2008 20:35:45 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1646013</guid><dc:creator>Phil</dc:creator><description>&lt;p&gt;IUndoableObject is listed twice.&lt;/p&gt;
&lt;p&gt;Aren&amp;#39;t are some attributes you can apply to these items to hide them from intellisense?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1646013" width="1" height="1"&gt;</description></item><item><title>re: Interfacing with Insanity</title><link>http://msmvps.com/blogs/kathleen/archive/2008/08/22/interfacing-with-insanity.aspx#1645528</link><pubDate>Fri, 22 Aug 2008 17:26:15 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1645528</guid><dc:creator>Rob</dc:creator><description>&lt;p&gt;I don&amp;#39;t use CSLA or any other framework for BO, so I cannot address these issues entirely accurately. &amp;nbsp;But, the pattern I have used to do, what seems like similar things, is to use an explicit interface along with extension methods based on the interface. &amp;nbsp;Therefore, you hide the methods/properties of the interface from the average developer, but your extension methods can still recognize that the interface is implemented and thus provide you with the higher level features you need. &amp;nbsp;Perhaps I am misunderstanding your dilemma, but I thought it was a neat pattern worth mentioning anyway.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1645528" width="1" height="1"&gt;</description></item><item><title>re: Customer Service - Saga #1</title><link>http://msmvps.com/blogs/kathleen/archive/2008/08/16/customer-service-saga-1.aspx#1645394</link><pubDate>Thu, 21 Aug 2008 15:54:34 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1645394</guid><dc:creator>Alun Jones</dc:creator><description>&lt;p&gt;A vendor should never leave the customer hanging while they argue over whether the delivery company will pay for damage. That&amp;#39;s a debate between the shippers and the vendor, and the customer should not be affected by that.&lt;/p&gt;
&lt;p&gt;Sometimes Lenovo&amp;#39;s new model of service sucks (call support, then you have to wait for a call-back, which you have to respond to in twenty-four hours or they close your case out), at other times they reflect the service that was the reason you buy a ThinkPad in the first place. DVD drive not working? We&amp;#39;ll send you a new one, then you can ship back the old one.&lt;/p&gt;
&lt;p&gt;When it comes to a whole system, of course, especially if there&amp;#39;s a customisation, if you&amp;#39;re looking for a complete replacement, you can&amp;#39;t avoid the rebuild time.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1645394" width="1" height="1"&gt;</description></item><item><title>re: Customer Service - Saga #1</title><link>http://msmvps.com/blogs/kathleen/archive/2008/08/16/customer-service-saga-1.aspx#1644988</link><pubDate>Mon, 18 Aug 2008 23:30:55 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1644988</guid><dc:creator>Kathleen</dc:creator><description>&lt;p&gt;Mark,&lt;/p&gt;
&lt;p&gt;Thanks for your help. She just sent an email in the forums, hopefully that worked out.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll post here how the resolution proceeds.&lt;/p&gt;
&lt;p&gt;Kathleen&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1644988" width="1" height="1"&gt;</description></item><item><title>re: Customer Service - Saga #1</title><link>http://msmvps.com/blogs/kathleen/archive/2008/08/16/customer-service-saga-1.aspx#1644974</link><pubDate>Mon, 18 Aug 2008 20:10:03 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1644974</guid><dc:creator>Mark@Lenovo</dc:creator><description>&lt;p&gt;Kathleen,&lt;/p&gt;
&lt;p&gt;Apologies for your sister&amp;#39;s trouble. &amp;nbsp; Your blog post is certainly articulate and well reasoned on the matter. &amp;nbsp; I&amp;#39;ve responded in our forum, where you cross linked to this blog. &amp;nbsp;I&amp;#39;d like to help get this resolved for your sister as quickly as possible. &amp;nbsp;Can you send me a private message in the forum with the order number?&lt;/p&gt;
&lt;p&gt;Best regards, &lt;/p&gt;
&lt;p&gt;Mark&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1644974" width="1" height="1"&gt;</description></item><item><title>re: Customer Service - Saga #1</title><link>http://msmvps.com/blogs/kathleen/archive/2008/08/16/customer-service-saga-1.aspx#1644908</link><pubDate>Mon, 18 Aug 2008 01:23:17 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1644908</guid><dc:creator>Rich Quackenbush</dc:creator><description>&lt;p&gt;That sucks! &amp;nbsp;Even if your credit card company doesn&amp;#39;t have a warranty on purchased items, you can still do a chargeback (i.e. have the credit card company cancel payment to Lenovo)... &amp;nbsp;Even if you don&amp;#39;t actually do a chargeback, threatening to do so can sometimes get you a better response quicker. &amp;nbsp;The reason for that is that companies can&amp;#39;t get too many chargebacks... If they do, the account that they use to process credit card sales can be closed. &amp;nbsp;A company tends to go the extra mile to avoid the scenario.&lt;/p&gt;
&lt;p&gt;Good luck!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1644908" width="1" height="1"&gt;</description></item><item><title>re: Customer Service - Saga #1</title><link>http://msmvps.com/blogs/kathleen/archive/2008/08/16/customer-service-saga-1.aspx#1644868</link><pubDate>Sun, 17 Aug 2008 09:16:37 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1644868</guid><dc:creator>Steve</dc:creator><description>&lt;p&gt;When I purcashed my Lenovo in Australia I had great sales guys but it then was manufactured in Singapore and for some reason they did not ship it. &amp;nbsp;It had been built and I even got an email for the extended warranty telling me to register with the serial number etc just like I had already recieved it but 3 weeks later and a number of calls to the sales people it finally arrived and even then the DHL tracking number I was given never worked on the DHL website. &amp;nbsp;I am however happy to say that even though I reformated it with vista 64 (only option was to come with 32) it has been a great machine. &amp;nbsp;I hope you have some luck. &amp;nbsp;Not sure about USA but in Australia if an item does not serve it&amp;#39;s proposed purpose, eg. your pc does not even work, you are entiled under consumer code to a full refund so don&amp;#39;t take that 15% bull. &amp;nbsp;Also check with your credit card company as I had heard once about a guy who had bought something that was DOA and the retailer would not accept it back, the credit card had a warranty on items purchased on it and I he called them and they handled the whole return etc which meant that they heavied the retailed to swap it for a different item. &amp;nbsp;Good luck&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1644868" width="1" height="1"&gt;</description></item><item><title>re: Customer Service - Saga #1</title><link>http://msmvps.com/blogs/kathleen/archive/2008/08/16/customer-service-saga-1.aspx#1644849</link><pubDate>Sat, 16 Aug 2008 21:21:18 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1644849</guid><dc:creator>Kathleen</dc:creator><description>&lt;p&gt;I really should have included part of her cover email on that story:&lt;/p&gt;
&lt;p&gt;&amp;quot;See attachment - it is a good thing that we have a heavy &amp;lt;punching&amp;gt; bag so I can take out my aggression (that and drinking early).......&amp;quot;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1644849" width="1" height="1"&gt;</description></item><item><title>re: What a C# Coder Should Know Before They Write VB - Updated</title><link>http://msmvps.com/blogs/kathleen/archive/2008/07/25/what-a-c-coder-should-know-before-they-write-vb-updated.aspx#1644510</link><pubDate>Wed, 13 Aug 2008 11:00:24 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1644510</guid><dc:creator>int19h</dc:creator><description>&lt;p&gt;&amp;gt; Thanks for the comments. Everytime you dereference (. notation) you also take a small hit. &lt;/p&gt;
&lt;p&gt;You do, but the dereference occurs when using the unary dot operator inside &amp;quot;With&amp;quot; in VB as well.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1644510" width="1" height="1"&gt;</description></item><item><title>re: What a C# Coder Should Know Before They Write VB - Updated</title><link>http://msmvps.com/blogs/kathleen/archive/2008/07/25/what-a-c-coder-should-know-before-they-write-vb-updated.aspx#1643560</link><pubDate>Wed, 06 Aug 2008 14:58:54 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1643560</guid><dc:creator>Kathleen</dc:creator><description>&lt;p&gt;David,&lt;/p&gt;
&lt;p&gt;Thanks for the comments. Everytime you dereference (. notation) you also take a small hit. So, when you have a long dereference list &lt;/p&gt;
&lt;p&gt;WhosOnFirst.NoHesOnSecond.WhatsOnThird.Fourth&lt;/p&gt;
&lt;p&gt;And that is repeated several times, the derferencing hit is more than the variable initizlization. At least that was documented early on the VB help. I haven&amp;#39;t benchmarked where the change happens. &lt;/p&gt;
&lt;p&gt;With would rarely be used in the kind of code you displayed, although I think I should have been more clear because my implication that it is always faster could lead someone to use it excessively. &lt;/p&gt;
&lt;p&gt;Kathleen&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1643560" width="1" height="1"&gt;</description></item><item><title>re: What a C# Coder Should Know Before They Write VB - Updated</title><link>http://msmvps.com/blogs/kathleen/archive/2008/07/25/what-a-c-coder-should-know-before-they-write-vb-updated.aspx#1643481</link><pubDate>Tue, 05 Aug 2008 20:30:04 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1643481</guid><dc:creator>David Nelson</dc:creator><description>&lt;p&gt;@pablo,&lt;/p&gt;
&lt;p&gt;Yes it does, but many C# coders will be used to using enter for that same purpose, and will be frustrated by the fact that in VB pressing enter to accept Intellisense will also insert a newline.&lt;/p&gt;
&lt;p&gt;@Kathleen,&lt;/p&gt;
&lt;p&gt;&amp;quot;Get to know the With keyword...it will also speeds up your application somewhat.&amp;quot;&lt;/p&gt;
&lt;p&gt;I am not aware of any way that the With keyword can speed up an application. It is only a syntax shortcut. Take the following two functionally equivalent fragments:&lt;/p&gt;
&lt;p&gt;Dim rand As New Random()&lt;/p&gt;
&lt;p&gt;With rand&lt;/p&gt;
&lt;p&gt;Console.WriteLine(.Next(1, 6))&lt;/p&gt;
&lt;p&gt;Console.WriteLine(.NextDouble())&lt;/p&gt;
&lt;p&gt;Console.WriteLine(.Next(0, 100))&lt;/p&gt;
&lt;p&gt;End With&lt;/p&gt;
&lt;p&gt;Dim rand As New Random()&lt;/p&gt;
&lt;p&gt;Console.WriteLine(rand.Next(1, 6))&lt;/p&gt;
&lt;p&gt;Console.WriteLine(rand.NextDouble())&lt;/p&gt;
&lt;p&gt;Console.WriteLine(rand.Next(0, 100))&lt;/p&gt;
&lt;p&gt;If you look at the IL generated by a release build of these two fragments, the only difference is that the With version generates an extra local variable to store the result of the target expression (even if that expression is already a local variable). This translates to an extra reference slot on the stack and four extra IL instructions (one to initialize the extra variable, one to push it back onto the stack, and two to null it out at the end of the With block). A similar test with value types shows that the IL in that case is exactly equivalent.&lt;/p&gt;
&lt;p&gt;So it looks to me like With is less efficient in the case of reference types and no more efficient in the case of value types. What am I missing?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1643481" width="1" height="1"&gt;</description></item><item><title>re: We Don't Publish Words, We Publish Ideas - Get Over It</title><link>http://msmvps.com/blogs/kathleen/archive/2008/08/01/we-don-t-publish-words-we-publish-ideas-get-over-it.aspx#1643257</link><pubDate>Mon, 04 Aug 2008 08:43:14 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1643257</guid><dc:creator>Nick</dc:creator><description>&lt;p&gt;Great article, love the idea, but can I just get a word issue out of my system?&lt;/p&gt;
&lt;p&gt;There are many ways of spelling the word that sounds like &amp;quot;yaw&amp;quot; (that&amp;#39;s another one!) and several times you use &amp;quot;you&amp;#39;re&amp;quot; when you mean &amp;quot;your&amp;quot;.&lt;/p&gt;
&lt;p&gt;OK, I feel better now. Many thanks for your blog. (And allowing for comments!)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1643257" width="1" height="1"&gt;</description></item><item><title>re: We Don't Publish Words, We Publish Ideas - Get Over It</title><link>http://msmvps.com/blogs/kathleen/archive/2008/08/01/we-don-t-publish-words-we-publish-ideas-get-over-it.aspx#1643126</link><pubDate>Sat, 02 Aug 2008 18:15:34 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1643126</guid><dc:creator>Roger Jennings</dc:creator><description>&lt;p&gt;Kathleen,&lt;/p&gt;
&lt;p&gt;Pat Meader &amp;quot;has been an awsome partner through eyars of writing&amp;quot; for me, too.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m sending him a pointer to your article.&lt;/p&gt;
&lt;p&gt;--rj&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1643126" width="1" height="1"&gt;</description></item><item><title>re: What a C# Coder Should Know Before They Write VB - Updated</title><link>http://msmvps.com/blogs/kathleen/archive/2008/07/25/what-a-c-coder-should-know-before-they-write-vb-updated.aspx#1642816</link><pubDate>Thu, 31 Jul 2008 13:24:48 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1642816</guid><dc:creator>pablo</dc:creator><description>&lt;p&gt;3) ... (By the Ctl-Enter thing, I mean that you can&amp;#39;t just hit Enter to accept Intellisense. You must hit Ctl-Enter, or space or some other punctuation).&lt;/p&gt;
&lt;p&gt;Doesn&amp;#39;t the TAB key accept Intellisense with one key press and no side effects?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1642816" width="1" height="1"&gt;</description></item><item><title>re: What a C# Coder Should Know Before They Write VB - Updated</title><link>http://msmvps.com/blogs/kathleen/archive/2008/07/25/what-a-c-coder-should-know-before-they-write-vb-updated.aspx#1642441</link><pubDate>Mon, 28 Jul 2008 16:37:09 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1642441</guid><dc:creator>Michael Gillson</dc:creator><description>&lt;p&gt; &amp;nbsp;I changed jobs for only 10 months and was required to write in VB.NET &amp;nbsp;I was able to survive but I did not enjoy it. &amp;nbsp;I am glad to be back in C#.&lt;/p&gt;
&lt;p&gt; &amp;nbsp;Two things that I think that are very good in VB.NET are #29 - With and #47 - Named Arguments.&lt;/p&gt;
&lt;p&gt; &amp;nbsp;#1 - VB is a great language raised my blood pressure immediately. &amp;nbsp;My history is Delphi 1-7 and then C#. &amp;nbsp;I cannot remember how many times I wrote ActiveX controls in Delphi so the VB coders could perform some task. &amp;nbsp;There were so many language things in VB6 and early that made VB an inconsistent language to program in. With VB.NET, VB is much better. &amp;nbsp;Just as C# is better than Delphi. &amp;nbsp;So I still have a hard time with the VB is a great language. &amp;nbsp;For instance, #42 says if iterators are needed, write them in C#.&lt;/p&gt;
&lt;p&gt; &amp;nbsp;#21 - VB uses parens for both method calls and indexes. Sorry.&lt;/p&gt;
&lt;p&gt; &amp;nbsp;#32 - continuation character – the underscore followed by a space.&lt;/p&gt;
&lt;p&gt; &amp;nbsp;#37 - Namespaces. &amp;nbsp;VB.NET general hides them from you making things &amp;quot;easier&amp;quot; but then when programs grow in size, the developer has a new challenge.&lt;/p&gt;
&lt;p&gt; &amp;nbsp;#41 - Missing Surround With. &amp;nbsp;I use C# snippets from the IntelliSense and I use Surround With.&lt;/p&gt;
&lt;p&gt; &amp;nbsp;#60 - On Error, glad you recommend against using it.&lt;/p&gt;
&lt;p&gt; &amp;nbsp;The list above are just some of the things that frustrate me in VB.NET. &amp;nbsp;I know this was not the purpose of your post but I would find it interesting to see what makes VB.NET coders frustrated in writing in C# and what makes C# coders frustrated in writing in VB.NET.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1642441" width="1" height="1"&gt;</description></item><item><title>re: What a C# Coder Should Know Before They Write VB - Updated</title><link>http://msmvps.com/blogs/kathleen/archive/2008/07/25/what-a-c-coder-should-know-before-they-write-vb-updated.aspx#1642429</link><pubDate>Mon, 28 Jul 2008 14:04:13 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1642429</guid><dc:creator>Kathleen</dc:creator><description>&lt;p&gt;Chris,&lt;/p&gt;
&lt;p&gt;Working on making that happen...&lt;/p&gt;
&lt;p&gt;Kathleen&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1642429" width="1" height="1"&gt;</description></item><item><title>re: What a C# Coder Should Know Before They Write VB - Updated</title><link>http://msmvps.com/blogs/kathleen/archive/2008/07/25/what-a-c-coder-should-know-before-they-write-vb-updated.aspx#1642428</link><pubDate>Mon, 28 Jul 2008 14:04:12 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1642428</guid><dc:creator>Kathleen</dc:creator><description>&lt;p&gt;Chris,&lt;/p&gt;
&lt;p&gt;Working on making that happen...&lt;/p&gt;
&lt;p&gt;Kathleen&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1642428" width="1" height="1"&gt;</description></item><item><title>re: What a C# Coder Should Know Before They Write VB - Updated</title><link>http://msmvps.com/blogs/kathleen/archive/2008/07/25/what-a-c-coder-should-know-before-they-write-vb-updated.aspx#1642423</link><pubDate>Mon, 28 Jul 2008 12:39:05 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1642423</guid><dc:creator>Chris Pietschmann</dc:creator><description>&lt;p&gt;Now, where&amp;#39;s the &amp;quot;What a VB Coder Should Know Before They Write C#&amp;quot; article?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1642423" width="1" height="1"&gt;</description></item><item><title>re: What a C# Coder Should Know Before They Write VB</title><link>http://msmvps.com/blogs/kathleen/archive/2008/07/19/what-a-c-coder-should-know-before-they-write-vb.aspx#1642179</link><pubDate>Fri, 25 Jul 2008 22:10:20 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1642179</guid><dc:creator>dominique</dc:creator><description>&lt;p&gt;I think I found the solution (with help of a sample) :&lt;/p&gt;
&lt;p&gt;Me.RegisterShortcut(NEW_Shortcut, AddressOf ConvertedAnonymousMethod)&lt;/p&gt;
&lt;p&gt;Private Sub ConvertedAnonymousMethod()&lt;/p&gt;
&lt;p&gt; &amp;nbsp;Me.SendEventToDataInterfaceInteraction(CInt(DataInterfaceInteraction.EventID.[New]))&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1642179" width="1" height="1"&gt;</description></item><item><title>re: What a C# Coder Should Know Before They Write VB</title><link>http://msmvps.com/blogs/kathleen/archive/2008/07/19/what-a-c-coder-should-know-before-they-write-vb.aspx#1642178</link><pubDate>Fri, 25 Jul 2008 21:40:23 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1642178</guid><dc:creator>dominique</dc:creator><description>&lt;p&gt;Hi Kathleen,&lt;/p&gt;
&lt;p&gt;I love VB and I hate C# &amp;nbsp; ;))&lt;/p&gt;
&lt;p&gt;I try to convert in vb the following and I have a problem with the anonymous method :&lt;/p&gt;
&lt;p&gt;this.RegisterShortcut(NEW_Shortcut,&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;delegate()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt;this.SendEventToDataInterfaceInteraction((int)DataInterfaceInteraction.EventID.New);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;});&lt;/p&gt;
&lt;p&gt;With :&lt;/p&gt;
&lt;p&gt;private const Keys NEW_Shortcut = Keys.Control | Keys.N;&lt;/p&gt;
&lt;p&gt;/// &amp;lt;summary&amp;gt;&lt;/p&gt;
&lt;p&gt;/// Registers a shortcut and it&amp;#39;s related action with this handler.&lt;/p&gt;
&lt;p&gt;/// &amp;lt;/summary&amp;gt;&lt;/p&gt;
&lt;p&gt;/// &amp;lt;param name=&amp;quot;shortcut&amp;quot;&amp;gt;The shortcut.&amp;lt;/param&amp;gt;&lt;/p&gt;
&lt;p&gt;/// &amp;lt;param name=&amp;quot;shortcutAction&amp;quot;&amp;gt;The shortcut action.&amp;lt;/param&amp;gt;&lt;/p&gt;
&lt;p&gt;private void RegisterShortcut(Keys shortcut, ExecuteShortcut shortcutAction)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (!m_Shortcuts.ContainsKey(shortcut))&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; m_Shortcuts.Add(shortcut, shortcutAction);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt;private void SendEventToDataInterfaceInteraction(int eventId, params object[] args)&lt;/p&gt;
&lt;p&gt; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;m_Interactions.Send(eventId);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;m_Interactions.Execute();&lt;/p&gt;
&lt;p&gt; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;I can translate that in VB :&lt;/p&gt;
&lt;p&gt;Private Const NEW_Shortcut As Keys = Keys.Control Or Keys.N&lt;/p&gt;
&lt;p&gt;&amp;#39;&amp;#39;&amp;#39; &amp;lt;summary&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;#39;&amp;#39;&amp;#39; Registers a shortcut and it&amp;#39;s related action with this handler.&lt;/p&gt;
&lt;p&gt;&amp;#39;&amp;#39;&amp;#39; &amp;lt;/summary&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;#39;&amp;#39;&amp;#39; &amp;lt;param name=&amp;quot;shortcut&amp;quot;&amp;gt;The shortcut.&amp;lt;/param&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;#39;&amp;#39;&amp;#39; &amp;lt;param name=&amp;quot;shortcutAction&amp;quot;&amp;gt;The shortcut action.&amp;lt;/param&amp;gt;&lt;/p&gt;
&lt;p&gt;Private Sub RegisterShortcut(shortcut As Keys, shortcutAction As ExecuteShortcut)&lt;/p&gt;
&lt;p&gt;	If Not m_Shortcuts.ContainsKey(shortcut) Then&lt;/p&gt;
&lt;p&gt;		m_Shortcuts.Add(shortcut, shortcutAction)&lt;/p&gt;
&lt;p&gt;	End If&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
&lt;p&gt;Private Sub SendEventToDataInterfaceInteraction(ByVal eventId As Integer, _&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ByVal ParamArray args As Object())&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;m_Interactions.Send(eventId)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;m_Interactions.Execute()&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
&lt;p&gt;Thanks for your help to translate the anonymous method with the delegate. I can&amp;#39;t to do that, there is no event ..&lt;/p&gt;
&lt;p&gt;I hope it will be useful for others coders.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1642178" width="1" height="1"&gt;</description></item></channel></rss>