<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>Anthony Trudeau</title>
        <link>http://geekswithblogs.net/tonyt/Default.aspx</link>
        <description />
        <language>en-US</language>
        <copyright>Anthony Trudeau</copyright>
        <managingEditor>agrt.home@hotmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <image>
            <title>Anthony Trudeau</title>
            <url>http://geekswithblogs.net/images/RSS2Image.gif</url>
            <link>http://geekswithblogs.net/tonyt/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>Changing Printer Settings with PrintDocument</title>
            <category>Infragistics</category>
            <category>.NET</category>
            <link>http://geekswithblogs.net/tonyt/archive/2009/10/22/135659.aspx</link>
            <description>&lt;p&gt;The System.Drawing.Printing.PrintDocument class has the Print mode which will print your document directly to the printer.  The Infragistics NetAdvantage suite has a couple of subclasses of PrintDocument.  One of them is the Infragistics.Win.UltraWinGrid.UltraGridPrintDocument which is designed to print the contents of a specific data grid.  The problem I ran into with the PrintDocument is that it prints to the default printer.  There is no prompt for a different printer.  However, as it turns out getting those details is very simple.&lt;/p&gt;
&lt;p&gt;There are two ways to approach the problem.  You can have the user specify the settings and then use those settings for every call you make until the settings are specifically changed, or you can prompt when a print request is made.  I chose the latter, because it makes sense for my application and all you have to do is add a handler for the BeginPrint event of the PrintDocument.&lt;/p&gt;
&lt;div style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 11pt"&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;span style="COLOR: blue"&gt;private&lt;/span&gt; &lt;span style="COLOR: blue"&gt;void&lt;/span&gt; ultraGridPrintDocument1_BeginPrint(&lt;span style="COLOR: blue"&gt;object&lt;/span&gt; sender, System.Drawing.Printing.&lt;span style="COLOR: #2b91af"&gt;PrintEventArgs&lt;/span&gt; e)&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;{&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;    &lt;span style="COLOR: green"&gt;/* include this check otherwise the dialog will be&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;span style="COLOR: green"&gt;    * displayed when a print preview is shown */&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;    &lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (e.PrintAction == System.Drawing.Printing.&lt;span style="COLOR: #2b91af"&gt;PrintAction&lt;/span&gt;.PrintToPreview)&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        &lt;span style="COLOR: blue"&gt;return&lt;/span&gt;;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt; &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;    &lt;span style="COLOR: blue"&gt;using&lt;/span&gt; (&lt;span style="COLOR: #2b91af"&gt;PrintDialog&lt;/span&gt; dialog = &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;PrintDialog&lt;/span&gt;())&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;    {&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        &lt;span style="COLOR: green"&gt;/* record the current printer settings for the document;&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;span style="COLOR: green"&gt;        * otherwise, the default system settings are used */&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        dialog.PrinterSettings = ultraGridPrintDocument1.PrinterSettings;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt; &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        &lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (dialog.ShowDialog(&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;) == &lt;span style="COLOR: #2b91af"&gt;DialogResult&lt;/span&gt;.OK)&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;            ultraGridPrintDocument1.PrinterSettings = dialog.PrinterSettings;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        &lt;span style="COLOR: blue"&gt;else&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;            e.Cancel = &lt;span style="COLOR: blue"&gt;true&lt;/span&gt;;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;    }&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;}&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;The Infragistics NetAdvantage suite also has a preview dialog named Infragistics.Win.Printing.UltraPrintPreviewDialog.  This class is similar to the one provided by the Framework, but it uses Infragistics controls and has a matching look-and-feel.  The solution provided also works for using the print preview dialog.  The one thing of note is that the print preview dialog allows the printer settings to be changed, but it's not direct (File --&amp;gt; Page Setup, click Printer, change settings, click OK).  I ignore this possibility and display the dialog, because it's not something that will be an issue to my users.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=135659"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=135659" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/tonyt/aggbug/135659.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Anthony Trudeau</dc:creator>
            <guid>http://geekswithblogs.net/tonyt/archive/2009/10/22/135659.aspx</guid>
            <pubDate>Thu, 22 Oct 2009 19:27:09 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/tonyt/comments/135659.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/tonyt/archive/2009/10/22/135659.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/tonyt/comments/commentRss/135659.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/tonyt/services/trackbacks/135659.aspx</trackback:ping>
        </item>
        <item>
            <title>Infragistics NetAdvantage 2009 Volume 2</title>
            <category>Infragistics</category>
            <category>.NET</category>
            <link>http://geekswithblogs.net/tonyt/archive/2009/09/14/134810.aspx</link>
            <description>&lt;p&gt;Infragistics just released 2009 Volume 2 of their NetAdvantage Windows client controls which includes controls for Windows Forms and WPF.&lt;/p&gt;
