<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.crankygoblin.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>Public Class GeoffAppleby : Tricks</title><link>http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Tricks/default.aspx</link><description>Tags: Tricks</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61019.2)</generator><image><link>http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Tricks/default.aspx</link><title>Public Class GeoffAppleby : Tricks</title><url>http://blogs.crankygoblin.com/blogs/geoff.appleby/avatar.jpg</url></image><item><title>When is a remote not a remote?</title><link>http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/2008/01/21/when-is-a-remote-not-a-remote.aspx</link><pubDate>Sun, 20 Jan 2008 17:44:00 GMT</pubDate><guid isPermaLink="false">f5333497-6949-43cd-8aaf-46f65abc0fda:147817</guid><dc:creator>Geoff Appleby</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.crankygoblin.com/blogs/geoff.appleby/comments/147817.aspx</comments><wfw:commentRss>http://blogs.crankygoblin.com/blogs/geoff.appleby/commentrss.aspx?PostID=147817</wfw:commentRss><description>&lt;P&gt;Strangely, only a day after Mitch wrote a recent entry about Media Center [&lt;A class="" href="http://notgartner.wordpress.com/2008/01/20/ive-just-become-a-media-centre-junkie/"&gt;I've just become a Media Centre junkie&lt;/A&gt;], I've got something to say roughly on the same topic. &lt;/P&gt;
&lt;P&gt;I've been running a "Media Center" for 3 or 4 months now. I say "Media Center" rather than Media Center (look carefully, there's a difference) because of one tiny thing - I don't actually start the Windows Media Center application. It's a relatively powerful computer running Vista Ultimate (AMD X2 4600+, 2 gig ram, pretty decent video card,&amp;nbsp;a TV card - only one so far, but the same as one of Mitch's two - and a pretty big fast SATA drive). It's certainly capable, but I don't run it.&lt;/P&gt;
&lt;P&gt;You see, here's my logic:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Whenever Media Center starts, the resolution on my TV changes slightly or something and i lose the edges. It might make full-screening the video a little better, but I lose the start bar when I revert back to windows.&lt;/LI&gt;
&lt;LI&gt;While it might watch TV ok, I also watch a lot of downloaded avis. Last time I tried to play a divx in media center, the computer bluescreened. Twice.&lt;/LI&gt;
&lt;LI&gt;Media Center is ugly and annoying.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;So anyway, that's where I was at. I watch TV using the TV app that came with the TV card (which came with a remote that only works with that TV app), and I have a bluetooth mouse (so that the range works from the couch) to use iwndows explorer, browse for avis, launch them, and control media player (which &lt;EM&gt;doesn't&lt;/EM&gt; bluescreen). &lt;/P&gt;
&lt;P&gt;I used to think that all I wanted was some sort of remote driver that would give me a mouse driver - left right up and down to move the mouse, and the enter button to left click. And i'd be happy.&lt;/P&gt;
&lt;P&gt;Of course, it rarely works out that way :)&lt;/P&gt;
&lt;P&gt;Today I thought I'd get myself a media center remote. Not so that I can use media center, but because I learned how to write my own apps &lt;A class="" href="http://msdn2.microsoft.com/en-us/library/ms996387.aspx"&gt;that take input from a media center remote control&lt;/A&gt;. I thought this might give me the best of both worlds - I could use a remote for watching TV, and a remote for doing avi stuff. Since I've got a universal remote, I could blend the two together and live happily ever after with myself :)&lt;/P&gt;
&lt;P&gt;Man, I certainly haven't forgotten how to waffle, have I?&lt;/P&gt;
&lt;P&gt;Today on my lunch break I bought a media center remote control. Not a microsoft one, but some other brand, for much cheaper - 25 bucks. Bargain! I plugged it into my laptop when I got back, fired up my test app, and it was receiving input! Sweet. No disc came with it, windows just knew what to do. Didn't even contact windows update.&lt;/P&gt;
&lt;P&gt;Except that it only got half the keys. But I did some playing, and I thought I had it figured out.&lt;/P&gt;
&lt;P&gt;I got home tonight, plugged the receiver into the media center, and...&lt;/P&gt;
&lt;P&gt;Now I'm getting an unknown device problem, and it can't find the driver anywhere. And I certainly don't have one. And there's almost no mention of the brand I got on google. Almost no mention, &lt;A class="" href="http://www.mythtv.org/wiki/index.php/Generic_HID_%22MCE%22_Remotes"&gt;except for this&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;It ends up that the cheap remotes don't install remote input thingys. Instead, you get a ps2 keyboard plugged into the USB port. The infrared receiver sends key down events. This is neat in a way - since therefore on my laptop the remote works in just about every application, since it's only sending key codes. The 'MSN' button sends ctrl-n, so at the desktop that opens windows explorer. Up and down navigate the contents of folders, the ok button navigates into a folder or launches the selected file. Pause (shift-ctrl-p) pauses media player.&lt;/P&gt;
&lt;P&gt;But on the actual media center i'm getting an unknown device of 'USB to PS2 devic' - yes, no e on the end of device. I need sort of driver that handles ps2 hardware plugged into a usb port. My laptop has it already, I'm guessing, because I imagine the keyboard on a laptop is really ps2. Or something. But I imagine that the driver came with the rest of the chipset drivers for my latitude D820. But this 'device' doesn't appear in device manager that I can find, so I don't know what driver files I need to make it work on the non-laptop computer.&lt;/P&gt;
&lt;P&gt;So anyway, yeah. I have a remote that's really just a keyboard. Pretty cool in it's own way, if it worked on the computer I want it to work on.&lt;/P&gt;
&lt;P&gt;Oh, and I'm thinking of testing out media center again once I get it working. Maybe it'll be better when I have a remote for it. And maybe the divx-bluescreen issue has been fixed too. I'm not holding my breath of course.&lt;/P&gt;
&lt;P&gt;Anyone got a driver for me? Or any ideas?&lt;/P&gt;
&lt;P&gt;Oh, and side note, this comes &lt;EM&gt;just&lt;/EM&gt; after I discovered (on the weekend) that my XBox 360 can play divx movies. By turning on media sharing in media player on my media center machine, the XBox can browse it's library and play them. So I've already got a remote for watching my avis. But I'm on the quest for perfection...i'm just not sure what that is yet :)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.crankygoblin.com/aggbug.aspx?PostID=147817" width="1" height="1"&gt;</description><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Tricks/default.aspx">Tricks</category><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Rants/default.aspx">Rants</category><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Geek/default.aspx">Geek</category><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Vista/default.aspx">Vista</category></item><item><title>Quick Virtual Path Tip</title><link>http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/2006/11/15/quick-virtual-path-tip.aspx</link><pubDate>Tue, 14 Nov 2006 15:47:44 GMT</pubDate><guid isPermaLink="false">f5333497-6949-43cd-8aaf-46f65abc0fda:143163</guid><dc:creator>Geoff Appleby</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.crankygoblin.com/blogs/geoff.appleby/comments/143163.aspx</comments><wfw:commentRss>http://blogs.crankygoblin.com/blogs/geoff.appleby/commentrss.aspx?PostID=143163</wfw:commentRss><description>&lt;p&gt;In ASP.net server controls you can specify page addresses using the &lt;em&gt;tilde &lt;/em&gt;(&lt;em&gt;~&lt;/em&gt;) character to specify a path from the root of the current web application.&lt;/p&gt; &lt;p&gt;Imagine you have a site mounted on your local machine under a virtual directory called '&lt;em&gt;foo&lt;/em&gt;'. To access the homepage, you would go to &lt;em&gt;http://localhost/foo/default.aspx&lt;/em&gt;. In a server control within the site, I could reference '&lt;em&gt;~/default.aspx&lt;/em&gt;' to link to the home page, but I can't write that out as a URL - the magic of server controls in ASP.net transforms the&amp;nbsp;virtual path&amp;nbsp;to the correct url. &lt;/p&gt; &lt;p&gt;The neat thing about this is that then the same site could be mounted under a different virtual directory (or at the root of the site) and ASP.net would still translate it directly.&lt;/p&gt; &lt;p&gt;But what if you aren't inside a server control but want to do the same thing? &lt;/p&gt; &lt;p&gt;In the above example, we can do this:&lt;/p&gt; &lt;p&gt;&lt;em&gt;System.Web.VirtualPathUtility.&lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.virtualpathutility.toabsolute.aspx"&gt;ToAbsolute&lt;/a&gt;("~/default.aspx")&lt;/em&gt;&lt;/p&gt; &lt;p&gt;The returned string from this method is '&lt;em&gt;/foo/default.aspx&lt;/em&gt;'. w00t!&lt;/p&gt;&lt;img src="http://blogs.crankygoblin.com/aggbug.aspx?PostID=143163" width="1" height="1"&gt;</description><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Tricks/default.aspx">Tricks</category><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Web+Pages/default.aspx">Web Pages</category><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Geek/default.aspx">Geek</category></item><item><title>Doing Things the Long Way</title><link>http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/2006/10/27/Doing-Things-the-Long-Way.aspx</link><pubDate>Thu, 26 Oct 2006 11:13:41 GMT</pubDate><guid isPermaLink="false">f5333497-6949-43cd-8aaf-46f65abc0fda:143027</guid><dc:creator>Geoff Appleby</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.crankygoblin.com/blogs/geoff.appleby/comments/143027.aspx</comments><wfw:commentRss>http://blogs.crankygoblin.com/blogs/geoff.appleby/commentrss.aspx?PostID=143027</wfw:commentRss><description>&lt;p&gt;I wanted to do a little change to some code I'd written for CS yesterday. For both the Gaptcha control and my in-line file uploader I'm uploading a file and saving somewhere within the current user's blog. I've been constructing the save locations (and hence the URL to the saved file) in a sorta roundabout way, relying on using the Weblog.Url property to get the url to the root of the blog, and constructing the rest myself.&lt;/p&gt; &lt;p&gt;I knew there was a better way, but hadn't found the time to research I - but now&amp;nbsp;I had it and needed to do some learnin'. &lt;/p&gt; &lt;p&gt;Sometime in the last couple of weeks I remembered reading a blog post from someone about dealing with urls in Community Server. I forgot to bookmark but I knew I'd want to read it sometime, and that time was yesterday. I looked and looked and couldn't find the damn post anywhere!&lt;/p&gt; &lt;p&gt;So what do you do when you need to know something about Community Server in a hurry? Contact the friendly telligent helper-monkey&amp;nbsp;&lt;a href="http://www.dbvt.com/"&gt;Dave Burke&lt;/a&gt;! I found him on messenger and asked if he could remember seeing it - I was pretty sure I'd seen a reference to it in the &lt;a href="http://communityserver.org/blogs/dailynews/"&gt;Community Server Daily News&lt;/a&gt;, but I couldn't see it there either.&lt;/p&gt; &lt;p&gt;After a little bit of banter convincing&amp;nbsp;him that this was life-or-death important, and that I really didn't care that it was after 1AM in the states at this stage (afternoon here in Oz) he was willing to help. &amp;nbsp;And he set to with vim and vigour all manner of useful information that I didn't see immediately because I was rudely interrupted by someone who wanted to talk to me (IN PERSON!) it ends up that not only did he remember it, but &lt;a href="http://dbvt.com/blog/archive/2006/10/22/Code-Camp-6-Site-Url-Handling-talk-outline.aspx"&gt;it was him that wrote it&lt;/a&gt; :) So I got my help and he was allowed to go to bed (ok, so he went to bed while I was busy doing this talking thing, but he emailed it all to me just in case messenger died).&lt;/p&gt; &lt;p&gt;Thanks Dave. I knew you were useful for something. And in this case, you were useful big time :)&lt;/p&gt; &lt;p&gt;So having read that post, things were easy. Add a method to the BlogUrls object, register a new pattern in the siteurls.config file, and now I just call BlogUrls.Gaptcha(CurrentWeblog, desiredFileName) and it returns to me the url to the file in the Gaptcha images directory. Sweet! I think now to get the url to the file, and then save the uploaded file to that location what was around 40-50 lines of code has become ten, and is much less error-prone.&lt;/p&gt; &lt;p&gt;The moral of the story? Be nice to your monkey, or it'll&amp;nbsp;spank you :)&lt;/p&gt; &lt;p&gt;You rock, Mr Helper-Monkey! Will you be my valentine?&lt;/p&gt;&lt;img src="http://blogs.crankygoblin.com/aggbug.aspx?PostID=143027" width="1" height="1"&gt;</description><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Tricks/default.aspx">Tricks</category><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Geek/default.aspx">Geek</category><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Community+Server/default.aspx">Community Server</category><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/GAPTCHA/default.aspx">GAPTCHA</category></item><item><title>Warnings and Errors</title><link>http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/2006/10/25/Warnings-and-Errors.aspx</link><pubDate>Tue, 24 Oct 2006 13:33:27 GMT</pubDate><guid isPermaLink="false">f5333497-6949-43cd-8aaf-46f65abc0fda:143005</guid><dc:creator>Geoff Appleby</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.crankygoblin.com/blogs/geoff.appleby/comments/143005.aspx</comments><wfw:commentRss>http://blogs.crankygoblin.com/blogs/geoff.appleby/commentrss.aspx?PostID=143005</wfw:commentRss><description>&lt;p&gt;Note to self: When you get sick of seeing your error list after a build showing squillions of warnings about 'missing XML comment for publicly visible missing on type...' set 'Suppress Specific Warnings' to these codes : 1591,1592,1573,1571,1570,1572.&lt;/p&gt; &lt;p&gt;Bloody C#. I want my RAD back :)&lt;/p&gt;&lt;img src="http://blogs.crankygoblin.com/aggbug.aspx?PostID=143005" width="1" height="1"&gt;</description><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Tricks/default.aspx">Tricks</category><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Rants/default.aspx">Rants</category><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Geek/default.aspx">Geek</category></item><item><title>Want To Make a Search Provider?</title><link>http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/2006/10/23/Want-To-Make-a-Search-Provider_3F00_.aspx</link><pubDate>Sun, 22 Oct 2006 06:16:20 GMT</pubDate><guid isPermaLink="false">f5333497-6949-43cd-8aaf-46f65abc0fda:142982</guid><dc:creator>Geoff Appleby</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.crankygoblin.com/blogs/geoff.appleby/comments/142982.aspx</comments><wfw:commentRss>http://blogs.crankygoblin.com/blogs/geoff.appleby/commentrss.aspx?PostID=142982</wfw:commentRss><description>&lt;p&gt;This is quite neat.&amp;nbsp;When the non-RTM builds of IE7 were floating around, you had the opportunity to &lt;a href="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/2006/04/30/142001.aspx"&gt;write your own search providers&lt;/a&gt; for your website (or other sites) if you couldn't find one already.&lt;/p&gt; &lt;p&gt;I went through the effort of writing one (ok, so it wasn't that hard :) and also making it autodetectable for visitors to cranky goblin. But what's cool is that the people behind the IE7 web site have made it extremely easy to make them.&lt;/p&gt; &lt;p&gt;If you follow the 'Find More Providers' menu option from the dropdown next to the search box in IE7, &lt;a href="http://www.microsoft.com/windows/ie/searchguide/en-intl/default.mspx"&gt;you go to a page&lt;/a&gt; that gives links to a lot of different ones. Now it's been upgraded to include the ability to create your own on the fly, just by pasting in a URL and hitting submit. Sweet. &lt;/p&gt; &lt;p&gt;Worth &lt;a href="http://www.microsoft.com/windows/ie/searchguide/en-intl/default.mspx"&gt;checking out&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://blogs.crankygoblin.com/aggbug.aspx?PostID=142982" width="1" height="1"&gt;</description><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/General/default.aspx">General</category><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Tricks/default.aspx">Tricks</category><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Geek/default.aspx">Geek</category></item><item><title>As I Said...</title><link>http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/2006/10/19/As-I-Said_2E002E002E00_.aspx</link><pubDate>Wed, 18 Oct 2006 06:52:00 GMT</pubDate><guid isPermaLink="false">f5333497-6949-43cd-8aaf-46f65abc0fda:142945</guid><dc:creator>Geoff Appleby</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.crankygoblin.com/blogs/geoff.appleby/comments/142945.aspx</comments><wfw:commentRss>http://blogs.crankygoblin.com/blogs/geoff.appleby/commentrss.aspx?PostID=142945</wfw:commentRss><description>&lt;p&gt;&lt;strong&gt;Update: &lt;/strong&gt;&lt;a href="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/2006/10/24/Gaptcha-Source.aspx"&gt;&lt;strong&gt;The source is now live&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;!&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;I mentioned yesterday how I&amp;#39;m &lt;a href="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/2006/10/18/The-Evolution-of-Thought.aspx"&gt;not especially great at ASP.net&lt;/a&gt;. Well the update &lt;a href="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/2006/10/19/Another-GAPTCHA-Improvement.aspx"&gt;I did last night to Gaptcha&lt;/a&gt; proved it :) I added the &amp;#39;Get more pictures&amp;#39; link to the Gaptcha control, but it only worked if you had text in the comment field, because the validators kicked in.&lt;/p&gt;&lt;p&gt;Thanks to some advice from &lt;a href="http://manicprogrammer.com/cs/blogs/heynemann/"&gt;Bernardo Hynemann&lt;/a&gt;, I&amp;#39;ve seen just how easy that is to fix :)&lt;/p&gt;&lt;p&gt;My link button now has the ValidationGroup attribute set (with a value of &amp;quot;SomethingDifferent&amp;quot; just like he suggested *grin*) and now it works a treat.&lt;/p&gt;&lt;div style="font-size:10pt;background:white;color:black;font-family:consolas;"&gt;&lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;asp&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:maroon;"&gt;LinkButton&lt;/span&gt; &lt;span style="color:red;"&gt;ID&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;btnNewSet&amp;quot;&lt;/span&gt; &lt;span style="color:red;"&gt;runat&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span style="color:red;"&gt;CssClass&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;CommonTextButton&amp;quot;&lt;/span&gt; &lt;span style="color:red;"&gt;&lt;strong&gt;&lt;em&gt;ValidationGroup&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;strong&gt;&lt;em&gt;=&amp;quot;SomethingDifferent&amp;quot;&lt;/em&gt;&lt;/strong&gt;&amp;gt;&lt;/span&gt;Get some new pictures&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon;"&gt;asp&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:maroon;"&gt;LinkButton&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I really must get around to learning these validators...it looks like they&amp;#39;re quite handy :)&lt;/p&gt;&lt;p&gt;(Oh, before you say anything, I know what they are, I already know they&amp;#39;re useful, I&amp;#39;ve just never used them before. Sorry, it&amp;#39;s just sometimes people take me literally at my word and I get a very basic lesson sent to me about &lt;em&gt;what&lt;/em&gt; something is :)&lt;/p&gt;&lt;img src="http://blogs.crankygoblin.com/aggbug.aspx?PostID=142945" width="1" height="1"&gt;</description><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Tricks/default.aspx">Tricks</category><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Geek/default.aspx">Geek</category><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Community+Server/default.aspx">Community Server</category></item><item><title>Selecting A Random Amount Of Rows</title><link>http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/2006/10/17/Selecting-A-Random-Amount-Of-Rows.aspx</link><pubDate>Mon, 16 Oct 2006 20:22:04 GMT</pubDate><guid isPermaLink="false">f5333497-6949-43cd-8aaf-46f65abc0fda:142911</guid><dc:creator>Geoff Appleby</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.crankygoblin.com/blogs/geoff.appleby/comments/142911.aspx</comments><wfw:commentRss>http://blogs.crankygoblin.com/blogs/geoff.appleby/commentrss.aspx?PostID=142911</wfw:commentRss><description>&lt;p&gt;When I wrote the code for my &lt;a href="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/2006/10/17/GAPTCHA-_2D00_-It_2700_s-Live_2100_-Please-tell-me-what-you-think_2100_.aspx"&gt;Gaptcha control&lt;/a&gt;, I made one pretty silly mistake. I was developing against a SQL2005 database, but CrankyGoblin itself uses SQL2000.&lt;/p&gt; &lt;p&gt;So when I had a SQL statement like this:&lt;/p&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;select top @someParam col1, col2&lt;br&gt;from someTable&lt;/font&gt;&lt;/p&gt; &lt;p&gt;It would happily select the first @someParam rows from the table - but on SQL2000 this doesn't work. In SQL2000 you must hard code the value when calling TOP, not pass it some variable.&lt;/p&gt; &lt;p&gt;So how do you get around this? Again, thanks to my mate Noonie, I got an answer. I don't know how it works for large amounts, but in Gaptcha's case it's a pretty small amount (9 normally) you can do this:&lt;/p&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;set ROWCOUNT&amp;nbsp;@someParam&lt;br&gt;select col1, col2&lt;br&gt;from someTable&lt;br&gt;set ROWCOUNT&amp;nbsp;0&lt;/font&gt;&lt;/p&gt; &lt;p&gt;Pretty neat! Thanks Noonie - I was sure that I needed a temp table for this :)&lt;/p&gt;&lt;img src="http://blogs.crankygoblin.com/aggbug.aspx?PostID=142911" width="1" height="1"&gt;</description><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Tricks/default.aspx">Tricks</category><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Custom+Software/default.aspx">Custom Software</category><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Geek/default.aspx">Geek</category></item><item><title>Random Data</title><link>http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/2006/10/13/Random-Data.aspx</link><pubDate>Thu, 12 Oct 2006 13:00:44 GMT</pubDate><guid isPermaLink="false">f5333497-6949-43cd-8aaf-46f65abc0fda:142830</guid><dc:creator>Geoff Appleby</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.crankygoblin.com/blogs/geoff.appleby/comments/142830.aspx</comments><wfw:commentRss>http://blogs.crankygoblin.com/blogs/geoff.appleby/commentrss.aspx?PostID=142830</wfw:commentRss><description>&lt;p&gt;I needed this a while ago, and again today. It's time to blog it so I've got somewhere to look it up from :)&lt;/p&gt; &lt;p&gt;If you ever need to get rows returned from SQL Server in a random order, something like this works a treat:&lt;/p&gt; &lt;p&gt;SELECT *&lt;br&gt;FROM Northwind..Orders &lt;br&gt;ORDER BY NEWID()&lt;/p&gt; &lt;p&gt;It's the call to NEWID() that does the trick.&lt;/p&gt;&lt;img src="http://blogs.crankygoblin.com/aggbug.aspx?PostID=142830" width="1" height="1"&gt;</description><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Tricks/default.aspx">Tricks</category><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Geek/default.aspx">Geek</category></item><item><title>Note To Self</title><link>http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/2006/10/11/Note-To-Self.aspx</link><pubDate>Tue, 10 Oct 2006 06:41:33 GMT</pubDate><guid isPermaLink="false">f5333497-6949-43cd-8aaf-46f65abc0fda:142788</guid><dc:creator>Geoff Appleby</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.crankygoblin.com/blogs/geoff.appleby/comments/142788.aspx</comments><wfw:commentRss>http://blogs.crankygoblin.com/blogs/geoff.appleby/commentrss.aspx?PostID=142788</wfw:commentRss><description>&lt;p&gt;Remember to &lt;a href="http://www.danielmoth.com/Blog/2006/10/winqual.html"&gt;look into Winqual&lt;/a&gt; sometime. If it's usable for .net apps, then everyone should use it.&lt;/p&gt; &lt;p&gt;Thanks for the tip, &lt;a href="http://www.danielmoth.com/Blog/"&gt;Daniel&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://blogs.crankygoblin.com/aggbug.aspx?PostID=142788" width="1" height="1"&gt;</description><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Tricks/default.aspx">Tricks</category><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Geek/default.aspx">Geek</category></item><item><title>Douglas Stockwell's Generics Quiz</title><link>http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/2006/10/06/Douglas-Stockwell_2700_s-Generics-Quiz.aspx</link><pubDate>Thu, 05 Oct 2006 06:46:14 GMT</pubDate><guid isPermaLink="false">f5333497-6949-43cd-8aaf-46f65abc0fda:142745</guid><dc:creator>Geoff Appleby</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.crankygoblin.com/blogs/geoff.appleby/comments/142745.aspx</comments><wfw:commentRss>http://blogs.crankygoblin.com/blogs/geoff.appleby/commentrss.aspx?PostID=142745</wfw:commentRss><description>&lt;p&gt;&lt;a href="http://11011.net/"&gt;Douglas Stockwell&lt;/a&gt; posed an &lt;a href="http://11011.net/archives/000654.html"&gt;interesting problem the other day&lt;/a&gt;. He wanted to know if there was a way to make a piece of code work without falling down to reflection.&lt;/p&gt; &lt;p&gt;Personally, I can't see any way to do it without reflection, so I thought I'd post my answers on how to do it &lt;em&gt;with&lt;/em&gt; reflection here :)&lt;/p&gt; &lt;p&gt;The problem is like this.&lt;/p&gt; &lt;p&gt;You have to interfaces defined:&lt;/p&gt; &lt;div style="border-right:windowtext 1px solid;padding-right:10px;border-top:windowtext 1px solid;padding-left:10px;font-size:10pt;background:white;padding-bottom:10px;border-left:windowtext 1px solid;color:black;padding-top:10px;border-bottom:windowtext 1px solid;font-family:courier new;"&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;Public&lt;/span&gt; &lt;span style="color:blue;"&gt;Interface&lt;/span&gt; IA&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;End&lt;/span&gt; &lt;span style="color:blue;"&gt;Interface&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;Public&lt;/span&gt; &lt;span style="color:blue;"&gt;Interface&lt;/span&gt; IB&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;End&lt;/span&gt; &lt;span style="color:blue;"&gt;Interface&lt;/span&gt;&lt;/p&gt;&lt;/div&gt; &lt;p&gt;And you have a generic method that demands a generic type T such that&amp;nbsp;T implements both IA and IB. There's also a situation that takes&amp;nbsp;parameter of type IA.&lt;/p&gt; &lt;div style="border-right:windowtext 1px solid;padding-right:10px;border-top:windowtext 1px solid;padding-left:10px;font-size:10pt;background:white;padding-bottom:10px;border-left:windowtext 1px solid;color:black;padding-top:10px;border-bottom:windowtext 1px solid;font-family:courier new;"&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;Public&lt;/span&gt; &lt;span style="color:blue;"&gt;Class&lt;/span&gt; SomeClass&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;Sub&lt;/span&gt; AandB(&lt;span style="color:blue;"&gt;Of&lt;/span&gt; T &lt;span style="color:blue;"&gt;As&lt;/span&gt; {IA, IB})(&lt;span style="color:blue;"&gt;ByVal&lt;/span&gt; anb &lt;span style="color:blue;"&gt;As&lt;/span&gt; T)&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox(&lt;span style="color:maroon;"&gt;"here i am"&lt;/span&gt;)&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;End&lt;/span&gt; &lt;span style="color:blue;"&gt;Sub&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;Sub&lt;/span&gt; Situation(&lt;span style="color:blue;"&gt;ByVal&lt;/span&gt; a &lt;span style="color:blue;"&gt;As&lt;/span&gt; IA)&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;If&lt;/span&gt; &lt;span style="color:blue;"&gt;TypeOf&lt;/span&gt; a &lt;span style="color:blue;"&gt;Is&lt;/span&gt; IB &lt;span style="color:blue;"&gt;Then&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:green;"&gt;'call AandB() here somehow.&lt;/span&gt;&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;End&lt;/span&gt; &lt;span style="color:blue;"&gt;If&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;End&lt;/span&gt; &lt;span style="color:blue;"&gt;Sub&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;End&lt;/span&gt; &lt;span style="color:blue;"&gt;Class&lt;/span&gt;&lt;/p&gt;&lt;/div&gt; &lt;p&gt;So the question was: How do you call AandB() passing in the parameter 'a' from Situation()?&lt;/p&gt; &lt;p&gt;At first glance it's easy, but it's actually not. I put the code into visual studio thinking it would be a cinch, but then moment I actually tried to call AandB() it all broke :)&lt;/p&gt; &lt;p&gt;Using reflection however it's quite simple.&lt;/p&gt; &lt;div style="border-right:windowtext 1px solid;padding-right:10px;border-top:windowtext 1px solid;padding-left:10px;font-size:10pt;background:white;padding-bottom:10px;border-left:windowtext 1px solid;color:black;padding-top:10px;border-bottom:windowtext 1px solid;font-family:courier new;"&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;Public&lt;/span&gt; &lt;span style="color:blue;"&gt;Class&lt;/span&gt; SomeClass&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;Sub&lt;/span&gt; AandB(&lt;span style="color:blue;"&gt;Of&lt;/span&gt; T &lt;span style="color:blue;"&gt;As&lt;/span&gt; {IA, IB})(&lt;span style="color:blue;"&gt;ByVal&lt;/span&gt; anb &lt;span style="color:blue;"&gt;As&lt;/span&gt; T)&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox(&lt;span style="color:maroon;"&gt;"here i am"&lt;/span&gt;)&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;End&lt;/span&gt; &lt;span style="color:blue;"&gt;Sub&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;Sub&lt;/span&gt; Situation(&lt;span style="color:blue;"&gt;ByVal&lt;/span&gt; a &lt;span style="color:blue;"&gt;As&lt;/span&gt; IA)&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;If&lt;/span&gt; &lt;span style="color:blue;"&gt;TypeOf&lt;/span&gt; a &lt;span style="color:blue;"&gt;Is&lt;/span&gt; IB &lt;span style="color:blue;"&gt;Then&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;Dim&lt;/span&gt; paramType &lt;span style="color:blue;"&gt;As&lt;/span&gt; System.Type = &lt;span style="color:blue;"&gt;CObj&lt;/span&gt;(a).GetType()&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;Dim&lt;/span&gt; classType &lt;span style="color:blue;"&gt;As&lt;/span&gt; System.Type = &lt;span style="color:blue;"&gt;GetType&lt;/span&gt;(SomeClass)&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;Dim&lt;/span&gt; method &lt;span style="color:blue;"&gt;As&lt;/span&gt; System.Reflection.MethodInfo = classType.GetMethod(&lt;span style="color:maroon;"&gt;"AandB"&lt;/span&gt;, _&lt;/p&gt; &lt;p style="margin:0px;"&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; Reflection.BindingFlags.Public _&lt;/p&gt; &lt;p style="margin:0px;"&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;span style="color:blue;"&gt;Or&lt;/span&gt; Reflection.BindingFlags.Instance _&lt;/p&gt; &lt;p style="margin:0px;"&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;span style="color:blue;"&gt;Or&lt;/span&gt; Reflection.BindingFlags.DeclaredOnly)&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;Dim&lt;/span&gt; genericMethod &lt;span style="color:blue;"&gt;As&lt;/span&gt; System.Reflection.MethodInfo = method.MakeGenericMethod(paramType)&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; genericMethod.Invoke(&lt;span style="color:blue;"&gt;Me&lt;/span&gt;, &lt;span style="color:blue;"&gt;New&lt;/span&gt; &lt;span style="color:blue;"&gt;Object&lt;/span&gt;() {a})&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;End&lt;/span&gt; &lt;span style="color:blue;"&gt;If&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;End&lt;/span&gt; &lt;span style="color:blue;"&gt;Sub&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;End&lt;/span&gt; &lt;span style="color:blue;"&gt;Class&lt;/span&gt;&lt;/p&gt;&lt;/div&gt; &lt;p&gt;There's obviously no error checking going on (which you really should have) but it works.&lt;/p&gt;&lt;img src="http://blogs.crankygoblin.com/aggbug.aspx?PostID=142745" width="1" height="1"&gt;</description><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Tricks/default.aspx">Tricks</category><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Geek/default.aspx">Geek</category></item><item><title>Blog This for IE</title><link>http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/2006/09/21/Blog-This-for-IE.aspx</link><pubDate>Wed, 20 Sep 2006 19:08:17 GMT</pubDate><guid isPermaLink="false">f5333497-6949-43cd-8aaf-46f65abc0fda:142484</guid><dc:creator>Geoff Appleby</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.crankygoblin.com/blogs/geoff.appleby/comments/142484.aspx</comments><wfw:commentRss>http://blogs.crankygoblin.com/blogs/geoff.appleby/commentrss.aspx?PostID=142484</wfw:commentRss><description>&lt;p&gt;I decided to write myself a 'Blog This' extension for Live Writer for Internet Explorer.&lt;/p&gt; &lt;p&gt;Why? I hear you asking - that functionality is already around, right? Yup - it is. It comes out of the box with the Windows Live Toolbar.&lt;/p&gt; &lt;p&gt;And there is no way in hell that I'm going to install it :)&lt;/p&gt; &lt;p&gt;So on the off chance that I ever want to use a 'Blog This' type feature, I figured I'd have to write myself one. I like things simple and easy - and there's nothing simpler than adding an option the right click menu in IE.&lt;/p&gt; &lt;p&gt;So now when I'm on a page I want to blog about, I can just right click on the page and select 'Blog This'. A new post in Live Writer will start, with a link to the current page embedded.&lt;/p&gt; &lt;p&gt;Also, if I select some text on the web page, that text will also be included. Pretty neat :)&lt;/p&gt; &lt;p&gt;If you want to use it, you can &lt;a href="http://blogs.crankygoblin.com/blogs/geoff.appleby/uploads/BlogThis.zip"&gt;download it from here&lt;/a&gt;. To install, you follow 3 steps.&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Extract the files from the zip to a location of your choice (say, C:\Program Files\BlogThis)  &lt;li&gt;Modify the extracted BlogThis.reg file to contain the correct path to the extracted BlogThis.html file. (So the line in the reg file would be, say, @=file://C:\\Program Files\\BlogThis\\BlogThis.html)  &lt;li&gt;Merge the BlogThis.reg file with the registry (double click it :)&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;Every new subsequent IE window you open will include a Blog This menu item :) I've tested it in both IE6 and IE7 (RC1) and it works fine in both. Oh, but do remember, if you don't have Live Writer installed, it probably won't work :)&lt;/p&gt; &lt;p&gt;[Now Playing: Smiley Faces&amp;nbsp;- Gnarls Barkley]&lt;/p&gt;&lt;img src="http://blogs.crankygoblin.com/aggbug.aspx?PostID=142484" width="1" height="1"&gt;</description><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Tricks/default.aspx">Tricks</category><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Geek/default.aspx">Geek</category><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Windows+Live+Writer/default.aspx">Windows Live Writer</category></item><item><title>Geoff Goes 64 Bit: What I've Learned So Far</title><link>http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/2006/09/07/Geoff-Goes-64-Bit_3A00_-What-I_2700_ve-Learned-So-Far.aspx</link><pubDate>Wed, 06 Sep 2006 17:06:00 GMT</pubDate><guid isPermaLink="false">f5333497-6949-43cd-8aaf-46f65abc0fda:142378</guid><dc:creator>Geoff Appleby</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.crankygoblin.com/blogs/geoff.appleby/comments/142378.aspx</comments><wfw:commentRss>http://blogs.crankygoblin.com/blogs/geoff.appleby/commentrss.aspx?PostID=142378</wfw:commentRss><description>&lt;p&gt;As I alluded to in my &lt;a href="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/2006/09/05/Toy-Week.aspx"&gt;last post&lt;/a&gt;, I&amp;#39;m building a new computer this week. The bits did indeed arrive (yesterday) and I&amp;#39;ve used up quite a lot of my spare time putting it together and installing it.&lt;/p&gt;&lt;p&gt;First, here&amp;#39;s the hardware that I put together:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Motherboard: The Gigabyte &lt;a href="http://www.gigabyte.com.tw/Products/Motherboard/Products_Overview.aspx?ProductID=2310"&gt;GA-M55SLI-S4&lt;/a&gt;. I actually order the GA-M57SLI-S4, but the shop couldn&amp;#39;t get them in for a few weeks - and really, there&amp;#39;s not that big a different. As with all hardware I&amp;#39;ve ever got from Gigabyte, there was no issues with it, and the manual was easy enough to follow that I could work out where all the connectors were and what to hook them up to.&lt;/li&gt;&lt;li&gt;CPU:&amp;nbsp;AMD &lt;a href="http://www.amd.com/us-en/Processors/ProductInformation/0,,30_118_9485_13041,00.html"&gt;Athlon 64 X2 4200+&lt;/a&gt;. So far so good . I&amp;#39;ve installed just the stock fan that came with it rather than buying something flash, and it hasn&amp;#39;t melted yet :)&lt;/li&gt;&lt;li&gt;RAM: 2GB DDR5400 (667MHz), paired over 2x1G.&lt;/li&gt;&lt;li&gt;HDD: Seagate &lt;a href="http://www.seagate.com/cda/products/discsales/marketing/detail/0,1081,759,00.html"&gt;320GB SATA2&lt;/a&gt;. Works a treat, nice and fast :)&lt;/li&gt;&lt;li&gt;Video: The LeadTek &lt;a href="http://www.leadtek.com/3d_graphic/winfast_px7600gs_tdhce_1.html"&gt;WinFast PX7600 GS TDH Classic Edition&lt;/a&gt;. It&amp;#39;s not quite what I thought I ordered (the picture I went from when I ordered it had two DVI ports, whereas this one has one DVI and one VGA), but it&amp;#39;s still good nonetheless. Check out the picture on the product page - I&amp;#39;ve got the version with the massive heatsink and copoer tubing. Tis sweet!&lt;/li&gt;&lt;li&gt;Printer: I picked up a really cheap bargain - the Canon &lt;a href="http://www.canon.com.au/products/all_in_one_printers/all_in_one_printers/mp450.html"&gt;Pixma MP450&lt;/a&gt;. It&amp;#39;s working well so far, but I only took it out of it&amp;#39;s box this afternoon :)&lt;/li&gt;&lt;li&gt;Monitor: The BenQ &lt;a href="http://www.benq.com.au/products/LCD/?product=596"&gt;FP91G+&lt;/a&gt; was going cheap, so I grabbed one. It&amp;#39;s a 19 inch LCD that seems pretty nice so far. I only which it had a higher res than 1280x1024 - but it&amp;#39;s ok :)&lt;/li&gt;&lt;li&gt;Network: Although there&amp;#39;s onboard LAN on the motherboard, my house is actually wireless, so I got a NetGear &lt;a href="http://www.netgear.com/Products/Adapters/GWirelessAdapters/WG311.aspx"&gt;WG311&lt;/a&gt;. I already had one in my old PC that worked fine, and it&amp;#39;s really cheap too.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;On top of that, I pulled my 200GB IDe drive out of my old computer, and the DVD burner that was in it too. The case I picked up at the local computer markets&amp;nbsp;- seems to be nice and quiet.&lt;/p&gt;&lt;p&gt;The assembly all went fine, except for one little cable. The SATA HDD uses the new style SATA power connector, but the case I bought only had the normal type. A quick walk down the local shops got me what I needed - an adapter to power it :)&lt;/p&gt;&lt;p&gt;Once it was assembled, it was just an easy matter of installing the OS and the apps I need, right? Well, not so easy. I didn&amp;#39;t really think about it&amp;nbsp;- I just went ahead and installed the 64 bit edition of Windows XP. As it was installing, I recalled that perhaps there might be issues with drivers - I remember reading about how a lot of hardware manufacturers aren&amp;#39;t bothering to spend much time (if any) on 64 bit driver development.&lt;/p&gt;&lt;p&gt;Normal applications are fine - XP64 will happily run 32bit apps, but the drivers MUST be 64bit. So once I had an OS, I looked at what drivers I needed.&lt;/p&gt;&lt;p&gt;Motherboard: Easy - it&amp;#39;s a 64bit mobo, and gigabyte are a decent company. Of course they provide 64bit drivers for all the things on their board. So that covered everything except the video card and the wireless card, the mouse and keyboard.&lt;/p&gt;&lt;p&gt;Both the mouse and the keyboard that I use are Microsoft ones, so that was simple. Both IntelliPoint and IntelliType come in x64 flavours.&lt;/p&gt;&lt;p&gt;The video card was fine. Although the disk that came with it didn&amp;#39;t work, I knew I could get decent drivers for it from the nvidia website. But how can I download them when I&amp;#39;ve got no wireless support? I gave up in the end and plugged in a proper network cable and went online. So that sorted out the video card.&lt;/p&gt;&lt;p&gt;It was at about this stage I had a panic attack. I&amp;#39;ve just bought a printer - is that going to work? I searched google and saw a lot of people complaing about lack of 64bit support for printers. Luckily, Canon isn&amp;#39;t one of them, so I found a 64bit driver the printer without issue.&lt;/p&gt;&lt;p&gt;The wireless card was a problem. &lt;a href="http://kbserver.netgear.com/kb_web_files/N101596.asp"&gt;NetGear have stated&lt;/a&gt; that not only do they not support 64bit XP, they also claim that almost no-one does, and so it&amp;#39;s really not worth the risk of running 64bit XP at all. Bastards. This is pretty rich considering it&amp;#39;s the only driver I have a problem with.&lt;/p&gt;&lt;p&gt;A friend of mine has also gone wireles. He&amp;#39;s gone with the just-as-cheap &lt;a href="http://www.dlink.com/products/?pid=308"&gt;D-Link DWL-G511&lt;/a&gt;. I wondered - and yep, DLink aren&amp;#39;t supporting x64 either.&lt;/p&gt;&lt;p&gt;A lot of searching later and I cracked it. The DLink card that my friend is using happens to use the same chipset as a card made by RALink. They &lt;em&gt;do&lt;/em&gt; support x64 - and guy over at &lt;a href="http://www.planetamd64.com"&gt;planetAMD64&lt;/a&gt; &lt;a href="http://www.planetamd64.com/lofiversion/index.php/t10676.html"&gt;hacked their driver&lt;/a&gt; to accept the DLink card too :) He&amp;#39;s packaged it up for download of the planetAMD64 site, but I can&amp;#39;t link to it because you need to register (for free) to access the downloads. There&amp;#39;s a double bonus here too: I&amp;#39;ve also installed on a seperate partition the x^$ version of Vista Beta 2 (there was only an x86 version of the August CTP). The same network drivers worked under Vista!&lt;/p&gt;&lt;p&gt;So I swapped my NetGear card for his DLink (which doesn&amp;#39;t effect him since he&amp;#39;s still in 32bit land :) and it&amp;#39;s all sorted!&lt;/p&gt;&lt;p&gt;While XP64 will run 32 apps, some work better than others. In the course of installing other applications, learned tow main things.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;AVG AnitVirus is free only for 32bit platforms. You have to pay to go 64 :(&amp;nbsp; Avast, however, are free in the 64bit world :) I do prefer AVG, but free is free *nods*&lt;/li&gt;&lt;li&gt;Winzip works fine, but the right-click explorer shell extensions don&amp;#39;t work - the shell is 64bit, so 32bit shell extensions just won&amp;#39;t work.&lt;/li&gt;&lt;li&gt;SQL Server 2000 is only supported on 64bit platforms if you install SP4. Given that I was going to install it anyway, that&amp;#39;s no big deal :)&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Everything just seems to work. I&amp;#39;m sure more things will come up as time goes on, but there&amp;#39;s nothing that seems to be a deal breaker. Yet :)&lt;/p&gt;&lt;img src="http://blogs.crankygoblin.com/aggbug.aspx?PostID=142378" width="1" height="1"&gt;</description><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Future+Dealings/default.aspx">Future Dealings</category><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Tricks/default.aspx">Tricks</category><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Traps/default.aspx">Traps</category><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Geek/default.aspx">Geek</category></item><item><title>CommandLink Control for XP</title><link>http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/2006/06/25/CommandLink-Control-for-XP.aspx</link><pubDate>Sat, 24 Jun 2006 15:21:00 GMT</pubDate><guid isPermaLink="false">f5333497-6949-43cd-8aaf-46f65abc0fda:142193</guid><dc:creator>Geoff Appleby</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.crankygoblin.com/blogs/geoff.appleby/comments/142193.aspx</comments><wfw:commentRss>http://blogs.crankygoblin.com/blogs/geoff.appleby/commentrss.aspx?PostID=142193</wfw:commentRss><description>&lt;p&gt;I really like the new CommandLink control that exists in Vista. Actually, it's not a new control - it's just a new style on the button control, but it still looks damn nice.&lt;/p&gt;
&lt;p&gt;The app we're currently writing at work is being written with with a series of principals in mind, the first being 'make it as dumb as possible, the users of &lt;em&gt;this&lt;/em&gt; app are idiots!'.&lt;/p&gt;
&lt;p&gt;So I thought I'd take a leaf out of the mandates of Vista's design guidelines (Clear, Concise, Connected) and base a bit of our UI on how Vista is presenting options to the user. This is all well and good, but Vista isn't out yet, and who knows how long it will be until it's actually deployed to our users desktops!&lt;/p&gt;
&lt;p&gt;So it's time to start writing some user controls. As I get them done, I thought I'd release them here.&lt;/p&gt;
&lt;p&gt;First up is the CommandLink control. The CommandLink control is used to query an action from the user, by presenting a nice descriptive list of their choices. Here's an example screenshot from Vista of this in action:&lt;/p&gt;
&lt;p&gt;&lt;img height=463 src="/blogs/geoff.appleby/uploads/SampleCommandLinksVista.jpg" width=630 /&gt;&lt;/p&gt;
&lt;p&gt;The one that the mouse is over gets a border drawn around it to show that it's clickable, and the text becomes a lighter color, otherwise it just looks like a long text list (with icons).&lt;/p&gt;
&lt;p&gt;So using several screenshots of the above and a fair bit of playing, I've created three controls that, when put together, looks pretty much like the sample up there.&lt;/p&gt;
&lt;p&gt;The first is the CommandLink. It's one of the items that can be shown in a list. It has The main properties - Text (which is the first line of text in the CommandLink), Description (which is the next two lines) and Style (which lets you set the icon that appears). It inherits from button just like in Vista, so that you can set the CommandLink as a form's AcceptButton or CancelButton.&lt;/p&gt;
&lt;p&gt;The CommandLink is prett limited so far. You can't insert just any image at the moment, only the three I have predefined. If your description text is too long, it'll get chopped at the second line. If your main text is too long, it'll get chopped at the right hand edge. I'll get there one day, but it works for my purposes.&lt;/p&gt;
&lt;p&gt;Next is the VistaButton. This is a pretty crappy attempt at emulating how normal buttons look when used with the Aero theme in Vista. I decided to go all out and include the cancel button from the above screen shot :) It's just a normal button but I override the background image depending on the mouse state.&lt;/p&gt;
&lt;p&gt;Last is the CommandDialog. Instead of having to render the CommandLinks yourself, the CommandDialog will take a list of CommandLinks and host them then, returning to you whichever one was clicked on. It's main properties are Text (for the title bar, like on any form), Title (for the first line of text) and Description (for the second two lines). It also is pretty limited. You can also hide the Cancel button (and the whole bottom grey panel) by setting the ShowCancelButton property to false. Overriding the CancelButton property of the CommandDialog will also cause the current Cancel button to be hidden.&lt;/p&gt;
&lt;p&gt;In all cases, I've hard coded specific sizes and colors and things. What I haven't done is then hidden those properties so that people can't booger them all up. I'll get there one day, but for now, knowing that you only touch it as little as possible, they render quite nicely.&lt;/p&gt;
&lt;p&gt;I've also defaulted to using the 'Segoe UI' font, which is what Vista uses. If you don't have that installed, you'll end up with one of your system defaults (Like MS Sans Serif, or something). It won't look as good, but it still renders. I'm not sure where it comes from either - probably the fact that I have Office12&amp;nbsp; B2 installed :)&lt;/p&gt;
&lt;p&gt;The code to get it all going it pretty simple. Create a set of CommandLinks, provide them to the CommandDialog, and call it's ShowDialog() method.&lt;/p&gt;
&lt;p&gt;Here's the code for my test app.&lt;/p&gt;
&lt;div style="BORDER-RIGHT: windowtext 1px solid; PADDING-RIGHT: 3px; BORDER-TOP: windowtext 1px solid; PADDING-LEFT: 3px; FONT-SIZE: 10pt; BACKGROUND: white; PADDING-BOTTOM: 3px; OVERFLOW: auto; BORDER-LEFT: windowtext 1px solid; COLOR: black; PADDING-TOP: 3px; BORDER-BOTTOM: windowtext 1px solid; FONT-FAMILY: Courier New; HEIGHT: 350px"&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;span style="COLOR: blue"&gt;Module&lt;/span&gt; MainModule&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&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;Sub&lt;/span&gt; Main()&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&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;Dim&lt;/span&gt; oCommandDialog &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;New&lt;/span&gt; VistaControls.CommandDialog&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;Dim&lt;/span&gt; oCommandLinks &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;New&lt;/span&gt; List(&lt;span style="COLOR: blue"&gt;Of&lt;/span&gt; VistaControls.CommandLink)&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&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: green"&gt;'create our command links&lt;/span&gt;&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;For&lt;/span&gt; i &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; Int32 = 0 &lt;span style="COLOR: blue"&gt;To&lt;/span&gt; 3&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; oCommandLinks.Add(&lt;span style="COLOR: blue"&gt;New&lt;/span&gt; VistaControls.CommandLink())&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;With&lt;/span&gt; oCommandLinks(oCommandLinks.Count - 1)&lt;/p&gt;
&lt;p style="MARGIN: 0px"&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;span style="COLOR: blue"&gt;Select&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Case&lt;/span&gt; oCommandLinks.Count - 1&lt;/p&gt;
&lt;p style="MARGIN: 0px"&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; &lt;span style="COLOR: blue"&gt;Case&lt;/span&gt; 0&lt;/p&gt;
&lt;p style="MARGIN: 0px"&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; &lt;span style="COLOR: green"&gt;'normal&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&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; .Text = &lt;span style="COLOR: maroon"&gt;"Ask me again later"&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&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; .Description = &lt;span style="COLOR: maroon"&gt;"An ordinary command link has a green arrow for an icon, a title, and some descriptive text."&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&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; .Style = VistaControls.CommandLink.DisplayStyle.Arrow&lt;/p&gt;
&lt;p style="MARGIN: 0px"&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; &lt;span style="COLOR: blue"&gt;Case&lt;/span&gt; 1&lt;/p&gt;
&lt;p style="MARGIN: 0px"&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; &lt;span style="COLOR: green"&gt;'default&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&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; .Text = &lt;span style="COLOR: maroon"&gt;"This is a default command link"&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&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; .Description = &lt;span style="COLOR: maroon"&gt;"To make a command link 'default', set it as the AcceptButton on the CommandDialog form. It has a light blue border around it."&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&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; .Style = VistaControls.CommandLink.DisplayStyle.Arrow&lt;/p&gt;
&lt;p style="MARGIN: 0px"&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; &lt;span style="COLOR: blue"&gt;Case&lt;/span&gt; 2&lt;/p&gt;
&lt;p style="MARGIN: 0px"&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; &lt;span style="COLOR: green"&gt;'shield&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&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; .Text = &lt;span style="COLOR: maroon"&gt;"This is a shield command link."&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&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; .Description = &lt;span style="COLOR: maroon"&gt;"Using this one shows that clicking it will cause some action to be performed that requires admistrative privileges."&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&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; .Style = VistaControls.CommandLink.DisplayStyle.Shield&lt;/p&gt;
&lt;p style="MARGIN: 0px"&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; &lt;span style="COLOR: blue"&gt;Case&lt;/span&gt; 3&lt;/p&gt;
&lt;p style="MARGIN: 0px"&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; &lt;span style="COLOR: green"&gt;'cancel&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&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; .Text = &lt;span style="COLOR: maroon"&gt;"This is a cancel command link."&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&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; .Description = &lt;span style="COLOR: maroon"&gt;"This one can be used as a cancel button, or maybe even as a 'yes, delete this file' button, perhaps."&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&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; .Style = VistaControls.CommandLink.DisplayStyle.Cancel&lt;/p&gt;
&lt;p style="MARGIN: 0px"&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;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Select&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;With&lt;/span&gt;&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;Next&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&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;With&lt;/span&gt; oCommandDialog&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; .CommandLinks = oCommandLinks&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; .AcceptButton = oCommandLinks(1) &lt;span style="COLOR: green"&gt;' default&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: green"&gt;'.CancelButton = oCommandLinks(3) ' cancel&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; .Text = &lt;span style="COLOR: maroon"&gt;"Sample Command Dialog"&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; .Title = &lt;span style="COLOR: maroon"&gt;"This is Command Dialog"&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; .Description = &lt;span style="COLOR: maroon"&gt;"This is a sample command dialog. It has title and description text, and a set of command links."&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; .StartPosition = FormStartPosition.CenterScreen&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;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;With&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&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: green"&gt;'show it, interrogate the result&lt;/span&gt;&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;If&lt;/span&gt; oCommandDialog.ShowDialog() = DialogResult.OK &lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt; oCL &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; VistaControls.CommandLink = oCommandDialog.SelectedCommandLink&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox(&lt;span style="COLOR: maroon"&gt;"The selected CommandLink was: "&lt;/span&gt; &amp;amp; oCL.Text)&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;Else&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox(&lt;span style="COLOR: maroon"&gt;"The command dialog was closed without selecting a CommandLink"&lt;/span&gt;)&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;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;If&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Module&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;Here's a shot of the resultant dialog running in XP.&lt;/p&gt;
&lt;p&gt;&lt;img height=501 src="/blogs/geoff.appleby/uploads/CommandDialogRunning.jpg" width=447 /&gt;&lt;&gt; 
&lt;p&gt;And that's all there is to it!&lt;/p&gt;
&lt;p&gt;I'm no UserControl expert. The custom painting can probably be improved, as well as just about every other aspect of each of the controls :) I'm certainly wanting feedback on what I've done wrong, that's for sure.&lt;/p&gt;
&lt;p&gt;You can download the full source for this &lt;a href="/blogs/geoff.appleby/uploads/VistaControls.zip"&gt;from here&lt;/a&gt;. As I make updates or additions, the package will be updated.&lt;/p&gt;
&lt;p&gt;Next up, the TiledListView like Vista has :)&lt;/p&gt;&lt;/p&gt;&lt;img src="http://blogs.crankygoblin.com/aggbug.aspx?PostID=142193" width="1" height="1"&gt;</description><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Tricks/default.aspx">Tricks</category><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Geek/default.aspx">Geek</category><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Vista/default.aspx">Vista</category></item><item><title>Sharing Interfaces in WCF</title><link>http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/2006/06/08/Sharing-Interfaces-in-WCF.aspx</link><pubDate>Wed, 07 Jun 2006 18:50:00 GMT</pubDate><guid isPermaLink="false">f5333497-6949-43cd-8aaf-46f65abc0fda:142157</guid><dc:creator>Geoff Appleby</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.crankygoblin.com/blogs/geoff.appleby/comments/142157.aspx</comments><wfw:commentRss>http://blogs.crankygoblin.com/blogs/geoff.appleby/commentrss.aspx?PostID=142157</wfw:commentRss><description>&lt;p&gt;For the last couple of weeks &lt;a href="/blogs/geoff.appleby/archive/2006/05/29/Like_a_Kid_in_a_Candy_Store.aspx"&gt;I've been playing&lt;/a&gt; with WCF, Windows Workflow, and other stuff while putting together a new app that we need.&lt;/p&gt;
&lt;p&gt;It's been a steep learning curve - trying to keep things familiar (as in, the other guys on the team will still be able to follow the code, and follow generally the same architectural principals) while bringing in this new stuff. It's been extremely fun though :)&lt;/p&gt;
&lt;p&gt;I thought I'd share what I've come up with as our solution for keeping the client and server in sync, while doing my best to &lt;em&gt;not&lt;/em&gt; share business entities on both sides of the boundary. In a true &lt;em&gt;service&lt;/em&gt; &lt;em&gt;driven&lt;/em&gt; environment, this isn't an issue - you only want to match schemas. In proprietry systems, especially where it's the one team writing both sides of the service, you can be a bit more lax about this. Especially in the apps we write, where the web service is used to keep the systems &lt;em&gt;distributed&lt;/em&gt; as opposed to &lt;em&gt;service oriented&lt;/em&gt;, it's even easier to want to share business objects on both sides of the boundary. And we do. Some people have a problem with this, but I don't. So nyah :)&lt;/p&gt;
&lt;p&gt;One thing I've wished, however, is that the &lt;em&gt;server side&lt;/em&gt; logic of a shared entity didn't make it to the client - and the &lt;em&gt;client side&lt;/em&gt; logic of the entity didn't also exist on the server. It's more annoying to me for the bloat rather than the anything else, and I've been meaning to do something about it for a while.&lt;/p&gt;
&lt;p&gt;In this new app, I think I've found a pretty good way of still sharing the right schema, but being able to split the classes into client and server side version.&lt;/p&gt;
&lt;p&gt;WCF is much more heavily interface driven than old .net web services ever have been, and it was this that made me realise what's needed. Given the fact that the service definition itself must be a shared interface, why not share the interfaces of the business objects too?&lt;/p&gt;
&lt;p&gt;Sharing the service interface can be done in two ways - either the client autogenerates it based it on the wsdl, or you share the assembly that contains the definition between both the client and the server solutions. I (obviously) chose the second.&lt;/p&gt;
&lt;p&gt;So I set up a shared assembly to define the interfaces that will dictate all business objects that can be passed to and from the service. An example:&lt;/p&gt;
&lt;div style="BORDER-RIGHT: windowtext 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: windowtext 1px solid; PADDING-LEFT: 5px; FONT-SIZE: 10pt; BACKGROUND: white; PADDING-BOTTOM: 5px; MARGIN: 5px; BORDER-LEFT: windowtext 1px solid; COLOR: black; PADDING-TOP: 5px; BORDER-BOTTOM: windowtext 1px solid; FONT-FAMILY: Consolas"&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Interface&lt;/span&gt; IBusinessObject1&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;Property&lt;/span&gt; One() &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;Property&lt;/span&gt; Two() &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Interface&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;I also wrote the service interface in this same assembly, but I wrote it as a generic interface - this way I didn't need to demand any particular class (and so therefore doesn't need to be shared in the shared assembly) but I could demand specific interfaces to be in use. eg:&lt;/p&gt;
&lt;div style="BORDER-RIGHT: windowtext 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: windowtext 1px solid; PADDING-LEFT: 5px; FONT-SIZE: 10pt; BACKGROUND: white; PADDING-BOTTOM: 5px; MARGIN: 5px; BORDER-LEFT: windowtext 1px solid; COLOR: black; PADDING-TOP: 5px; BORDER-BOTTOM: windowtext 1px solid; FONT-FAMILY: Consolas"&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;lt;ServiceContract()&amp;gt; _&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Interface&lt;/span&gt; ISampleService(&lt;span style="COLOR: blue"&gt;Of&lt;/span&gt; BusinessObject1 &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; IBusinessObject1, BusinessObject2 &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; IBusinessObject2)&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;OperationContract()&amp;gt; _&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;Function&lt;/span&gt; SampleCall1() &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; BusinessObject1&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;OperationContract()&amp;gt; _&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;Function&lt;/span&gt; SampleCall2(&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt; businessObject &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; BusinessObject1) &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; BusinessObject2&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Interface&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;Then on both the client and the service, you just need to implement real server side business objects that implement these interfaces, inserting the desired extra logic along the way (In these examples, I only overrode ToString() - just to prove the point.&lt;/p&gt;
&lt;div style="BORDER-RIGHT: windowtext 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: windowtext 1px solid; PADDING-LEFT: 5px; FONT-SIZE: 10pt; BACKGROUND: white; PADDING-BOTTOM: 5px; MARGIN: 5px; OVERFLOW: auto; BORDER-LEFT: windowtext 1px solid; COLOR: black; PADDING-TOP: 5px; BORDER-BOTTOM: windowtext 1px solid; FONT-FAMILY: Consolas; HEIGHT: 250px"&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;lt;DataContract(Namespace:=&lt;span style="COLOR: maroon"&gt;"http://myApp/BusinessObject1"&lt;/span&gt;)&amp;gt; _&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Class&lt;/span&gt; BusinessObject1&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;Implements&lt;/span&gt; SharedInterfaces.IBusinessObject1&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&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; mOne &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&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; mTwo &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DataMember()&amp;gt; _&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;Property&lt;/span&gt; One() &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Implements&lt;/span&gt; SharedInterfaces.IBusinessObject1.One&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;Get&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;Return&lt;/span&gt; mOne&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;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Get&lt;/span&gt;&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;Set&lt;/span&gt;(&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt; value &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt;)&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; mOne = value&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;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Set&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Property&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DataMember()&amp;gt; _&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;Property&lt;/span&gt; Two() &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Implements&lt;/span&gt; SharedInterfaces.IBusinessObject1.Two&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;Get&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;Return&lt;/span&gt; mTwo&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;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Get&lt;/span&gt;&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;Set&lt;/span&gt;(&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt; value &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt;)&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; mTwo = value&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;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Set&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Property&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&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;Overrides&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Function&lt;/span&gt; ToString() &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt;&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; &lt;span style="COLOR: maroon"&gt;"Service entity 1 - "&lt;/span&gt; &amp;amp; One &amp;amp; &lt;span style="COLOR: maroon"&gt;" "&lt;/span&gt; &amp;amp; Two&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Function&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Class&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;And the client version:&lt;/p&gt;
&lt;div style="BORDER-RIGHT: windowtext 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: windowtext 1px solid; PADDING-LEFT: 5px; FONT-SIZE: 10pt; BACKGROUND: white; PADDING-BOTTOM: 5px; MARGIN: 5px; OVERFLOW: auto; BORDER-LEFT: windowtext 1px solid; COLOR: black; PADDING-TOP: 5px; BORDER-BOTTOM: windowtext 1px solid; FONT-FAMILY: Consolas; HEIGHT: 250px"&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;lt;DataContract(Namespace:=&lt;span style="COLOR: maroon"&gt;"http://myApp/BusinessObject1"&lt;/span&gt;)&amp;gt; _&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Class&lt;/span&gt; BusinessObject1&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;Implements&lt;/span&gt; SharedInterfaces.IBusinessObject1&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&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; mOne &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&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; mTwo &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DataMember()&amp;gt; _&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;Property&lt;/span&gt; One() &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Implements&lt;/span&gt; SharedInterfaces.IBusinessObject1.One&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;Get&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;Return&lt;/span&gt; mOne&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;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Get&lt;/span&gt;&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;Set&lt;/span&gt;(&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt; value &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt;)&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; mOne = value&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;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Set&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Property&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DataMember()&amp;gt; _&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;Property&lt;/span&gt; Two() &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Implements&lt;/span&gt; SharedInterfaces.IBusinessObject1.Two&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;Get&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;Return&lt;/span&gt; mTwo&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;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Get&lt;/span&gt;&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;Set&lt;/span&gt;(&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt; value &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt;)&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; mTwo = value&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;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Set&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Property&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&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;Overrides&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Function&lt;/span&gt; ToString() &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt;&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; &lt;span style="COLOR: maroon"&gt;"Client entity 1 - "&lt;/span&gt; &amp;amp; One &amp;amp; &lt;span style="COLOR: maroon"&gt;" "&lt;/span&gt; &amp;amp; Two&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Function&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Class&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;There's one very special peice of code here that makes it all work. WCF (specifically, the DataContractSerializer) is a smart cookie, but it's dumb at the same time. It knows if what you want (a deserialized client side object) is creatable from the XML that's come over the wire. If you went with all the defaults, a service side BusinessObject1 would not deserialize into a client side BusinessObject1. But by making sure you use the exact same namespace in the DataContractAttribute() on both ends, one happily turn magically into the other :)&lt;/p&gt;
&lt;p&gt;We also need to define our contract interface in a concrete manner:&lt;/p&gt;
&lt;div style="BORDER-RIGHT: windowtext 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: windowtext 1px solid; PADDING-LEFT: 5px; FONT-SIZE: 10pt; BACKGROUND: white; PADDING-BOTTOM: 5px; MARGIN: 5px; BORDER-LEFT: windowtext 1px solid; COLOR: black; PADDING-TOP: 5px; BORDER-BOTTOM: windowtext 1px solid; FONT-FAMILY: Consolas"&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;lt;ServiceContract()&amp;gt; _&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Interface&lt;/span&gt; ISample&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;Inherits&lt;/span&gt; SharedInterfaces.ISampleService(&lt;span style="COLOR: blue"&gt;Of&lt;/span&gt; BusinessObject1, BusinessObject2)&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Interface&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;The only other magic required is coming up with a client side proxy stub - just like is needed in plain web services. Another thing they've improved with WCF is writing them is a hell of a lot easier now that we have generics. To write a proxy by hand, you need to inherit from ClientBase, and implement your service interface (or something that looks like it). So on the client, you define a contract version of the service interface (like I did above for the service end, but this time using client side classes for the type params) and then:&lt;/p&gt;
&lt;div style="BORDER-RIGHT: windowtext 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: windowtext 1px solid; PADDING-LEFT: 5px; FONT-SIZE: 10pt; BACKGROUND: white; PADDING-BOTTOM: 5px; MARGIN: 5px; OVERFLOW: auto; BORDER-LEFT: windowtext 1px solid; COLOR: black; PADDING-TOP: 5px; BORDER-BOTTOM: windowtext 1px solid; FONT-FAMILY: Consolas; HEIGHT: 250px"&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Class&lt;/span&gt; SampleProxy&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;Inherits&lt;/span&gt; System.ServiceModel.ClientBase(&lt;span style="COLOR: blue"&gt;Of&lt;/span&gt; ISample)&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;Implements&lt;/span&gt; ISample&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&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;Function&lt;/span&gt; SampleCall1() &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; BusinessObject1 &lt;span style="COLOR: blue"&gt;Implements&lt;/span&gt; SharedInterfaces.ISampleService(&lt;span style="COLOR: blue"&gt;Of&lt;/span&gt; BusinessObject1, BusinessObject2).SampleCall1&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; &lt;span style="COLOR: blue"&gt;MyBase&lt;/span&gt;.InnerProxy.SampleCall1()&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Function&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&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;Function&lt;/span&gt; SampleCall2(&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt; businessObject &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; BusinessObject1) &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; BusinessObject2 &lt;span style="COLOR: blue"&gt;Implements&lt;/span&gt; SharedInterfaces.ISampleService(&lt;span style="COLOR: blue"&gt;Of&lt;/span&gt; BusinessObject1, BusinessObject2).SampleCall2&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; &lt;span style="COLOR: blue"&gt;MyBase&lt;/span&gt;.InnerProxy.SampleCall2(businessObject)&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Function&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&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;Sub&lt;/span&gt; &lt;span style="COLOR: blue"&gt;New&lt;/span&gt;()&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;MyBase&lt;/span&gt;.New()&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&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;Sub&lt;/span&gt; &lt;span style="COLOR: blue"&gt;New&lt;/span&gt;(&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt; endpointConfigurationName &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt;)&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;MyBase&lt;/span&gt;.New(endpointConfigurationName)&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&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;Sub&lt;/span&gt; &lt;span style="COLOR: blue"&gt;New&lt;/span&gt;(&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt; endpointConfigurationName &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt;, &lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt; remoteAddress &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt;)&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;MyBase&lt;/span&gt;.New(endpointConfigurationName, remoteAddress)&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&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;Sub&lt;/span&gt; &lt;span style="COLOR: blue"&gt;New&lt;/span&gt;(&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt; endpointConfigurationName &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt;, &lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt; remoteAddress &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; System.ServiceModel.EndpointAddress)&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;MyBase&lt;/span&gt;.New(endpointConfigurationName, remoteAddress)&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&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;Sub&lt;/span&gt; &lt;span style="COLOR: blue"&gt;New&lt;/span&gt;(&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt; binding &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; System.ServiceModel.Channels.Binding, &lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt; remoteAddress &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; System.ServiceModel.EndpointAddress)&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;MyBase&lt;/span&gt;.New(binding, remoteAddress)&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Class&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;The most annoying part of the proxy is that you have to reimplement the 5 different constructors. More than likely not all need to be done, but I've left them in for niceness.&lt;/p&gt;
&lt;p&gt;After adding the magic bits to the app.config's on both the client and the service, it all just magically works.&lt;/p&gt;
&lt;p&gt;It's especially hard to remember all the xml that needs to go into the app.config files. I generally create dummy projects, add a service reference the 'usual' way, and then copy the stuff out of the app.config's and paste it into my real app :)&lt;/p&gt;
&lt;p&gt;I've put together a working sample for people that want to see it all put together and running. You can &lt;a href="/blogs/geoff.appleby/uploads/SharedInterfacesExample.zip"&gt;download it from here&lt;/a&gt;, and give a try. Remember, you'll need the Beta2 bits of WinFX - earlier versions won't work.&lt;/p&gt;
&lt;p&gt;I'm especially interested in any comments others might have to make about this. I think it's really neat, but have I done anything here that is especially poor form?&lt;/p&gt;&lt;img src="http://blogs.crankygoblin.com/aggbug.aspx?PostID=142157" width="1" height="1"&gt;</description><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Tricks/default.aspx">Tricks</category><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Geek/default.aspx">Geek</category><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Vista/default.aspx">Vista</category></item><item><title>CopySourceAsHTML for Visual Studio 2005</title><link>http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/2006/06/02/CopySourceAsHTML-for-Visual-Studio-2005.aspx</link><pubDate>Thu, 01 Jun 2006 17:40:00 GMT</pubDate><guid isPermaLink="false">f5333497-6949-43cd-8aaf-46f65abc0fda:142139</guid><dc:creator>Geoff Appleby</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.crankygoblin.com/blogs/geoff.appleby/comments/142139.aspx</comments><wfw:commentRss>http://blogs.crankygoblin.com/blogs/geoff.appleby/commentrss.aspx?PostID=142139</wfw:commentRss><description>&lt;p&gt;Yes, I know this is more than 6 months old now, but lately I've been doing a lot of reinstalling and setting up of new logins on other people's computers - and so I have to google search again and again to find the damn download and install instructions.&lt;/p&gt;
&lt;p&gt;So now I'm&amp;nbsp;blogging it, so that now I only have to search my blog (with my handy&lt;a href="/blogs/geoff.appleby/archive/2006/04/30/142001.aspx"&gt; IE7 search provider&lt;/a&gt;, of course :)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://jasonhaley.com/blog/archive/2005/12/27/131246.aspx"&gt;&lt;em&gt;From Jason Haley:&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="BORDER-RIGHT: windowtext 1px solid; PADDING-RIGHT: 1px; BORDER-TOP: windowtext 1px solid; PADDING-LEFT: 1px; PADDING-BOTTOM: 1px; MARGIN: 5px; BORDER-LEFT: windowtext 1px solid; PADDING-TOP: 1px; BORDER-BOTTOM: windowtext 1px solid"&gt;
&lt;p&gt;Earlier this month &lt;a href="http://www.avocadosoftware.com/csblogs/dredge/archive/2005/11/21/CopySourceAsHTML_VS2005_Source_Code.aspx"&gt;dredge&lt;/a&gt; posted the &lt;a href="http://www.jtleigh.com/people/colin/software/CopySourceAsHtml/"&gt;CopySourceAsHTML&lt;/a&gt; for VS 2005 (&lt;a href="http://www.jtleigh.com/people/colin/software/CopySourceAsHtml/"&gt;Please see the official CopySourceAsHtml site for the license agreement&lt;/a&gt;).&amp;nbsp; Tonight I put an &lt;a href="http://jasonhaley.com/files/CopySourceAsHTML2005.zip"&gt;installer together&lt;/a&gt;&amp;nbsp;to make it easier for anyone to get it going.&amp;nbsp; I didn't make it a complete installer in the interest of time, so you will need to run the installer and then perform these steps:&lt;/p&gt;
&lt;p&gt;1.&amp;nbsp; In VS.Net, select Tools Menu -&amp;gt; Options -&amp;gt;Environment -&amp;gt; Addin/Macro security -&amp;gt; Add&lt;br /&gt;2.&amp;nbsp; Browse to the directory you installed it to (default directory is “C:\Program Files\J.T. Leigh &amp;amp; Associates\CopySourceAsHtml2005”)&lt;/p&gt;
&lt;p&gt;Thanks again to &lt;a href="http://www.jtleigh.com/people/colin/software/CopySourceAsHtml/"&gt;Colin Collier&lt;/a&gt;&amp;nbsp;and &lt;a href="http://www.avocadosoftware.com/"&gt;Derick Bailey&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;img src="http://blogs.crankygoblin.com/aggbug.aspx?PostID=142139" width="1" height="1"&gt;</description><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/General/default.aspx">General</category><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Tricks/default.aspx">Tricks</category><category domain="http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/tags/Geek/default.aspx">Geek</category></item></channel></rss>