<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Developement</title>
        <link>http://vidmar.net/weblog/category/15.aspx</link>
        <description>Developement</description>
        <language>en-US</language>
        <copyright>David Vidmar</copyright>
        <managingEditor>david@vidmar.net</managingEditor>
        <generator>Subtext Version 1.9.5.176</generator>
        <item>
            <title>Definition: Error Hangling</title>
            <link>http://vidmar.net/weblog/archive/2008/12/19/definition-error-hangling.aspx</link>
            <description>&lt;p&gt;It’s when error handling code hangs the application.&lt;/p&gt;&lt;img src="http://vidmar.net/weblog/aggbug/4655.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>David Vidmar</dc:creator>
            <guid>http://vidmar.net/weblog/archive/2008/12/19/definition-error-hangling.aspx</guid>
            <pubDate>Fri, 19 Dec 2008 21:32:32 GMT</pubDate>
            <wfw:comment>http://vidmar.net/weblog/comments/4655.aspx</wfw:comment>
            <comments>http://vidmar.net/weblog/archive/2008/12/19/definition-error-hangling.aspx#feedback</comments>
            <wfw:commentRss>http://vidmar.net/weblog/comments/commentRss/4655.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Balsamiq &amp;ndash; quick (and dirty) UI mockups</title>
            <link>http://vidmar.net/weblog/archive/2008/12/03/balsamiq-ndash-quick-and-dirty-ui-mockups.aspx</link>
            <description>&lt;p&gt;If you are in the market for simple but efficient program for doing web and desktop UI mockups, I would recommend &lt;a href="http://www.balsamiq.com/"&gt;Balsamiq&lt;/a&gt;. They offer web based tool (Flash), a desktop app (Adobe Air) and Confluence / &lt;a href="http://www.atlassian.com/software/jira/"&gt;Jira&lt;/a&gt; add-in. It’s quite inexpensive - $79 for a single user.&lt;/p&gt;  &lt;p&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="285" alt="image" src="http://vidmar.net/weblog/images/vidmar_net/weblog/WindowsLiveWriter/BalsamiqquickanddirtyUImockups_13BE0/image_3.png" width="640" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;I have been using it on and off for few weeks and I liked it very. Is pretty, fun to used and highly efficient – simple forms can be mocked in seconds. Since we are heavy Jira users at work, its cool that &lt;a href="http://www.balsamiq.com/"&gt;Balsamiq&lt;/a&gt; can be integrated and with a click of a button mockup can be added to Jira issue. I'm currently pushing request for purchase up the corporate ladder, but I think once other project managers at our company see it, it's a no brainer…&lt;/p&gt;  &lt;p&gt;I was checking out &lt;a href="http://www.balsamiq.com/"&gt;Balsamiq&lt;/a&gt; home page today and found out they are &lt;a href="http://www.balsamiq.com/products/mockups/desktop#buy"&gt;offering number of ways how to get a free license&lt;/a&gt;. In matter of minutes nice lady replied to my email and now I'm a licensed user!&lt;/p&gt;&lt;img src="http://vidmar.net/weblog/aggbug/4652.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>David Vidmar</dc:creator>
            <guid>http://vidmar.net/weblog/archive/2008/12/03/balsamiq-ndash-quick-and-dirty-ui-mockups.aspx</guid>
            <pubDate>Wed, 03 Dec 2008 21:28:07 GMT</pubDate>
            <wfw:comment>http://vidmar.net/weblog/comments/4652.aspx</wfw:comment>
            <comments>http://vidmar.net/weblog/archive/2008/12/03/balsamiq-ndash-quick-and-dirty-ui-mockups.aspx#feedback</comments>
            <wfw:commentRss>http://vidmar.net/weblog/comments/commentRss/4652.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Watermarked TextBox in Windows Forms on .NET</title>
            <link>http://vidmar.net/weblog/archive/2008/11/05/watermarked-textbox-in-windows-forms-on-.net.aspx</link>
            <description>&lt;p&gt;&lt;em&gt;Phew! It's been a while since I posted some code here! Here goes...&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;I had a modest request from a part-time-UI-designer of application I'm currently working on. He wanted &lt;a href="http://www.willasrari.com/blog/create-textbox-watermark-using-css-and-javascript/000285.aspx"&gt;watermarked input boxes as we sometimes see on the web&lt;/a&gt;, except that he wanted them in desktop application.&lt;/p&gt;  &lt;p&gt;So instead of something like this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://vidmar.net/weblog/images/vidmar_net/weblog/WindowsLiveWriter/WatermarkedTextBoxinWindowsFormson.NET_14BBD/image_4.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="191" alt="image" src="http://vidmar.net/weblog/images/vidmar_net/weblog/WindowsLiveWriter/WatermarkedTextBoxinWindowsFormson.NET_14BBD/image_thumb_1.png" width="309" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;We would have this:&lt;/p&gt;  &lt;p&gt; &lt;a href="http://vidmar.net/weblog/images/vidmar_net/weblog/WindowsLiveWriter/WatermarkedTextBoxinWindowsFormson.NET_14BBD/image_6.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="191" alt="image" src="http://vidmar.net/weblog/images/vidmar_net/weblog/WindowsLiveWriter/WatermarkedTextBoxinWindowsFormson.NET_14BBD/image_thumb_2.png" width="309" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Fair enough, I liked it. &lt;/p&gt;  &lt;p&gt;I immediately started thinking about Enter and Leave events and overlaying Label control over TextBox control and I had a good starting point with my old &lt;a href="http://www.codeproject.com/KB/miscctrl/LinkTextBox.aspx"&gt;LinkTextBox control&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;But, man, I'm glad I googled before I started coding. It turns out, the feature is only &lt;a href="http://pinvoke.net/default.aspx/user32/SendMessage.html"&gt;SendMessage&lt;/a&gt; away.&lt;/p&gt;  &lt;p&gt;So here are two implementations: &lt;/p&gt;  &lt;p&gt;First one is done with subclassing  and creating WatermarkTextBox.&lt;/p&gt;  &lt;p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;/p&gt;&lt;style type="text/css"&gt;&lt;![CDATA[