&lt;p&gt;New Controls:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Timeline control&lt;/li&gt;
    &lt;li&gt;Tile Panel&lt;/li&gt;
    &lt;li&gt;WinControlContainerEditor&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/winformsnewfeatures.aspx#NewFeatures"&gt;Infragistics New Features&lt;/a&gt; page for more information.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=134810"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=134810" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/tonyt/aggbug/134810.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Anthony Trudeau</dc:creator>
            <guid>http://geekswithblogs.net/tonyt/archive/2009/09/14/134810.aspx</guid>
            <pubDate>Mon, 14 Sep 2009 19:06:34 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/tonyt/comments/134810.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/tonyt/archive/2009/09/14/134810.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/tonyt/comments/commentRss/134810.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/tonyt/services/trackbacks/134810.aspx</trackback:ping>
        </item>
        <item>
            <title>Infragistics Timeline Control</title>
            <category>Infragistics</category>
            <category>.NET</category>
            <link>http://geekswithblogs.net/tonyt/archive/2009/09/04/134496.aspx</link>
            <description>&lt;p&gt;The UltraTimeline control is one of the new controls being released with this month's NetAdvantage for Windows Client release.  The new UltraTimeline control is joined by a new layout metaphor called the UltraTilesPanel (&lt;a href="http://blogs.infragistics.com/blogs/andrew_flick/archive/2009/08/27/windows-forms-2009-2-unedited.aspx"&gt;see a video of both here&lt;/a&gt;).  However, the timeline control is what I'm most excited about.&lt;/p&gt;
&lt;p&gt;A timeline control displays a data series across a period of time for different subjects.  For example, in a scheduling scenario a subject is a person and the data series is the appointments for each subject.  The timeline has a large number of uses with scheduling and resource utilization being at the top of my concerns.&lt;/p&gt;
&lt;p&gt;The following image is a sneek peek of the UltraTimeline control.  You can also see it in use in the video linked above):&lt;/p&gt;
&lt;p&gt;&lt;img alt="UltraTimeline preview" src="http://geekswithblogs.net/images/geekswithblogs_net/tonyt/10571/r_image001.png" /&gt;&lt;/p&gt;
&lt;p&gt;I've been using Infragistics controls for years now.  Of all the suites I've used Infragistics has been my favorite.  Besides the product itself one thing I like is that I know what to expect about upgrades.  There is a consistent schedule and a consistent upgrade/support fee every year.  This makes the accountants happy.  And it makes me happy, because it's no hassle come upgrade time.  Infragistics continues to provide additional value every year.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=134496"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=134496" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/tonyt/aggbug/134496.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Anthony Trudeau</dc:creator>
            <guid>http://geekswithblogs.net/tonyt/archive/2009/09/04/134496.aspx</guid>
            <pubDate>Fri, 04 Sep 2009 19:12:50 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/tonyt/comments/134496.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/tonyt/archive/2009/09/04/134496.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/tonyt/comments/commentRss/134496.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/tonyt/services/trackbacks/134496.aspx</trackback:ping>
        </item>
        <item>
            <title>Microsoft Connect ID 404851 Resolved</title>
            <category>.NET</category>
            <link>http://geekswithblogs.net/tonyt/archive/2009/08/06/133948.aspx</link>
            <description>&lt;p&gt;I had the first bug that I reported resolved through Microsoft Connect today.  The bug was minor and related to automatic comments in the Task List.  The problem was that automatically generated tasks wouldn't get removed if you deleted a line of code that contained a token such as TODO or UNDONE.&lt;/p&gt;
