<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>

<channel>
	<title>DotNetReflections</title>
	<atom:link href="http://blogs.tallan.com/dotnetreflections/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.tallan.com/dotnetreflections</link>
	<description>Tallan's .NET Blog Site</description>
	<pubDate>Thu, 31 Dec 2009 20:18:41 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Transform System.Drawing.ContentAlignment property to System.Drawing. StringFormat Alignment property</title>
		<link>http://blogs.tallan.com/dotnetreflections/2009/12/31/transform-systemdrawingcontentalignment-property-to-systemdrawing-stringformat-alignment-property/</link>
		<comments>http://blogs.tallan.com/dotnetreflections/2009/12/31/transform-systemdrawingcontentalignment-property-to-systemdrawing-stringformat-alignment-property/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 20:10:19 +0000</pubDate>
		<dc:creator>cvallee</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blogs.tallan.com/dotnetreflections/2009/12/31/transform-systemdrawingcontentalignment-property-to-systemdrawing-stringformat-alignment-property/</guid>
		<description><![CDATA[
Recently we had the need to transform System.Drawing.ContentAlignment property to System.Drawing. Stringformat alignment property for creating a Graphic object with text drawn on it inside a given rectangle.  Assuming that you want the text printed from left to right, you can use the ContentAlignment Enum values to obtain the desired StringAlignment Enum value.  For example:


 [...]]]></description>
			<content:encoded><![CDATA[<div id="codeSnippetWrapper">
<div id="codeSnippet" class="csharpcode">Recently we had the need to transform System.Drawing.ContentAlignment property to System.Drawing. Stringformat alignment property for creating a Graphic object with text drawn on it inside a given rectangle.  Assuming that you want the text printed from left to right, you can use the ContentAlignment Enum values to obtain the desired StringAlignment Enum value.  For example:</div>
<div id="codeSnippetWrapper">
<div id="codeSnippet" class="csharpcode">
<pre><span class="lnum">   1:</span> <span class="kwrd">public</span> StringFormat TransformProperty(ContentAlignment alignment)
<!--CRLF-->
<span class="lnum">   2:</span>         {
<!--CRLF-->
<span class="lnum">   3:</span>             StringFormat myStringFromat  = <span class="kwrd">new</span> StringFormat();
<!--CRLF-->
<span class="lnum">   4:</span>             <span class="kwrd">switch</span>(alignment)
<!--CRLF-->
<span class="lnum">   5:</span>             {
<!--CRLF-->
<span class="lnum">   6:</span>                 <span class="kwrd">case</span> ContentAlignment.MiddleLeft:
<!--CRLF-->
<span class="lnum">   7:</span>                     myStringFromat.Alignment = StringAlignment.Near;
<!--CRLF-->
<span class="lnum">   8:</span>                     <span class="kwrd">break</span>;
<!--CRLF-->
<span class="lnum">   9:</span>                 <span class="kwrd">case</span> ContentAlignment.MiddleRight:
<!--CRLF-->
<span class="lnum">  10:</span>                     myStringFromat.Alignment = StringAlignment.Far;
<!--CRLF-->
<span class="lnum">  11:</span>                     <span class="kwrd">break</span>;
<!--CRLF-->
<span class="lnum">  12:</span>                 <span class="kwrd">default</span>:
<!--CRLF-->
<span class="lnum">  13:</span>                     myStringFromat.Alignment = StringAlignment.Center;
<!--CRLF-->
<span class="lnum">  14:</span>                     <span class="kwrd">break</span>;
<!--CRLF-->
<span class="lnum">  15:</span>             }
<!--CRLF-->
<span class="lnum">  16:</span>             <span class="kwrd">return</span> myStringFromat;
<!--CRLF-->
<span class="lnum">  17:</span>         }
</pre>
<p>Craig<br />
<!--CRLF--></div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blogs.tallan.com/dotnetreflections/2009/12/31/transform-systemdrawingcontentalignment-property-to-systemdrawing-stringformat-alignment-property/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Adding SQLite to a Windows Mobile Application</title>
		<link>http://blogs.tallan.com/dotnetreflections/2009/12/31/adding-sqlite-to-a-windows-mobile-application/</link>
		<comments>http://blogs.tallan.com/dotnetreflections/2009/12/31/adding-sqlite-to-a-windows-mobile-application/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 19:10:56 +0000</pubDate>
		<dc:creator>cvallee</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blogs.tallan.com/dotnetreflections/2009/12/31/adding-sqlite-to-a-windows-mobile-application/</guid>
		<description><![CDATA[Using SQLite in a Windows Mobile Application provides a simple way to add pre-populated data for consumption by the application.&#160; There are a couple of configuration considerations when adding the database to the project.
1. Adding reference to SQLite.dll. After installing SQLite there will be a Compact Framework folder in the following path :C:\ProgramFiles\SQLite.NET\bin.&#160; This folder [...]]]></description>
			<content:encoded><![CDATA[<p>Using SQLite in a Windows Mobile Application provides a simple way to add pre-populated data for consumption by the application.&#160; There are a couple of configuration considerations when adding the database to the project.</p>
<p>1. Adding reference to SQLite.dll. After installing SQLite there will be a Compact Framework folder in the following path :C:\ProgramFiles\SQLite.NET\bin.&#160; This folder contains the System.Data.SQLite.dll that needs to be referenced.</p>
<p>2 The same path will also contain the dll which Windows Mobile will need to invoke the methods contained in the SQLite.dll.&#160; The following file needs to be added to the project which contains the main executable,&#160; SQLite.Interop.065.DLL.</p>
<p>Once the interop dll is in the project you can start using SQLite in the Mobile Application just as you would for any other application.</p>
<p>Craig</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.tallan.com/dotnetreflections/2009/12/31/adding-sqlite-to-a-windows-mobile-application/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Could not load file or assembly &#8216;AjaxControlToolkit&#8217; or one of its dependencies. Access is denied.</title>
		<link>http://blogs.tallan.com/dotnetreflections/2009/09/01/could-not-load-file-or-assembly-ajaxcontroltoolkit-or-one-of-its-dependencies-access-is-denied/</link>
		<comments>http://blogs.tallan.com/dotnetreflections/2009/09/01/could-not-load-file-or-assembly-ajaxcontroltoolkit-or-one-of-its-dependencies-access-is-denied/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 23:28:10 +0000</pubDate>
		<dc:creator>kadasani</dc:creator>
		
		<category><![CDATA[.NET Framework]]></category>

		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blogs.tallan.com/dotnetreflections/?p=185</guid>
		<description><![CDATA[Problem: Recently i came across this problem while switching to a new Windows 7 64 bit m/c. The web site at hand was working fine on my previous m/c Windows 7 64 bit RC1. The error and the event log were basically not very helpful either.
Resolution:
So here is what I did to fix the issue [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem: </strong>Recently i came across this problem while switching to a new Windows 7 64 bit m/c. The web site at hand was working fine on my previous m/c Windows 7 64 bit RC1. The error and the event log were basically not very helpful either.</p>
<p><strong>Resolution:</strong></p>
<p>So here is what I did to fix the issue (to get it to work using IIS):</p>
<p>1. Make sure that the dll in question is either set to &#8220;Copy to: Local). Go to References, right click on AjaxControlToolkit and select properties. In my case it was already set to Copy Local. So that was not the issue</p>
<p>2. Open IIS Manager, browse to the AppPool (in my case it was the DefaultAppPool&#8230; it is just a Dev box, ok!). Go to Advanced Settings, and set Enable 32-bit Applications to true. Now that did fix the problem I was having.</p>
<p>For Cassini:</p>
<p>1. I had to give modify rights on the asp.net temp folder  to the Apppool identity (in my case IIS users group).</p>
<p><strong>Discussion</strong></p>
<ul>
<li>On further research (i.e. &#8220;google&#8221;), I came to the conclusion that it was a permissions error related to the Temporary ASP.NET Files folder (C:\Windows\Microsoft.NET\Framework64\v2.0.50727). Some of the other fixes for this problem can be found on other blogs. They relate to the access permissions on the ASP.NET folder, Trust level Settings on the Website, and Anti-virus settings. Here is a link to some of them:</li>
<li>What I found was that the main focus while resolving this error should be on the later part of the error that says &#8216;Access is denied&#8217; or &#8220;Invalid Argument&#8217; etc.. that will help you in attacking the issue. In my case it was the fact that I was running a 32 bit app on a 64 bit mc and a permissions issue as well on the Temporary ASP.NET folder.</li>
<li>If you get an &#8216;Access Denied&#8217;..try checking the permissions on the Temp ASP.NET folder.</li>
<li>If you get &#8216;Invalid Argument&#8217; try cleaning the temp asp.net folder and restarting the web site.</li>
</ul>
<p><a href="http://lichao.net/eblog/fix-access-is-denied-exception-from-hresult-0x80070005-e_accessdenied-on-local-machines-200905307.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/lichao.net');">http://lichao.net/eblog/fix-access-is-denied-exception-from-hresult-0&#215;80070005-e_accessdenied-on-local-machines-200905307.html</a></p>
<p><a href="http://weblogs.asp.net/joshuajohnson/archive/2008/12/22/could-not-load-file-or-assembly-ajaxcontroltoolkit-or-one-of-its-dependencies-the-parameter-is-incorrect-exception-from-hresult-0-215-80070057-e-invalidarg.aspx" onclick="javascript:pageTracker._trackPageview('/outbound/article/weblogs.asp.net');">http://weblogs.asp.net/joshuajohnson/archive/2008/12/22/could-not-load-file-or-assembly-ajaxcontroltoolkit-or-one-of-its-dependencies-the-parameter-is-incorrect-exception-from-hresult-0-215-80070057-e-invalidarg.aspx</a></p>
<p><a href="http://msforums.ph/forums/t/46678.aspx" onclick="javascript:pageTracker._trackPageview('/outbound/article/msforums.ph');">http://msforums.ph/forums/t/46678.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.tallan.com/dotnetreflections/2009/09/01/could-not-load-file-or-assembly-ajaxcontroltoolkit-or-one-of-its-dependencies-access-is-denied/feed/</wfw:commentRss>
		</item>
		<item>
		<title>WCF Exception Shielding Error</title>
		<link>http://blogs.tallan.com/dotnetreflections/2009/07/01/wcf-exception-shielding-error/</link>
		<comments>http://blogs.tallan.com/dotnetreflections/2009/07/01/wcf-exception-shielding-error/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 15:47:14 +0000</pubDate>
		<dc:creator>cvallee</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blogs.tallan.com/dotnetreflections/2009/07/01/wcf-exception-shielding-error/</guid>
		<description><![CDATA[While using the WCF Exception Shielding policy in Enterprise Library’s Exception Handler Block to shield exceptions and return Fault Contracts I came across an error. I named the shielding policy “WCF Shielding Policy” and implemented a FaultContract for each type of desired or expected exception.
While testing the policy, we were unable to return a proper [...]]]></description>
			<content:encoded><![CDATA[<p>While using the WCF Exception Shielding policy in Enterprise Library’s Exception Handler Block to shield exceptions and return Fault Contracts I came across an error. I named the shielding policy “WCF Shielding Policy” and implemented a FaultContract for each type of desired or expected exception.</p>
<p>While testing the policy, we were unable to return a proper FaultContract from the WCF Service.  The only error that we received was the generic Communication Error:</p>
<pre>System.ServiceModel.CommunicationException: An error occurred while receiving the HTTP response to (path of service).
 This could be due to the service endpoint binding not using the HTTP protocol.
This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down).
See server logs for more details. ---&gt;  System.Net.WebException: The underlying connection was closed:
An unexpected error occurred on a receive.
  System.IO.IOException: Unable to read data from the transport connection: An existing connection was
forcibly closed by the remote host.
 System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host.</pre>
<p>This error is incredibly deceiving and led to many dead ends while trying to track down the root cause of the error. I re-wrote the app.config file and removed and re-added the service references, all to no avail.</p>
<p>The cause of the problem was simply in the name of the policy. If you don’t name your shielding policy “WCF Exception Shielding” verbatim then the policy will not be found and the error above will be thrown.  If you do name your policy something different or you implement different policies for different types of exceptions then you have to explicitly state in the ExceptionShielding attribute the name of the policy as follows:</p>
<pre>C#:[ExceptionShielding("MyPolicy")]
VB: &lt;ExceptionShielding ("MyPolicy")&gt;</pre>
<p>I renamed the policy to the default name and started receiving the Fault Contracts as expected.</p>
<p>Hope this helps eliminate some headaches for someone.</p>
<p>-Craig</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.tallan.com/dotnetreflections/2009/07/01/wcf-exception-shielding-error/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Write iPhone Applications in C# using MonoTouch</title>
		<link>http://blogs.tallan.com/dotnetreflections/2009/06/30/write-iphone-applications-in-c-using-monotouch/</link>
		<comments>http://blogs.tallan.com/dotnetreflections/2009/06/30/write-iphone-applications-in-c-using-monotouch/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 13:24:09 +0000</pubDate>
		<dc:creator>mgerety</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blogs.tallan.com/dotnetreflections/2009/06/30/write-iphone-applications-in-c-using-monotouch/</guid>
		<description><![CDATA[The mono project has released a new Mono edition for Apple’s iPhone and iPod Touch.&#160; This allows you to write full featured applications for the iPod touch using C#.&#160; 
This is not a JIT Compiler, but is a static compiler that turns .NET executables into native applications.&#160; 
For more information, check out the project at [...]]]></description>
			<content:encoded><![CDATA[<p>The mono project has released a new Mono edition for Apple’s iPhone and iPod Touch.&#160; This allows you to write full featured applications for the iPod touch using C#.&#160; </p>
<p>This is not a JIT Compiler, but is a static compiler that turns .NET executables into native applications.&#160; </p>
<p>For more information, check out the project at : <a title="http://www.mono-project.com/MonoTouch" href="http://www.mono-project.com/MonoTouch" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.mono-project.com');">http://www.mono-project.com/MonoTouch</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.tallan.com/dotnetreflections/2009/06/30/write-iphone-applications-in-c-using-monotouch/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Spring and Functional Tests</title>
		<link>http://blogs.tallan.com/dotnetreflections/2009/06/22/spring-and-functional-tests/</link>
		<comments>http://blogs.tallan.com/dotnetreflections/2009/06/22/spring-and-functional-tests/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 21:44:54 +0000</pubDate>
		<dc:creator>cvallee</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blogs.tallan.com/dotnetreflections/2009/06/22/spring-and-functional-tests/</guid>
		<description><![CDATA[Recently on our project we created a “functional” unit test for some services. The test was designed to check the entire call stack from the service layer to the DAO and return some expected results. We are using Spring for dependency injection through our entire application. This functional test initially only referenced the service DLL’s [...]]]></description>
			<content:encoded><![CDATA[<p>Recently on our project we created a “functional” unit test for some services. The test was designed to check the entire call stack from the service layer to the DAO and return some expected results. We are using Spring for dependency injection through our entire application. This functional test initially only referenced the service DLL’s as this is all we thought that had to be referenced.&#160; Upon execution, the test was failing due to “null or empty Context”. We knew that we had referenced the context in the configuration file correctly, but were perplexed at how the spring context were not loading.</p>
<p>We finally realized that it was an issue with Resharper and how the tests were executed differently then when run is Visual Studio using default run (ctrl + r, t)</p>
<p>Once this was solved, we were getting reference exceptions.</p>
<p>To solve this error, it is necessary to reference in your test project all of the DLL’s that are referenced in your Spring xml file. It will not work unless you do so.</p>
<p>-Craig </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.tallan.com/dotnetreflections/2009/06/22/spring-and-functional-tests/feed/</wfw:commentRss>
		</item>
		<item>
		<title>RESTFul Services in Silverlight - CT Code Camp June 2009</title>
		<link>http://blogs.tallan.com/dotnetreflections/2009/06/19/restful-services-in-silverlight-ct-code-camp-june-2009/</link>
		<comments>http://blogs.tallan.com/dotnetreflections/2009/06/19/restful-services-in-silverlight-ct-code-camp-june-2009/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 13:12:01 +0000</pubDate>
		<dc:creator>kadasani</dc:creator>
		
		<category><![CDATA[.NET Framework]]></category>

		<category><![CDATA[Presentations]]></category>

		<category><![CDATA[User Groups]]></category>

		<category><![CDATA[WCF]]></category>

		<category><![CDATA[CodeCamp]]></category>

		<category><![CDATA[RESTFul]]></category>

		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://blogs.tallan.com/dotnetreflections/?p=168</guid>
		<description><![CDATA[Downloade the Presentation and Code 
The Connecticut User Group organized a full day code camp event in Bloomfield, CT. The topic I presented on was &#8220;RESTFul Services and Silverlight&#8221;. The presentation was organized around the following main topics:

Web Services via SOAP
RESTFul Services
Creating a WCF RESTFul Service
Consuming a Custom WCF RESTFul Service in Silverlight

The attached slide deck will [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Downloade the</strong> <a href="http://click.officeliveemail.com/?ju=fe5b1c717063027c7316&amp;ls=fde81678716d027b721d7277&amp;m=fef012797d6206&amp;l=fec51c7677610478&amp;s=fe24127770620378771475&amp;jb=ff6316717c&amp;t=" onclick="javascript:pageTracker._trackPageview('/outbound/article/click.officeliveemail.com');">Presentation and Code</a> </p>
<p>The Connecticut User Group organized a full day code camp event in Bloomfield, CT. The topic I presented on was &#8220;RESTFul Services and Silverlight&#8221;. The presentation was organized around the following main topics:</p>
<ul>
<li>Web Services via SOAP</li>
<li>RESTFul Services</li>
<li>Creating a WCF RESTFul Service</li>
<li>Consuming a Custom WCF RESTFul Service in Silverlight</li>
</ul>
<p>The attached slide deck will provide you with highlights on each topic. The code samples revolve around the AdventureWorks Database. I have partitioned the code into Data Access, Service Layer and a UI Layer.</p>
<ul>
<li>Database: AdventureWorksDB from code plex. You can download it from here: <a href="http://www.codeplex.com/MSFTDBProdSamples" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.codeplex.com');">http://www.codeplex.com/MSFTDBProdSamples</a></li>
<li>Data Access: Used Nettiers and Codesmith to Generate the CRUD methods to access Adventure Works.</li>
<li>Service Layer: WCF, ASMX and WCF REST service examples. I have also included a sample service from John Papa&#8217;s Data Services with Silverlight book. I would recommend this book for who ever is working with Siverlight</li>
<li>UI Layer: Consists of a ASP.NET web site that houses the silverlight controls and the silverlight controls themselves. The services are conusmed by silverlight.</li>
</ul>
<p>During the actual presentation, i also created a simple WCF Service and demo&#8217;ed how to use a simple SOAP WCF service in a silverlight client using the Asynchronous pattern.</p>
<p>Check the samples out!</p>
<p>Happy coding</p>
<p>Reddy (<a href="mailto:reddy.kadasani@tallan.com">reddy.kadasani@tallan.com</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.tallan.com/dotnetreflections/2009/06/19/restful-services-in-silverlight-ct-code-camp-june-2009/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Content from LINQ Code Camp Presentation (6/13/09)</title>
		<link>http://blogs.tallan.com/dotnetreflections/2009/06/18/content-from-linq-code-camp-presentation-61309/</link>
		<comments>http://blogs.tallan.com/dotnetreflections/2009/06/18/content-from-linq-code-camp-presentation-61309/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 15:28:07 +0000</pubDate>
		<dc:creator>mgerety</dc:creator>
		
		<category><![CDATA[.NET Framework]]></category>

		<category><![CDATA[Presentations]]></category>

		<category><![CDATA[Code Camp]]></category>

		<category><![CDATA[CTDOTNET]]></category>

		<category><![CDATA[Hartford]]></category>

		<category><![CDATA[User Groups]]></category>

		<guid isPermaLink="false">http://blogs.tallan.com/dotnetreflections/2009/06/18/content-from-linq-code-camp-presentation-61309/</guid>
		<description><![CDATA[On June 13, 2009 I was privileged to give a presentation at the Hartford Code Camp at New Foundations in Bloomfield, CT.   The event was a great success, with 29 presenters,  35 sessions, and more than 150 people in attendance.  I’d like to say thank you to anyone who was able to attend my session [...]]]></description>
			<content:encoded><![CDATA[<p>On June 13, 2009 I was privileged to give a presentation at the Hartford Code Camp at New Foundations in Bloomfield, CT.   The event was a great success, with 29 presenters,  35 sessions, and more than 150 people in attendance.  I’d like to say thank you to anyone who was able to attend my session on LINQ, my group was great and had a lot of insightful and pointed questions.</p>
<p>As promised, I’m posting the content from the presentation including the PowerPoint files and Demo Code.</p>
<p>If anyone has any questions about the content, please feel free to e-mail me at <a href="mailto:mgerety@tallan.com">mgerety@tallan.com</a></p>
<p><strong>Presentation and Content Files: <a title="LINQ Presentation and Files" href="http://www.gerety.net/LINQCodeCamp/linq.zip" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.gerety.net');" target="_blank">LINQ Presentation And Files</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.tallan.com/dotnetreflections/2009/06/18/content-from-linq-code-camp-presentation-61309/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Convert Multi-page image to Collection of Bitmaps</title>
		<link>http://blogs.tallan.com/dotnetreflections/2009/06/13/convert-multi-page-image-to-collection-of-bitmaps/</link>
		<comments>http://blogs.tallan.com/dotnetreflections/2009/06/13/convert-multi-page-image-to-collection-of-bitmaps/#comments</comments>
		<pubDate>Sat, 13 Jun 2009 13:05:39 +0000</pubDate>
		<dc:creator>cvallee</dc:creator>
		
		<category><![CDATA[.NET Framework]]></category>

		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blogs.tallan.com/dotnetreflections/2009/06/13/convert-multi-page-image-to-collection-of-bitmaps/</guid>
		<description><![CDATA[Recently on a project, we had the need to convert a saved multi-page tiff to a collection of bitmaps for viewing in a UI using standard GDI+ methods. These bitmaps also needed to be printed in a high quality way for submission to a government agency.&#160; This method ensures that no quality will be lost [...]]]></description>
			<content:encoded><![CDATA[<p>Recently on a project, we had the need to convert a saved multi-page tiff to a collection of bitmaps for viewing in a UI using standard GDI+ methods. These bitmaps also needed to be printed in a high quality way for submission to a government agency.&#160; This method ensures that no quality will be lost from the creation of the new bitmap objects.</p>
<pre><span class="rem">/////////////////////////////////////////</span>
<span class="rem">// by Craig Vallee</span>
<span class="rem">// Consultant</span>
<span class="rem">// Tallan, Inc.</span>
<span class="rem">/////////////////////////////////////////</span>

<span class="kwrd">private</span> <span class="kwrd">static</span> List&lt;Bitmap&gt; ImageToBitmap()
{
    <span class="rem">//Create and Image object from file path and name</span>
    Image originalImage = Image.FromFile(<span class="str">@&quot;C:\Temp\Your_File.tif&quot;</span>);

    <span class="rem">//Create a collection of Bitmap objects </span>
    List&lt;Bitmap&gt; bitmapList = <span class="kwrd">new</span> List&lt;Bitmap&gt;();

    <span class="rem">//Place holders for setting resolution of new Bitmap objects</span>
    var xResolution = originalImage.HorizontalResolution;
    var yResolution = originalImage.VerticalResolution;

    <span class="rem">//Create FrameDimesion for iteration through file frames</span>
    FrameDimension frameDimension = <span class="kwrd">new</span> FrameDimension(originalImage.FrameDimensionsList[0]);

    <span class="rem">//Framecount of image for iteration through file frames</span>
    <span class="kwrd">int</span> frameCount = originalImage.GetFrameCount(FrameDimension.Page);

    <span class="rem">//Simple iteration through file frames</span>
    <span class="kwrd">for</span> (<span class="kwrd">int</span> i = 0; i &lt; frameCount; ++i)
    {
        <span class="rem">//Create bitmap to hold individual frame</span>
        Bitmap bmp;

        <span class="rem">//Moves active frame pointer to next frame in iteration</span>
        originalImage.SelectActiveFrame(frameDimension, i);

        <span class="rem">//Cast image frame to Bitamp holder</span>
        bmp = (Bitmap)originalImage;

        <span class="rem">//Create new Bitmap from placeholder</span>
        Bitmap temp = <span class="kwrd">new</span> Bitmap(bmp);

        <span class="rem">//Set bitmap resolution based on original resolution</span>
        temp.SetResolution(xResolution, yResolution);

        <span class="rem">//Add Bitmap to Bitmap collection</span>
        bitmapList.Add(temp);
    }
    <span class="kwrd">return</span> bitmapList;

}</pre>
<p>-Craig</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.tallan.com/dotnetreflections/2009/06/13/convert-multi-page-image-to-collection-of-bitmaps/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Windows Worfklow: Error 1342 Activity X validation failed: Can not find the condition Y</title>
		<link>http://blogs.tallan.com/dotnetreflections/2009/06/10/windows-worfklow-error-1342-activity-x-validation-failed-can-not-find-the-condition-y/</link>
		<comments>http://blogs.tallan.com/dotnetreflections/2009/06/10/windows-worfklow-error-1342-activity-x-validation-failed-can-not-find-the-condition-y/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 20:52:00 +0000</pubDate>
		<dc:creator>mgerety</dc:creator>
		
		<category><![CDATA[.NET Framework]]></category>

		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blogs.tallan.com/dotnetreflections/2009/06/10/windows-worfklow-error-1342-activity-x-validation-failed-can-not-find-the-condition-y/</guid>
		<description><![CDATA[This is just a small tip for anyone doing any WWF work:&#160; The workflow’s name property MUST MATCH file workflow filename or rules and conditions will not be found, and the workflow will not be instantiated.
Example:
Create a sequential workflow.&#160; Call it WorkflowA.cs.
Click the workflow in the designer mode, and change the name of the workflow [...]]]></description>
			<content:encoded><![CDATA[<p>This is just a small tip for anyone doing any WWF work:&#160; The workflow’s name property MUST MATCH file workflow filename or rules and conditions will not be found, and the workflow will not be instantiated.</p>
<p>Example:</p>
<p>Create a sequential workflow.&#160; Call it WorkflowA.cs.</p>
<p>Click the workflow in the designer mode, and change the name of the workflow in the property window to WkflwA.&#160; Add any activity that takes conditions (i.e., if/then/else).&#160; </p>
<p>Add a valid condition to this activity.</p>
<p>Attempt to start the workflow.</p>
<p>&#160;</p>
<p>You will get a WorkflowValidationFailedException saying that the Workflow failed validation.&#160; To correct this issue, rename the workflow back to “WorkflowA” and restart.&#160; The workflow will instantiate without issue.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.tallan.com/dotnetreflections/2009/06/10/windows-worfklow-error-1342-activity-x-validation-failed-can-not-find-the-condition-y/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