.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

.csharpcode .kwrd { color: #0000ff; }

.csharpcode .str { color: #006080; }

.csharpcode .op { color: #0000c0; }

.csharpcode .preproc { color: #cc6633; }

.csharpcode .asp { background-color: #ffff00; }

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}

.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;class&lt;/span&gt; WatermarkTextBox : TextBox
{
    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;const&lt;/span&gt; &lt;span class="kwrd"&gt;uint&lt;/span&gt; ECM_FIRST = 0x1500;
    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;const&lt;/span&gt; &lt;span class="kwrd"&gt;uint&lt;/span&gt; EM_SETCUEBANNER = ECM_FIRST + 1;

    [DllImport(&lt;span class="str"&gt;"user32.dll"&lt;/span&gt;, CharSet = CharSet.Auto, SetLastError = &lt;span class="kwrd"&gt;false&lt;/span&gt;)]
    &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;extern&lt;/span&gt; IntPtr SendMessage(IntPtr hWnd, &lt;span class="kwrd"&gt;uint&lt;/span&gt; Msg, &lt;span class="kwrd"&gt;uint&lt;/span&gt; wParam, [MarshalAs(UnmanagedType.LPWStr)] &lt;span class="kwrd"&gt;string&lt;/span&gt; lParam);

    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; watermarkText;
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; WatermarkText
    {
        get { &lt;span class="kwrd"&gt;return&lt;/span&gt; watermarkText; }
        set
        {
            watermarkText = &lt;span class="kwrd"&gt;value&lt;/span&gt;;
            SetWatermark(watermarkText);
        }
    }

    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; SetWatermark(&lt;span class="kwrd"&gt;string&lt;/span&gt; watermarkText)
    {
        SendMessage(&lt;span class="kwrd"&gt;this&lt;/span&gt;.Handle, EM_SETCUEBANNER, 0, watermarkText);
    }       

}&lt;/pre&gt;

&lt;p&gt;Other one is a simple &lt;a href="http://weblogs.asp.net/scottgu/archive/2007/03/13/new-orcas-language-feature-extension-methods.aspx"&gt;Extension Method&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;/p&gt;&lt;style type="text/css"&gt;&lt;![CDATA[

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

.csharpcode .kwrd { color: #0000ff; }

.csharpcode .str { color: #006080; }

.csharpcode .op { color: #0000c0; }

.csharpcode .preproc { color: #cc6633; }

.csharpcode .asp { background-color: #ffff00; }

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}

.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; TextBoxWatermarkExtensionMethod
{
    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;const&lt;/span&gt; &lt;span class="kwrd"&gt;uint&lt;/span&gt; ECM_FIRST = 0x1500;
    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;const&lt;/span&gt; &lt;span class="kwrd"&gt;uint&lt;/span&gt; EM_SETCUEBANNER = ECM_FIRST + 1;

    [DllImport(&lt;span class="str"&gt;"user32.dll"&lt;/span&gt;, CharSet = CharSet.Auto, SetLastError = &lt;span class="kwrd"&gt;false&lt;/span&gt;)]
    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;extern&lt;/span&gt; IntPtr SendMessage(IntPtr hWnd, &lt;span class="kwrd"&gt;uint&lt;/span&gt; Msg, &lt;span class="kwrd"&gt;uint&lt;/span&gt; wParam, [MarshalAs(UnmanagedType.LPWStr)] &lt;span class="kwrd"&gt;string&lt;/span&gt; lParam);

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; SetWatermark(&lt;span class="kwrd"&gt;this&lt;/span&gt; TextBox textBox, &lt;span class="kwrd"&gt;string&lt;/span&gt; watermarkText)
    {
        SendMessage(textBox.Handle, EM_SETCUEBANNER, 0, watermarkText);
    }

}&lt;/pre&gt;&lt;img src="http://vidmar.net/weblog/aggbug/4645.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>David Vidmar</dc:creator>
            <guid>http://vidmar.net/weblog/archive/2008/11/05/watermarked-textbox-in-windows-forms-on-.net.aspx</guid>
            <pubDate>Wed, 05 Nov 2008 22:36:21 GMT</pubDate>
            <wfw:comment>http://vidmar.net/weblog/comments/4645.aspx</wfw:comment>
            <comments>http://vidmar.net/weblog/archive/2008/11/05/watermarked-textbox-in-windows-forms-on-.net.aspx#feedback</comments>
            <wfw:commentRss>http://vidmar.net/weblog/comments/commentRss/4645.aspx</wfw:commentRss>
        </item>
        <item>
            <title>MS SQL Server Management Studio Power Pack 2008.1</title>
            <link>http://vidmar.net/weblog/archive/2008/10/13/ms-sql-server-management-studio-power-pack-2008.1.aspx</link>
            <description>&lt;p&gt;&lt;a href="http://vidmar.net/weblog/images/vidmar_net/weblog/WindowsLiveWriter/MSSQLServerManagementStudioPowerPack20.1_1365F/image_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="244" alt="image" src="http://vidmar.net/weblog/images/vidmar_net/weblog/WindowsLiveWriter/MSSQLServerManagementStudioPowerPack20.1_1365F/image_thumb.png" width="225" align="right" border="0" /&gt;&lt;/a&gt; With SQL Server 2008 came new version of MS SQL Server Management Studio that added much anticipated IntelliSense, but even now it's not putting products like &lt;a href="http://www.google.si/url?sa=t&amp;amp;source=web&amp;amp;ct=res&amp;amp;cd=1&amp;amp;url=http%3A%2F%2Froundpolygons.com%2F&amp;amp;ei=FJ7zSMnmPIXM0gTw7-GXCw&amp;amp;usg=AFQjCNHQyplaBWVopTeeT0oWt-qIeBbDew&amp;amp;sig2=14oNHOy2c0pjPpaD4xn6Lg"&gt;SQL Assist&lt;/a&gt; or &lt;a href="http://www.google.si/url?sa=t&amp;amp;source=web&amp;amp;ct=res&amp;amp;cd=2&amp;amp;url=http%3A%2F%2Fwww.red-gate.com%2FProducts%2FSQL_Prompt%2Findex.htm&amp;amp;ei=FJ7zSMnmPIXM0gTw7-GXCw&amp;amp;usg=AFQjCNHWUU2vLaWlG_irz2P-IxxJCZtLaA&amp;amp;sig2=keusOtxPE2iIKYHraj7KIA"&gt;SQL Prompt&lt;/a&gt; out of market and it doesn't work with pre-2008 databases even if you use latest Management Studio.&lt;/p&gt;  &lt;p&gt;If you would like some more power features in Management Studio, new version of &lt;a href="http://vidmar.net/weblog/weblog/archive/2007/09/23/links-of-the-week-4-week-3807.aspx"&gt;previously&lt;/a&gt; &lt;a href="http://vidmar.net/weblog/archive/2008/05/11/links-of-the-week-35amp36-week-17amp182008.aspx"&gt;mentioned&lt;/a&gt; &lt;a href="http://www.ssmstoolspack.com/"&gt;SSMS Tools Pack&lt;/a&gt; from Mladen of &lt;a href="http://weblogs.sqlteam.com/mladenp/"&gt;I want some moore&lt;/a&gt; fame is your poison. &lt;/p&gt;  &lt;p&gt;My favorite features include:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;query history,&lt;/li&gt;    &lt;li&gt;insert statement generation,&lt;/li&gt;    &lt;li&gt;CRUD statement generation,&lt;/li&gt;    &lt;li&gt;full database search, &lt;/li&gt;    &lt;li&gt;running single script on multiple databases,&lt;/li&gt;    &lt;li&gt;new query template.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;But there is &lt;a href="http://weblogs.sqlteam.com/mladenp/archive/2008/10/06/SSMS-Tools-PACK-1.1---now-with-SQL-Server-Management.aspx"&gt;more&lt;/a&gt;, depending on your needs. &lt;/p&gt;&lt;img src="http://vidmar.net/weblog/aggbug/4640.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>David Vidmar</dc:creator>
            <guid>http://vidmar.net/weblog/archive/2008/10/13/ms-sql-server-management-studio-power-pack-2008.1.aspx</guid>
            <pubDate>Mon, 13 Oct 2008 20:04:30 GMT</pubDate>
            <wfw:comment>http://vidmar.net/weblog/comments/4640.aspx</wfw:comment>
            <comments>http://vidmar.net/weblog/archive/2008/10/13/ms-sql-server-management-studio-power-pack-2008.1.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://vidmar.net/weblog/comments/commentRss/4640.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Cannot access MSDN Subscriptions site</title>
            <link>http://vidmar.net/weblog/archive/2008/10/03/cannot-access-msdn-subscriptions-site.aspx</link>
            <description>&lt;p&gt;If you get this error while trying to access MSDN subscriptions section you might be victim of a bug of latest update to MSDN site that was done in late September 2008.&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font color="#ff0000"&gt;&lt;em&gt;The Windows Live Network is unavailable from this site for one of the following reasons:&lt;/em&gt;&lt;/font&gt; &lt;/p&gt;&lt;ul&gt; &lt;li&gt;&lt;em&gt;This site may be experiencing a problem &lt;/em&gt; &lt;/li&gt;&lt;li&gt;&lt;em&gt;The site may not be a member of the Windows Live Network&lt;/em&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt; &lt;p&gt;Clearing cookies and logging in again &lt;a target="_blank" href="http://blogs.msdn.com/msdnsubscriptions/archive/2008/09/19/subscribers-will-not-be-able-to-download-saturday-during-scheduled-maintenance.aspx"&gt;should fix the situation&lt;/a&gt;.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;&lt;a href="http://vidmar.net/weblog/images/vidmar_net/weblog/WindowsLiveWriter/CannotaccessMSDNSubscriptionssite_8417/image_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px" border="0" alt="image" src="http://vidmar.net/weblog/images/vidmar_net/weblog/WindowsLiveWriter/CannotaccessMSDNSubscriptionssite_8417/image_thumb.png" width="660" height="211" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://vidmar.net/weblog/aggbug/4637.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>David Vidmar</dc:creator>
            <guid>http://vidmar.net/weblog/archive/2008/10/03/cannot-access-msdn-subscriptions-site.aspx</guid>
            <pubDate>Fri, 03 Oct 2008 07:23:31 GMT</pubDate>
            <wfw:comment>http://vidmar.net/weblog/comments/4637.aspx</wfw:comment>
            <comments>http://vidmar.net/weblog/archive/2008/10/03/cannot-access-msdn-subscriptions-site.aspx#feedback</comments>
            <wfw:commentRss>http://vidmar.net/weblog/comments/commentRss/4637.aspx</wfw:commentRss>
        </item>
        <item>
            <title>When cloud goes down</title>
            <link>http://vidmar.net/weblog/archive/2008/07/20/when-clouds-go-down.aspx</link>
            <description>&lt;p&gt;&lt;/p&gt;  &lt;p&gt;Cloud computing is all the rage this days. But what happens when the cloud goes down? &lt;a href="http://www.urbandictionary.com/define.php?defid=1087937&amp;amp;term=Cluster+Fuck" target="_blank"&gt;CF&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Is seems that &lt;a href="http://status.aws.amazon.com/" target="_blank"&gt;Amazon S3 is down&lt;/a&gt;. [update: down 3+ hours]&lt;/p&gt;  &lt;p&gt;&lt;a href="http://vidmar.net/weblog/images/vidmar_net/weblog/WindowsLiveWriter/WhencloudsgodownAmazonS3down_12DC6/image_10.png" rel="lightbox"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="image" border="0" alt="image" src="http://vidmar.net/weblog/images/vidmar_net/weblog/WindowsLiveWriter/WhencloudsgodownAmazonS3down_12DC6/image_thumb_4.png" width="170" height="154" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I’m writing an article about &lt;a href="http://www.picnik.com" target="_blank"&gt;Picnik&lt;/a&gt;, but it’s behaving strange, &lt;a href="http://www.vimeo.com" target="_blank"&gt;Vimeo&lt;/a&gt; is missing it’s content, &lt;a href="http://www.smugmug.com" target="_blank"&gt;SmugMug&lt;/a&gt; is completely down…&lt;/p&gt;  &lt;p&gt; &lt;a href="http://vidmar.net/weblog/images/vidmar_net/weblog/WindowsLiveWriter/WhencloudsgodownAmazonS3down_12DC6/image_8.png" rel="lightbox"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="image" border="0" alt="image" src="http://vidmar.net/weblog/images/vidmar_net/weblog/WindowsLiveWriter/WhencloudsgodownAmazonS3down_12DC6/image_thumb_3.png" width="170" height="112" /&gt;&lt;/a&gt; &lt;a href="http://vidmar.net/weblog/images/vidmar_net/weblog/WindowsLiveWriter/WhencloudsgodownAmazonS3down_12DC6/image_2.png" rel="lightbox"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="image" border="0" alt="image" src="http://vidmar.net/weblog/images/vidmar_net/weblog/WindowsLiveWriter/WhencloudsgodownAmazonS3down_12DC6/image_thumb.png" width="170" height="119" /&gt;&lt;/a&gt;  &lt;a href="http://vidmar.net/weblog/images/vidmar_net/weblog/WindowsLiveWriter/WhencloudsgodownAmazonS3down_12DC6/image_4.png" rel="lightbox"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="image" border="0" alt="image" src="http://vidmar.net/weblog/images/vidmar_net/weblog/WindowsLiveWriter/WhencloudsgodownAmazonS3down_12DC6/image_thumb_1.png" width="170" height="136" /&gt;&lt;/a&gt; &lt;a href="http://vidmar.net/weblog/images/vidmar_net/weblog/WindowsLiveWriter/WhencloudsgodownAmazonS3down_12DC6/image_6.png" rel="lightbox"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="image" border="0" alt="image" src="http://vidmar.net/weblog/images/vidmar_net/weblog/WindowsLiveWriter/WhencloudsgodownAmazonS3down_12DC6/image_thumb_2.png" width="170" height="178" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://vidmar.net/weblog/aggbug/4623.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>David Vidmar</dc:creator>
            <guid>http://vidmar.net/weblog/archive/2008/07/20/when-clouds-go-down.aspx</guid>
            <pubDate>Sun, 20 Jul 2008 19:37:36 GMT</pubDate>
            <wfw:comment>http://vidmar.net/weblog/comments/4623.aspx</wfw:comment>
            <comments>http://vidmar.net/weblog/archive/2008/07/20/when-clouds-go-down.aspx#feedback</comments>
            <wfw:commentRss>http://vidmar.net/weblog/comments/commentRss/4623.aspx</wfw:commentRss>
        </item>
        <item>
            <title>GetCanon! 1.7</title>
            <link>http://vidmar.net/weblog/archive/2008/07/17/getcanon-1.7.aspx</link>
            <description>&lt;p&gt;&lt;strong&gt;&lt;em&gt;This is a minor release that I made since users asked for it. &lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;Please read the note below before asking about why new cameras aren’t supported and why it doesn’t work on Windows Vista!&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;GetCanon! is a image downloader for &lt;a href="http://www.canon-europe.com/For_Home/Product_Finder/Cameras/Digital/index.asp?ComponentID=25190&amp;amp;SourcePageID=26009#2"&gt;Canon digital cameras&lt;/a&gt;. It's small, quick and simple. It can download images, rotate them automatically and delete them from camera. If you hate the "designer" interface of Canon utilities and hate Windows messing with image filenames, this is the right tool for you. &lt;/p&gt;  &lt;p&gt;GetCanon! is freeware. It includes open-source program JpegTran from &lt;a href="http://www.ijg.org/"&gt;Independent JPEG Group's&lt;/a&gt; JPEG software.&lt;/p&gt;  &lt;p&gt;The program has been downloaded more than 30,000 times from my own server only and is hosted on many sites around the web. This is what user of GetCanon! think about it:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;This application is exactly what I've been looking for. &lt;/li&gt;    &lt;li&gt;I found GetCanon! as a very useful tool for my PowerShot camera. &lt;/li&gt;    &lt;li&gt;Thanks this is exactly what I was looking for: something that just works! Thanks!!! &lt;/li&gt;    &lt;li&gt;Wow -- this is a great utility!  &lt;/li&gt;    &lt;li&gt;I like your hassle free program a lot. It's much better than the annoying canon software included with my camera. &lt;/li&gt;    &lt;li&gt;Thanks very much for writing GetCanon and thanks, too, for making it freely available. I love elegant, snappy &amp;amp; simple programs ... just like GetCanon. &lt;/li&gt;    &lt;li&gt;GetCanon is the _only_ software, including Canon's CameraWindow, that is able to transfer a ~900MB AVI File from my Cam, at all. I don't know why, all the others crashed, freezed, or produced a NULL Byte file after working for ages. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;img border="0" hspace="0" alt="" align="bottom" src="http://vidmar.net/weblog/images/posts/GetCanon160.png" /&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Download: &lt;/strong&gt;&lt;img alt="" align="right" src="http://www.snapfiles.com/linkedimg/r_snapfiles40-05.gif" /&gt; &lt;img alt="" align="right" src="http://www.softpedia.com/images/spyward/softpedia_clean_award_f.gif" /&gt;&lt;a href="http://www.vidmar.net/download.aspx?file=GetCanon170Setup.exe"&gt;&lt;strong&gt;GetCanon! 1.7 Setup&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt; &lt;/strong&gt;(1016 KB)&lt;/p&gt;  &lt;p&gt;&lt;em&gt;This software requires &lt;/em&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=0856eacb-4362-4b0d-8edd-aab15c5e04f5&amp;amp;displaylang=en"&gt;Microsoft .NET Framework 2.0&lt;/a&gt;&lt;em&gt;&lt;/em&gt;&lt;em&gt;. You probably have it on your computer but if you don't you can download it free from &lt;/em&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=262D25E3-F589-4842-8157-034D1E7CF3A3&amp;amp;displaylang=en"&gt;&lt;em&gt;Microsoft&lt;/em&gt;&lt;/a&gt;&lt;em&gt;.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;What's new since &lt;/strong&gt;&lt;a href="http://vidmar.net/weblog/archive/2005/11/06/2376.aspx"&gt;version 1.6&lt;/a&gt;&lt;strong&gt;&lt;/strong&gt;&lt;strong&gt;:&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Added Czech language. &lt;/li&gt;    &lt;li&gt;Fixed some minor glitches in Dutch translations. &lt;/li&gt;    &lt;li&gt;Other minor fixes. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Acknowledgments:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Big thanks to all of translators and testers. These include: Marko Juvančič, Gregor Šuster, Mojca Knaus, Roberto Boriotti, Tobias Sürig, Jac Willekens, Patrick Abi Salloum, Kasper Garns, Adam Nemeth, Marko Justinek and Steffen Klemichen, Josef Remes.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Supported cameras in version 1.7:&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;PowerShot A10, PowerShot A20, PowerShot A30, PowerShot A40, PowerShot A60, &lt;/li&gt;    &lt;li&gt;PowerShot A70, PowerShot A75, PowerShot A80, PowerShot A85, PowerShot A95, &lt;/li&gt;    &lt;li&gt;PowerShot A100, PowerShot A200, PowerShot A300, PowerShot A310, PowerShot A400, PowerShot A510, PowerShot A520, &lt;/li&gt;    &lt;li&gt;PowerShot S10, PowerShot S20, PowerShot S30, PowerShot S40, PowerShot S45, PowerShot S50, PowerShot S60, PowerShot S70, &lt;/li&gt;    &lt;li&gt;PowerShot S100, IXY DIGITAL, DIGITAL IXUS, &lt;/li&gt;    &lt;li&gt;PowerShot S110, IXY DIGITAL 200, DIGITAL IXUS v, &lt;/li&gt;    &lt;li&gt;PowerShot S200, IXY DIGITAL 200a, DIGITAL IXUS v2, &lt;/li&gt;    &lt;li&gt;PowerShot S230, IXY DIGITAL 320, DIGITAL IXUS v3, &lt;/li&gt;    &lt;li&gt;PowerShot S300, IXY DIGITAL 300, DIGITAL IXUS 300, &lt;/li&gt;    &lt;li&gt;PowerShot S330, IXY DIGITAL 300a, DIGITAL IXUS 330, &lt;/li&gt;    &lt;li&gt;PowerShot S400, IXY DIGITAL 400, DIGITAL IXUS 400, &lt;/li&gt;    &lt;li&gt;PowerShot SD100, IXY DIGITAL 30, DIGITAL IXUS II, &lt;/li&gt;    &lt;li&gt;PowerShot SD10, IXY DIGITAL L, DIGITAL IXUS i, &lt;/li&gt;    &lt;li&gt;PowerShot SD110, IXY DIGITAL 30a, DIGITAL IXUS IIs, &lt;/li&gt;    &lt;li&gt;PowerShot S410, IXY DIGITAL 450, DIGITAL IXUS 430, &lt;/li&gt;    &lt;li&gt;PowerShot S500, IXY DIGITAL 500, DIGITAL IXUS 500, &lt;/li&gt;    &lt;li&gt;PowerShot SD20, IXY DIGITAL L2, DIGITAL IXUS I5, &lt;/li&gt;    &lt;li&gt;PowerShot SD200, IXY DIGITAL 40, DIGITAL IXUS 30, &lt;/li&gt;    &lt;li&gt;PowerShot SD300, IXY DIGITAL 50, DIGITAL IXUS 40, &lt;/li&gt;    &lt;li&gt;PowerShot SD400, IXY DIGITAL 55, DIGITAL IXUS 50, &lt;/li&gt;    &lt;li&gt;PowerShot SD500, IXY DIGITAL 600, DIGITAL IXUS 700 &lt;/li&gt;    &lt;li&gt;PowerShot G1, PowerShot G2, PowerShot G3, PowerShot G5, PowerShot G6, &lt;/li&gt;    &lt;li&gt;PowerShot Pro90 IS, PowerShot S1 IS, PowerShot S2 IS, PowerShot Pro1 &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;PLEASE NOTE: &lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;Canon stopped development of their DLL library GetCanon! uses. &lt;/font&gt;&lt;/strong&gt;&lt;font color="#ff0000"&gt;&lt;strong&gt;That’s why there is no support for newer cameras Unfortunately there is nothing I can do about it. You might try your luck with &lt;/strong&gt;&lt;a href="http://get.live.com/photogallery/overview?wa=wsignin1.0" target="_blank"&gt;&lt;strong&gt;Windows Live Photo Gallery&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt; image downloader. It’s great, way better that GetCanon! I use it all the time.&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;It also doesn’t work on Windows Vista for the same reason. Some users reported that turning Windows XP compatibility on .exe file works.&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Note: &lt;/strong&gt;The EOS class of digital cameras is &lt;strong&gt;not supported&lt;/strong&gt;. You can use the version &lt;a href="http://vidmar.net/weblog/archive/2004/04/17/147.aspx"&gt;GetCanon 1.02&lt;/a&gt; with EOS class cameras.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Supported languages:&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;English &lt;/li&gt;    &lt;li&gt;Slovenian &lt;/li&gt;    &lt;li&gt;Danish &lt;/li&gt;    &lt;li&gt;German &lt;/li&gt;    &lt;li&gt;French &lt;/li&gt;    &lt;li&gt;Hungarian &lt;/li&gt;    &lt;li&gt;Italian &lt;/li&gt;    &lt;li&gt;Dutch &lt;/li&gt;    &lt;li&gt;Portuguese &lt;/li&gt;    &lt;li&gt;Czech &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Source code:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;If you would like to get the source code for this version, you have to sign up for Canon Developer program. &lt;/p&gt;  &lt;p&gt;Once you have got your hands on Canon SDK, &lt;a href="http://vidmar.net/weblog/contact.aspx"&gt;contact me&lt;/a&gt; and I'll send you the source.&lt;/p&gt;  &lt;p&gt;These are links where you can apply for Canon SDK, depending where you're from:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Europe: &lt;a href="https://www.didp.canon-europa.com/"&gt;https://www.didp.canon-europa.com/&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;US: &lt;a href="http://www.developersupport.canon.com/"&gt;http://www.developersupport.canon.com/&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;Asia: &lt;a href="http://www.canon-asia.com/index.jsp?fuseaction=dev_prog&amp;amp;prod_type=digital_imaging"&gt;http://www.canon-asia.com/index.jsp?fuseaction=dev_prog&amp;amp;prod_type=digital_imaging&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;&lt;img src="http://vidmar.net/weblog/aggbug/4622.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>David Vidmar</dc:creator>
            <guid>http://vidmar.net/weblog/archive/2008/07/17/getcanon-1.7.aspx</guid>
            <pubDate>Thu, 17 Jul 2008 19:28:42 GMT</pubDate>
            <wfw:comment>http://vidmar.net/weblog/comments/4622.aspx</wfw:comment>
            <comments>http://vidmar.net/weblog/archive/2008/07/17/getcanon-1.7.aspx#feedback</comments>
            <slash:comments>19</slash:comments>
            <wfw:commentRss>http://vidmar.net/weblog/comments/commentRss/4622.aspx</wfw:commentRss>
        </item>
        <item>
            <title>All Subversion 1.5 Windows binaries are available!</title>
            <link>http://vidmar.net/weblog/archive/2008/07/03/all-subversion-1.5-windows-binaries-are-available.aspx</link>
            <description>&lt;p&gt;Finally, all three releases for &lt;a href="http://vidmar.net/weblog/archive/2008/06/24/subversion-1.5-released.aspx" target="_blank"&gt;Subversion 1.5&lt;/a&gt; Microsoft Windows binaries are available.&lt;/p&gt; &lt;p&gt;&lt;a href="http://vidmar.net/weblog/images/vidmar_net/weblog/WindowsLiveWriter/AllSubversi.5Windowsbinariesareavailable_854F/image_4.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="68" alt="image" src="http://vidmar.net/weblog/images/vidmar_net/weblog/WindowsLiveWriter/AllSubversi.5Windowsbinariesareavailable_854F/image_thumb_1.png" width="364" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.collab.net/downloads/subversion/" target="_blank"&gt;CollabNet&lt;/a&gt; and &lt;a href="http://www.visualsvn.com/server" target="_blank"&gt;VisualSVN&lt;/a&gt; were available since before, today I finally spotted &lt;a href="http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91"&gt;Apache 2.0&lt;/a&gt; or &lt;a href="http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=8100"&gt;Apache 2.2&lt;/a&gt; &lt;a href="http://subversion.tigris.org/getting.html#windows" target="_blank"&gt;Tigris&lt;/a&gt; builds, so I can start upgrading servers!&lt;/p&gt;&lt;img src="http://vidmar.net/weblog/aggbug/4618.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>David Vidmar</dc:creator>
            <guid>http://vidmar.net/weblog/archive/2008/07/03/all-subversion-1.5-windows-binaries-are-available.aspx</guid>
            <pubDate>Thu, 03 Jul 2008 07:28:43 GMT</pubDate>
            <wfw:comment>http://vidmar.net/weblog/comments/4618.aspx</wfw:comment>
            <comments>http://vidmar.net/weblog/archive/2008/07/03/all-subversion-1.5-windows-binaries-are-available.aspx#feedback</comments>
            <wfw:commentRss>http://vidmar.net/weblog/comments/commentRss/4618.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Subversion 1.5 released</title>
            <link>http://vidmar.net/weblog/archive/2008/06/24/subversion-1.5-released.aspx</link>
            <description>&lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="32" alt="image" src="http://vidmar.net/weblog/images/vidmar_net/weblog/WindowsLiveWriter/76c2db86c822_78F6/image_3.png" width="236" align="right" border="0" /&gt;If news of last weeks was &lt;a href="http://www.mozilla.com/en-US/firefox/all.html" target="_blank"&gt;Firefox 3&lt;/a&gt;, this week, for devs anyway, is &lt;a href="http://subversion.tigris.org/svn_1.5_releasenotes.html#copy-move-improvements" target="_blank"&gt;Subversion 1.5&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Big new feature is &lt;a href="http://blogs.open.collab.net/svn/2007/05/the_subversion__1.html" target="_blank"&gt;Merge tracking&lt;/a&gt; which should significantly ease use of branching/merging. &lt;/p&gt;  &lt;p&gt;Upgrade should be easy. Upgrade your clients first, those will upgrade working copies automatically. The upgrade the server, which will run on v1.4 repository until you manually upgrade it. Some new features will not be available just using new server, you'll have to upgrade repositories too. This is not done automatically, so v1.4 clients can access it. Once you are read, simply run "svnadmin upgrade" and you are done.&lt;/p&gt;  &lt;p&gt;For more information I suggest you read through &lt;a href="http://subversion.tigris.org/svn_1.5_releasenotes.html#copy-move-improvements" target="_blank"&gt;Subversion 1.5 Release Notes&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;Right now, Windows binaries by &lt;a href="http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=8100" target="_blank"&gt;Tigris&lt;/a&gt; or &lt;a href="http://www.collab.net/downloads/subversion/" target="_blank"&gt;CollabNet&lt;/a&gt; are not available yet, will have to wait few more days. &lt;a href="http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=8100" target="_blank"&gt;VisualSVN server 1.5&lt;/a&gt; is available. I use Tigris binaries, so I'll wait few more days before upgrading both home and work servers.&lt;/p&gt;  &lt;p&gt;Also, all clients where upgraded. I use &lt;a href="http://tortoisesvn.tigris.org/tsvn_1.5_releasenotes.html" target="_blank"&gt;TortoiseSVN&lt;/a&gt; and &lt;a href="http://www.visualsvn.com/visualsvn/changes/" target="_blank"&gt;VisualSVN&lt;/a&gt; so don't forget to upgrade those too..&lt;/p&gt;&lt;img src="http://vidmar.net/weblog/aggbug/4615.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>David Vidmar</dc:creator>
            <guid>http://vidmar.net/weblog/archive/2008/06/24/subversion-1.5-released.aspx</guid>
            <pubDate>Tue, 24 Jun 2008 06:47:03 GMT</pubDate>
            <wfw:comment>http://vidmar.net/weblog/comments/4615.aspx</wfw:comment>
            <comments>http://vidmar.net/weblog/archive/2008/06/24/subversion-1.5-released.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://vidmar.net/weblog/comments/commentRss/4615.aspx</wfw:commentRss>
        </item>
        <item>
            <title>LINQ: Detecting if entity is already pending insert</title>
            <link>http://vidmar.net/weblog/archive/2008/06/17/linq-detecting-if-entity-is-already-pending-insert.aspx</link>
            <description>&lt;p&gt;I ran into an issue with my latest project at work that uses LINQ. I was &lt;a href="http://en.wikipedia.org/wiki/Upsert" target="_blank"&gt;upserting&lt;/a&gt; some entities and when I encountered a duplicate, I queried the database, but not the pending inserts of my DataContext, so my import failed with "duplicate primary key" type of error. &lt;/p&gt;  &lt;p&gt;It turns out it's fairly easy to query those pending inserts too.&lt;/p&gt;  &lt;p&gt;Lets have a DataContext and do an insert of a new Color entity:&lt;/p&gt;  &lt;div class="code"&gt;&lt;font color="#000000"&gt;DataContext&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#000000"&gt;dc&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#000000"&gt;DataContext()&lt;/font&gt;&lt;font color="#0000ff"&gt;;&lt;/font&gt; &lt;/div&gt;  &lt;div class="code"&gt;&lt;font color="#000000"&gt;dc.Colors.InsertOnSubmit(&lt;/font&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#000000"&gt;Color()&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#000000"&gt;{&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#000000"&gt;Code&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt; "F0F8FF"&lt;/font&gt;&lt;font color="#000000"&gt;,&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#000000"&gt;Name&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt; "AliceBlue" &lt;/font&gt;&lt;font color="#000000"&gt;})&lt;/font&gt;&lt;font color="#0000ff"&gt;;&lt;/font&gt; &lt;/div&gt;  &lt;div class="code"&gt; &lt;/div&gt;  &lt;div class="code"&gt;Since we didn't do &lt;strong&gt;dc.SubmitChanges()&lt;/strong&gt;, the following query returns nothing:&lt;/div&gt;  &lt;div class="code"&gt; &lt;/div&gt;  &lt;div class="code"&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#000000"&gt;r&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#0000ff"&gt;from&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#000000"&gt;c&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#0000ff"&gt;in&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#000000"&gt;dc.Colors&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#0000ff"&gt;where&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#000000"&gt;c.Code&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt; "F0F8FF" &lt;/font&gt;&lt;font color="#0000ff"&gt;select&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#000000"&gt;c&lt;/font&gt;&lt;font color="#0000ff"&gt;;&lt;/font&gt; &lt;/div&gt;  &lt;p&gt;Enter &lt;strong&gt;GetChangeSet()&lt;/strong&gt;. Let's count inserts:&lt;/p&gt;  &lt;div class="code"&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#000000"&gt;allPendingInserts&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#000000"&gt;dc.GetChangeSet().Inserts.Count()&lt;/font&gt;&lt;font color="#0000ff"&gt;;&lt;/font&gt; &lt;/div&gt;  &lt;div class="code"&gt; &lt;/div&gt;  &lt;div class="code"&gt;But we can have pending inserts of different types/tables. Let's just count pending colors:&lt;/div&gt;  &lt;div class="code"&gt; &lt;/div&gt;  &lt;div class="code"&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#000000"&gt;colorsPendingInserts&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#000000"&gt;dc.GetChangeSet().Inserts.OfType(Color).Count()&lt;/font&gt;&lt;font color="#0000ff"&gt;;&lt;/font&gt; &lt;/div&gt;  &lt;div class="code"&gt; &lt;/div&gt;  &lt;div class="code"&gt;And now we are not very far from querying inserted records:&lt;/div&gt;  &lt;div class="code"&gt; &lt;/div&gt;  &lt;div class="code"&gt;&lt;font color="#2b91af"&gt;IEnumerable&lt;/font&gt;&lt;font color="#000000"&gt;&amp;lt;Color&amp;gt;&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#000000"&gt;insertedColors&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#000000"&gt;dc.GetChangeSet().Inserts.OfType&amp;lt;Color&amp;gt;()&lt;/font&gt;&lt;font color="#0000ff"&gt;;&lt;/font&gt;&lt;font color="#808080"&gt;      &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#2b91af"&gt;Console&lt;/font&gt;&lt;font color="#000000"&gt;.WriteLine(&lt;/font&gt;&lt;font color="#808080"&gt;      &lt;br /&gt;    &lt;/font&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;font color="#000000"&gt;.Format(&lt;/font&gt;&lt;font color="#808080"&gt;      &lt;br /&gt;        "Q: Is color #F0F8FF already pending insert?\n" &lt;/font&gt;&lt;font color="#000000"&gt;+&lt;/font&gt;&lt;font color="#808080"&gt;      &lt;br /&gt;        "A: {0}"&lt;/font&gt;&lt;font color="#000000"&gt;,&lt;/font&gt;&lt;font color="#808080"&gt;      &lt;br /&gt;        &lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#0000ff"&gt;from&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#000000"&gt;q&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#0000ff"&gt;in&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#000000"&gt;insertedColors&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#0000ff"&gt;where&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#000000"&gt;q.Code&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#0000ff"&gt;==&lt;/font&gt;&lt;font color="#808080"&gt; "F0F8FF" &lt;/font&gt;&lt;font color="#0000ff"&gt;select&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#000000"&gt;q).Count&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#000000"&gt;&amp;gt;&lt;/font&gt;&lt;font color="#808080"&gt; &lt;/font&gt;&lt;font color="#800000"&gt;0&lt;/font&gt;&lt;font color="#000000"&gt;))&lt;/font&gt;&lt;font color="#0000ff"&gt;;&lt;/font&gt; &lt;/div&gt;  &lt;div class="code"&gt; &lt;/div&gt;  &lt;div class="code"&gt;Did I mention I really like LINQ? &lt;em&gt;(except when crossing WCF, of course)&lt;/em&gt;&lt;/div&gt;&lt;img src="http://vidmar.net/weblog/aggbug/4612.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>David Vidmar</dc:creator>
            <guid>http://vidmar.net/weblog/archive/2008/06/17/linq-detecting-if-entity-is-already-pending-insert.aspx</guid>
            <pubDate>Tue, 17 Jun 2008 10:32:09 GMT</pubDate>
            <wfw:comment>http://vidmar.net/weblog/comments/4612.aspx</wfw:comment>
            <comments>http://vidmar.net/weblog/archive/2008/06/17/linq-detecting-if-entity-is-already-pending-insert.aspx#feedback</comments>
            <wfw:commentRss>http://vidmar.net/weblog/comments/commentRss/4612.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>