&lt;p&gt;I know it's pretty small, but I was proud nonetheless.  The ID for the bug is &lt;a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=404851&amp;amp;wa=wsignin1.0"&gt;404851&lt;/a&gt;.  The fix will be part of Visual Studio 2010.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=133948"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=133948" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/tonyt/aggbug/133948.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Anthony Trudeau</dc:creator>
            <guid>http://geekswithblogs.net/tonyt/archive/2009/08/06/133948.aspx</guid>
            <pubDate>Thu, 06 Aug 2009 19:27:53 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/tonyt/comments/133948.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/tonyt/archive/2009/08/06/133948.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/tonyt/comments/commentRss/133948.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/tonyt/services/trackbacks/133948.aspx</trackback:ping>
        </item>
        <item>
            <title>FR11622: Serializable EventArgs for Infragistics Controls</title>
            <category>Infragistics</category>
            <category>.NET</category>
            <link>http://geekswithblogs.net/tonyt/archive/2009/07/22/133646.aspx</link>
            <description>&lt;p&gt;I ran into an issue on Friday night while using the Infragistics controls within the scope of the Composite UI Application Block (CAB).  My problem started when I tried to create a command with CAB from a UltraToolbarsManager tool using a function with a CommandHandler attribute that matched the signature of the event as shown below:&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Consolas;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red43\green145\blue175;\red163\green21\blue21;}??\fs22 Commands[\cf3 DebugCommandNames\cf0 .ClearOutput].AddInvoker(clearTool, \cf4 "ToolClick"\cf0 );}
--&gt;
&lt;div style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 11pt"&gt;
&lt;p style="MARGIN: 0px"&gt;   &lt;font color="#339966"&gt;// statement within the work item&lt;/font&gt;&lt;br /&gt;
   Commands["MyCommand"].AddInvoker(myTool, &lt;span style="COLOR: #a31515"&gt;"ToolClick"&lt;/span&gt;);&lt;/p&gt;
