<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Code Dotnet on Chris McKelt - Remembering Thoughts</title><link>https://blog.smarttechventures.au/tags/code-dotnet/</link><description>Recent content in Code Dotnet on Chris McKelt - Remembering Thoughts</description><generator>Hugo -- 0.147.2</generator><language>en</language><lastBuildDate>Tue, 03 Feb 2009 00:00:00 +0800</lastBuildDate><atom:link href="https://blog.smarttechventures.au/tags/code-dotnet/index.xml" rel="self" type="application/rss+xml"/><item><title>WCF Windsor Interceptor, AOP with Logging and Exception Handler Interceptor</title><link>https://blog.smarttechventures.au/articles/posts/wcf-windsor-interceptor-aop-with-logging-and-exception-handler-interceptor/</link><pubDate>Tue, 03 Feb 2009 00:00:00 +0800</pubDate><guid>https://blog.smarttechventures.au/articles/posts/wcf-windsor-interceptor-aop-with-logging-and-exception-handler-interceptor/</guid><description>&lt;p>The above example uses Windows Communication Foundation (WCF) Integration Facility&lt;/p>
&lt;p>The main idea here is that WCF should get the service instances from Windsor, which gives us all the usual advantages of &lt;a href="http://en.wikipedia.org/wiki/Inversion_of_control" title="http://en.wikipedia.org/wiki/Inversion_of_control" target="_blank">IoC&lt;/a> &lt;em>plus Windsor&amp;rsquo;s interceptors&lt;/em> capabilities. It isn&amp;rsquo;t a lot of code, but it makes it &lt;em>much&lt;/em> easier to work with WCF services.&lt;/p>
&lt;p>The service contains 2 simple methods on the HelloWorld class.&lt;/p>
&lt;blockquote>
&lt;ul>
&lt;li>SayHello &amp;ndash; returns a string &amp;ldquo;Hello World&amp;rdquo;&lt;/li>
&lt;li>ThrowException &amp;ndash; throws an exception&lt;/li>
&lt;/ul>&lt;/blockquote>
&lt;p>Every single call to each of these is intercepted and logged.  Whilst the throw exception will always be caught by the exceptionhandler interceptor.&lt;/p></description></item><item><title>Performance Testing using a counting semaphore -- Dijkstra</title><link>https://blog.smarttechventures.au/articles/posts/performance-testing-using-a-counting-semaphore-dijkstra/</link><pubDate>Wed, 21 Jan 2009 00:00:00 +0800</pubDate><guid>https://blog.smarttechventures.au/articles/posts/performance-testing-using-a-counting-semaphore-dijkstra/</guid><description>&lt;p>Running some performance tests using Fitnesse to test the limits of a new Sharepoint DMS solution produced this solution.&lt;/p>
&lt;p>The code we are trying to test is the AddDocument and the time it takes each call to this to succeed.&lt;/p>
&lt;p>So we need to add &lt;em>n&lt;/em> number of documents to Sharepoint using &lt;em>x&lt;/em> number of threads through a WCF service_,_ where &lt;em>n&lt;/em> and &lt;em>x&lt;/em> are configurable via the Fitnesse wiki&lt;/p></description></item><item><title>Winforms export datatable to excel without COM+</title><link>https://blog.smarttechventures.au/articles/posts/winforms-export-datatable-to-excel-without-com/</link><pubDate>Tue, 22 Jul 2008 00:00:00 +0800</pubDate><guid>https://blog.smarttechventures.au/articles/posts/winforms-export-datatable-to-excel-without-com/</guid><description>&lt;p>Simple export of a datatable to excel without using COM+&lt;/p>
&lt;p>Excel will ask if you want to open this as &amp;lsquo;An XML List&amp;rsquo;&lt;/p>
&lt;pre>&lt;code>SaveFileDialog fileDialog = new SaveFileDialog();
fileDialog.Filter = &amp;quot;Excel files (\*.xls)|\*.xls&amp;quot;;
fileDialog.FileName = &amp;quot;My\_File\_Name.xls&amp;quot;;
fileDialog.ShowDialog();
DataTable dt = GetFilteredDataTable();
using (FileStream fs = (FileStream)fileDialog.OpenFile())
using (StreamWriter sw = new StreamWriter(fs))
{
sw.Write(&amp;quot;&amp;lt;?xml version=\\&amp;quot;1.0\\&amp;quot; standalone=\\&amp;quot;yes\\&amp;quot;?&amp;gt;&amp;quot;);
dt.WriteXml(sw, XmlWriteMode.IgnoreSchema);
sw.Close();
fs.Close();
}
&lt;/code>&lt;/pre></description></item></channel></rss>