&lt;/div&gt;
&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Consolas;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red43\green145\blue175;\red0\green0\blue255;}??\fs22         [\cf3 CommandHandler\cf0 (\cf3 DebugCommandNames\cf0 .ClearOutput)]\par ??        \cf4 public\cf0  \cf4 void\cf0  ClearEntries(\cf4 object\cf0  sender, Infragistics.Win.UltraWinToolbars.\cf3 ToolClickEventArgs\cf0  e)\par ??        \{\par ??            View.ClearEntries();\par ??        \}}
--&gt;
&lt;div style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 11pt"&gt;
&lt;p style="MARGIN: 0px"&gt;   &lt;br /&gt;
&lt;br /&gt;
   [&lt;span style="COLOR: #2b91af"&gt;CommandHandler&lt;/span&gt;("MyCommand")]&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;void&lt;/span&gt; MyCommand(&lt;span style="COLOR: blue"&gt;object&lt;/span&gt; sender, &lt;span style="COLOR: #2b91af"&gt;ToolClickEventArgs&lt;/span&gt; e)&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;   {&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;      &lt;font color="#339966"&gt;// do something&lt;/font&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;   }&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;The application compiles fine; however, at run-time you get an ArgumentException as soon as the class with the CommandHandler is added to the WorkItem.  The message on the exception is "Error binding to target method."  Internally, the CAB fails at CommandStrategy.CreateCommandHandler method.&lt;/p&gt;
&lt;p&gt;After a little digging I determined that the EventArgs sub-classes such as ToolClickEventArgs are not serializable as is standard fare for EventArgs classes and that is apparently required by CAB.  Typically in the case of a toolbar button click it will not matter, because all you care is what button was pushed.  But, with the Infragistics UltraWinToolbars you can have different buttons such as a state button or a combo box button.  In those cases you likely will need access to the state of the tool.&lt;/p&gt;
&lt;p&gt;I opened up a support incident with Infragistics and this morning I was told that a feature request has been made.  The feature request is FR11622 if you run into this same problem and want them to change it.  At this point the request hasn't been committed to development, so please let them know if you need this too.&lt;/p&gt;
&lt;p&gt;You can work-around this problem by changing the ToolClickEventArgs to EventArgs in your CommandHandler attributed method, but then you have to figure out a different way to get at the button state.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=133646"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=133646" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/tonyt/aggbug/133646.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Anthony Trudeau</dc:creator>
            <guid>http://geekswithblogs.net/tonyt/archive/2009/07/22/133646.aspx</guid>
            <pubDate>Wed, 22 Jul 2009 14:50:43 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/tonyt/comments/133646.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/tonyt/archive/2009/07/22/133646.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/tonyt/comments/commentRss/133646.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/tonyt/services/trackbacks/133646.aspx</trackback:ping>
        </item>
        <item>
            <title>Custom formatting for control data binding</title>
            <category>.NET</category>
            <link>http://geekswithblogs.net/tonyt/archive/2009/07/13/133461.aspx</link>
            <description>&lt;p&gt;The databinding functionality for Windows Forms is pretty easy to use if not a little basic.  However, the bindings do allow you to assign an IFormatProvider which would mean to me that you could format the data in any way you want.  However, it appears that the formatting only applies for the purpose of globalization.&lt;/p&gt;
&lt;p&gt;Instead, if you want custom formatting (ICustomFormatter) for your data you'll need to handle the Format event of the binding.  You'll also have to handle the Parse event if your parseable data is not directly convertible to the underlying type and you want update functionality.  Simply put the Format event allows you to tweak the value before it's displayed and the Parse event allows you to untweak the displayed value back to a value that the underlying type understands.&lt;/p&gt;
&lt;p&gt;My example illustrates a simple binding using a formatter that pulls value from a resource file based on the default string representation of the object.  In my case the object is a TraceLevel enumeration where I want to display "Error", "Warning", "Information", and "Debug" instead of "Error", "Warning", "Info", and "Verbose".  I could have created a separate enumeration, but I still would have had the localization issue.&lt;/p&gt;
&lt;p&gt;The data binding code is pretty simple:&lt;/p&gt;
&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Consolas;}}{\colortbl;??\red43\green145\blue175;\red255\green255\blue255;\red0\green0\blue0;\red163\green21\blue21;\red0\green0\blue255;}??\fs22 \cf1 Binding\cf0  levelBinding = \par ??    levelTextEditor.DataBindings.Add(\cf4 "Value"\cf0 , LogEntry, \cf4 "MessageLevel"\cf0 , \cf5 true\cf0 , \cf1 DataSourceUpdateMode\cf0 .Never, \cf5 null\cf0 , \cf5 null\cf0 , \cf1 MessageLevelFormatter\cf0 .Instance);\par ??levelBinding.Format += (sender, e) =&amp;gt; e.Value = \cf1 MessageLevelFormatter\cf0 .Instance.Format(\cf5 null\cf0 , e.Value, \cf1 CultureInfo\cf0 .CurrentCulture);}
--&gt;
&lt;div style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 11pt"&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;span style="COLOR: #2b91af"&gt;Binding&lt;/span&gt; levelBinding = levelEditor.DataBindings.Add(&lt;span style="COLOR: #a31515"&gt;"Value"&lt;/span&gt;, LogEntry, &lt;span style="COLOR: #a31515"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;span style="COLOR: #a31515"&gt;        "MessageLevel"&lt;/span&gt;, &lt;span style="COLOR: blue"&gt;true&lt;/span&gt;, &lt;span style="COLOR: #2b91af"&gt;DataSourceUpdateMode&lt;/span&gt;.Never, &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;, &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;,&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        &lt;span style="COLOR: #2b91af"&gt;MessageLevelFormatter&lt;/span&gt;.Instance);&lt;br /&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;levelBinding.Format += (sender, e) =&amp;gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;   e.Value = &lt;span style="COLOR: #2b91af"&gt;MessageLevelFormatter&lt;/span&gt;.Instance.Format(&lt;span style="COLOR: blue"&gt;null&lt;/span&gt;, e.Value, &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;             &lt;span style="COLOR: #2b91af"&gt;CultureInfo&lt;/span&gt;.CurrentCulture);&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;The ICustomFormatter and IFormatProvider code is also simple:&lt;/p&gt;
&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Consolas;}}{\colortbl;??\red0\green0\blue255;\red255\green255\blue255;\red0\green0\blue0;\red43\green145\blue175;\red128\green128\blue128;\red0\green128\blue0;}??\fs22 \cf1 public\cf0  \cf1 class\cf0  \cf4 MessageLevelFormatter\cf0  : \cf4 IFormatProvider\cf0 , \cf4 ICustomFormatter\par ??\cf0 \{\par ??    \cf1 private\cf0  \cf1 static\cf0  \cf4 MessageLevelFormatter\cf0  instance = \cf1 new\cf0  \cf4 MessageLevelFormatter\cf0 ();\par ??\par ??    \cf5 ///\cf6  \cf5 &amp;lt;summary&amp;gt;\par ??\cf0     \cf5 ///\cf6  Creates a new instance of the class.\par ??\cf0     \cf5 ///\cf6  \cf5 &amp;lt;/summary&amp;gt;\par ??\cf0     \cf1 public\cf0  MessageLevelFormatter()\par ??    \{\par ??    \}\par ??\par ??    \cf5 ///\cf6  \cf5 &amp;lt;summary&amp;gt;\par ??\cf0     \cf5 ///\cf6  Gets the default instance of the class.\par ??\cf0     \cf5 ///\cf6  \cf5 &amp;lt;/summary&amp;gt;\par ??\cf0     \cf5 ///\cf6  \cf5 &amp;lt;value&amp;gt;\cf6 A \cf5 &amp;lt;see cref="MessageLevelFormatter"/&amp;gt;\cf6  object.\cf5 &amp;lt;/value&amp;gt;\par ??\cf0     \cf1 public\cf0  \cf1 static\cf0  \cf4 MessageLevelFormatter\cf0  Instance\par ??    \{\par ??        \cf1 get\par ??\cf0         \{\par ??            \cf1 return\cf0  instance;\par ??        \}\par ??    \}\par ??\par ??\cf1     #region\cf0  IFormatProvider Members\par ??    \cf5 ///\cf6  \cf5 &amp;lt;summary&amp;gt;\par ??\cf0     \cf5 ///\cf6  Returns an object that provides formatting services for the specified type. \par ??\cf0     \cf5 ///\cf6  \cf5 &amp;lt;/summary&amp;gt;\par ??\cf0     \cf5 ///\cf6  \cf5 &amp;lt;param name="formatType"&amp;gt;\cf6 An object that specifies the type of format object to return.\cf5 &amp;lt;/param&amp;gt;\par ??\cf0     \cf5 ///\cf6  \cf5 &amp;lt;returns&amp;gt;\cf6 An instance of the object specified by \cf5 &amp;lt;i&amp;gt;\cf6 formatType\cf5 &amp;lt;/i&amp;gt;\cf6 , if the implementation can supply that type of object;\par ??\cf0     \cf5 ///\cf6  otherwise, a null reference.\cf5 &amp;lt;/returns&amp;gt;\par ??\cf0     \cf1 public\cf0  \cf1 object\cf0  GetFormat(\cf4 Type\cf0  formatType)\par ??    \{\par ??        \cf1 return\cf0  (formatType == \cf1 typeof\cf0 (\cf4 ICustomFormatter\cf0 ) ? \cf1 this\cf0  : \cf1 null\cf0 );\par ??    \}\par ??\cf1     #endregion\par ??\par ??    #region\cf0  ICustomFormatter Members\par ??    \cf5 ///\cf6  \cf5 &amp;lt;summary&amp;gt;\par ??\cf0     \cf5 ///\cf6  Converts the value of a specified object to an equivalent string representation using specified format and culture-specific formatting information. \par ??\cf0     \cf5 ///\cf6  \cf5 &amp;lt;/summary&amp;gt;\par ??\cf0     \cf5 ///\cf6  \cf5 &amp;lt;param name="format"&amp;gt;\cf6 A format string containing formatting specifications.  Not used in this implementation.\cf5 &amp;lt;/param&amp;gt;\par ??\cf0     \cf5 ///\cf6  \cf5 &amp;lt;param name="arg"&amp;gt;\cf6 An object to format.\cf5 &amp;lt;/param&amp;gt;\par ??\cf0     \cf5 ///\cf6  \cf5 &amp;lt;param name="formatProvider"&amp;gt;\cf6 An object that supplies format information about the current instance. \cf5 &amp;lt;/param&amp;gt;\par ??\cf0     \cf5 ///\cf6  \cf5 &amp;lt;returns&amp;gt;\cf6 The string representation of the value of \cf5 &amp;lt;i&amp;gt;\cf6 arg\cf5 &amp;lt;/i&amp;gt;\cf6 , formatted as specified by \cf5 &amp;lt;i&amp;gt;\cf6 format\cf5 &amp;lt;/i&amp;gt;\cf6  and \cf5 &amp;lt;i&amp;gt;\cf6 formatProvider\cf5 &amp;lt;/i&amp;gt;\cf6 .\cf5 &amp;lt;/returns&amp;gt;\par ??\cf0     \cf1 public\cf0  \cf1 string\cf0  Format(\cf1 string\cf0  format, \cf1 object\cf0  arg, \cf4 IFormatProvider\cf0  formatProvider)\par ??    \{\par ??        \cf1 if\cf0  (arg == \cf1 null\cf0 )\par ??            \cf1 return\cf0  \cf1 null\cf0 ;\par ??\par ??        \cf1 return\cf0  \cf4 Resources\cf0 .ResourceManager.GetString(arg.ToString()) ?? arg.ToString();\par ??    \}\par ??\cf1     #endregion\par ??\cf0 \}}
--&gt;
&lt;div style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 11pt"&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; &lt;span style="COLOR: #2b91af"&gt;MessageLevelFormatter&lt;/span&gt; : &lt;span style="COLOR: #2b91af"&gt;IFormatProvider&lt;/span&gt;, &lt;span style="COLOR: #2b91af"&gt;ICustomFormatter&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;{&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;    &lt;span style="COLOR: blue"&gt;private&lt;/span&gt; &lt;span style="COLOR: blue"&gt;static&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;MessageLevelFormatter&lt;/span&gt; instance = &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;MessageLevelFormatter&lt;/span&gt;();&lt;/p&gt;
&lt;p style="MARGIN: 0px"&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;static&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;MessageLevelFormatter&lt;/span&gt; Instance&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;    {&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        {&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;            &lt;span style="COLOR: blue"&gt;return&lt;/span&gt; instance;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        }&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;    }&lt;/p&gt;
&lt;p style="MARGIN: 0px"&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;object&lt;/span&gt; GetFormat(&lt;span style="COLOR: #2b91af"&gt;Type&lt;/span&gt; formatType)&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;    {&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        &lt;span style="COLOR: blue"&gt;return&lt;/span&gt; (formatType == &lt;span style="COLOR: blue"&gt;typeof&lt;/span&gt;(&lt;span style="COLOR: #2b91af"&gt;ICustomFormatter&lt;/span&gt;) ? &lt;span style="COLOR: blue"&gt;this&lt;/span&gt; : &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;);&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;    }&lt;/p&gt;
&lt;p style="MARGIN: 0px"&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;string&lt;/span&gt; Format(&lt;span style="COLOR: blue"&gt;string&lt;/span&gt; format, &lt;span style="COLOR: blue"&gt;object&lt;/span&gt; arg, &lt;span style="COLOR: #2b91af"&gt;IFormatProvider&lt;/span&gt; formatProvider)&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;    {&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        &lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (arg == &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;)&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;            &lt;span style="COLOR: blue"&gt;return&lt;/span&gt; &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt; &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        &lt;span style="COLOR: blue"&gt;return&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Resources&lt;/span&gt;.ResourceManager.GetString(arg.ToString()) &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;            ?? arg.ToString();&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;    }&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;}&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=133461"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=133461" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/tonyt/aggbug/133461.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Anthony Trudeau</dc:creator>
            <guid>http://geekswithblogs.net/tonyt/archive/2009/07/13/133461.aspx</guid>
            <pubDate>Mon, 13 Jul 2009 16:41:31 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/tonyt/comments/133461.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/tonyt/archive/2009/07/13/133461.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/tonyt/comments/commentRss/133461.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/tonyt/services/trackbacks/133461.aspx</trackback:ping>
        </item>
        <item>
            <title>Unrecognized configuration section userSettings</title>
            <category>Infragistics</category>
            <category>.NET</category>
            <link>http://geekswithblogs.net/tonyt/archive/2009/07/06/133295.aspx</link>
            <description>&lt;p&gt;Tonight I ran into a problem running the start of a composite application that I was making work with the Infragistics support for the Composite UI application block.  The problem occurred with the simplist implementation of an empty shell form.  The exception was a configuration exception that said, "Configuration system failed to initialize" and it had an inner exception with the message, "Unrecognized &lt;font face=""&gt;configuration section userSettings..."&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;I let Visual Studio create a Settings class and add the configuration information to the App.Config (before this point I didn't have one), but the same problem occurred.  Investigating the exception further I dug down into where it was pulling the configuration information.  It was grabbing settings from within the user application data folder.  In there was a configuration file that contained a toolbars layout file from a prototype that had a ToolbarsManager instance.&lt;/p&gt;
&lt;p&gt;I deleted the file and rebuilt the project and it ran fine.  Hopefully, this will help someone else out that gets a similar exception.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=133295"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=133295" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/tonyt/aggbug/133295.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Anthony Trudeau</dc:creator>
            <guid>http://geekswithblogs.net/tonyt/archive/2009/07/06/133295.aspx</guid>
            <pubDate>Mon, 06 Jul 2009 22:16:26 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/tonyt/comments/133295.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/tonyt/archive/2009/07/06/133295.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/tonyt/comments/commentRss/133295.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/tonyt/services/trackbacks/133295.aspx</trackback:ping>
        </item>
        <item>
            <title>Enterprise Library</title>
            <category>.NET</category>
            <link>http://geekswithblogs.net/tonyt/archive/2009/06/26/133079.aspx</link>
            <description>&lt;p&gt;The other day Lindsay Rutter with Microsoft did a &lt;a href="http://blogs.msdn.com/lindsay/archive/2009/06/25/msdn-webcast-enterprise-library-4-1.aspx#comments"&gt;webcast on the Enterprise Library&lt;/a&gt;.  I've used the exception handling block in a few projects, but my opinion had been that the library was bloated and was low on my priority list of technologies to investigate.&lt;/p&gt;
&lt;p&gt;The talk on dependency injection in the webcast changed my mind.  I immediately got a return on my investment as I wanted a more flexible method for tracing then what is offered from the Trace class in the System.Diagnostics namespace.  And most importantly I didn't want any unnecessary dependencies in my library.  Basically, my library wants the ability to log, but doesn't want any responsibility for it.  Here's what I did:&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;Added a reference to the Microsoft.Practices.Unity library.  You'll need the Microsoft.Practices.ObjectBuilder2 library referenced wherever you create the unity container and inject the dependency.  My library doesn't care about that.  All it cares about is that whatever creates the key objects creates the dependencies.&lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;Define the interface for classes to perform the work.  I created the ILoggingHandler with methods such as LogError, LogWarning, and LogInformation.&lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;Add a using statement for Microsoft.Practices.Unity to the code files containing your classes that you will be injecting.&lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;Add the following code to the classes that I want to log.  There are undoubtedly other ways to approach this, but this is the most simple.  At first I didn't think it was very elegant to add a property to my class, but these are base classes providing a service to subclasses, so I warmed up to the idea.&lt;br /&gt;
    &lt;br /&gt;
    &lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Consolas;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red43\green145\blue175;\red0\green0\blue255;}??\fs22         [\cf3 Dependency\cf0 ]\par ??        \cf4 public\cf0  \cf3 ILoggingHandler\cf0  LogHandler \{ \cf4 get\cf0 ; \cf4 set\cf0 ; \}}
--&gt;
    &lt;div style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 11pt"&gt;
    &lt;p style="MARGIN: 0px"&gt;[&lt;span style="COLOR: #2b91af"&gt;Dependency&lt;/span&gt;]&lt;/p&gt;
    &lt;p style="MARGIN: 0px"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;ILoggingHandler&lt;/span&gt; LogHandler { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; }&lt;/p&gt;
    &lt;/div&gt;
    &lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt; Use the property within your code where necessary as in the following code.&lt;br /&gt;
    &lt;br /&gt;
    &lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Consolas;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red163\green21\blue21;}??\fs22 LogHandler.LogInformation(\cf3 "Enter trace information here"\cf0 );}
--&gt;
    &lt;div style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 11pt"&gt;
    &lt;p style="MARGIN: 0px"&gt;LogHandler.LogInformation(&lt;span style="COLOR: #a31515"&gt;"Enter trace information here"&lt;/span&gt;);&lt;/p&gt;
    &lt;/div&gt;
    &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt; It's perfect for what I needed and is extremely simple to implement.  When it comes to creating the logging service class I can create it and inject it from the code that hosts these classes using the following code (where DefaultLoggingHandler is my implementation of ILoggingHandler).&lt;br /&gt;
&lt;/p&gt;
&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Consolas;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue255;}??\fs22 container.RegisterType&amp;lt;ILogHandler, ConcreteLogger&amp;gt;(\cf3 new\cf0  ContainerControlledLifetimeManager());\par ??                Application.Run(container.Resolve&amp;lt;Form1&amp;gt;());}
--&gt;
&lt;div style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 11pt"&gt;
&lt;div style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 11pt"&gt;
&lt;p style="MARGIN: 0px"&gt;IUnityContainer container = &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; UnityContainer();&lt;/p&gt;
&lt;/div&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;!--EndFragment--&gt;container.RegisterType&amp;lt;ILoggingHandler, DefaultLoggingHandler&amp;gt;(&lt;span style="COLOR: blue"&gt;new&lt;/span&gt; ContainerControlledLifetimeManager());&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;MySubClass obj = container.Resolve&amp;lt;MySubClass&amp;gt;();&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;br /&gt;
The optional parameter I specified in the call to RegisterType allows the object to be created as a Singleton.  That means that every MySubClass object I create will use the same DefaultLoggingHandler.&lt;/p&gt;
&lt;p&gt;I suggest that anyone who has discounted the Enterprise Library in the past take another look.  I first used the Enterprise Library in one of it's first interations.  It's grown and matured and can make some common, time consuming development activities go away.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=133079"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=133079" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/tonyt/aggbug/133079.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Anthony Trudeau</dc:creator>
            <guid>http://geekswithblogs.net/tonyt/archive/2009/06/26/133079.aspx</guid>
            <pubDate>Fri, 26 Jun 2009 17:49:47 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/tonyt/comments/133079.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/tonyt/archive/2009/06/26/133079.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/tonyt/comments/commentRss/133079.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/tonyt/services/trackbacks/133079.aspx</trackback:ping>
        </item>
    </channel>
</rss>