<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8282306487405633620</id><updated>2011-08-29T01:28:14.170+12:00</updated><category term='Random'/><category term='C#'/><category term='Versioning'/><category term='VAB'/><category term='InstallShield'/><category term='University'/><category term='Thesis'/><category term='Cricket'/><title type='text'>Ruskin Dantra</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ruskin-dantra.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://ruskin-dantra.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Ruskin Dantra</name><uri>http://www.blogger.com/profile/11120195758158923383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_si6_UfT-_E0/Sbi1FW8krII/AAAAAAAAACM/4UmHhJsr49U/S220/rus.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8282306487405633620.post-7216017837995772443</id><published>2009-12-21T15:40:00.000+13:00</published><updated>2009-12-21T16:47:34.200+13:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VAB'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Using Microsoft Enterprise Library VAB with WCF services – Part 2</title><content type='html'>&lt;p align="justify"&gt;In &lt;a href="http://ruskin-dantra.blogspot.com/2009/12/using-microsoft-enterprise-library-vab.html" target="_blank"&gt;Part 1&lt;/a&gt; we looked at a simple solution on how to do service side validation for a simple WCF service and pass the resulting validation result back to the client.&amp;#160; In this article we’ll look at some other types of validators provided by the Enterprise Library and also touch the topic of rulesets and how they help.&lt;/p&gt;  &lt;p&gt;So far we have looked at &lt;a href="http://msdn.microsoft.com/en-us/library/cc309347.aspx" target="_blank"&gt;RangeValidator&lt;/a&gt;; let us look at some of its properties.&lt;/p&gt;  &lt;p align="justify"&gt;&lt;strong&gt;Bounds&lt;/strong&gt;     &lt;br /&gt;The LowerBound and UpperBound of the validator are self-explanatory and denote the minimum and maximum value the validator can accept.&lt;/p&gt;  &lt;p align="justify"&gt;&lt;strong&gt;BoundType&lt;/strong&gt;     &lt;br /&gt;The BoundType is synonymous to the bounds you have, it tells you whether the bounds are included, excluded or simply ignored.&lt;/p&gt;  &lt;p align="justify"&gt;&lt;strong&gt;Negated&lt;/strong&gt;     &lt;br /&gt;If negated is set then we basically negate the rule, therefore in our example where we had the rangevalidator to accept only positive integers, setting negated=true would mean we only allow negative integers.&amp;#160; Kind of a redundant property in my opinion and simply complicates things.&lt;/p&gt;  &lt;p align="justify"&gt;&lt;strong&gt;Tag&lt;/strong&gt;     &lt;br /&gt;Allows the developer to replace the name of the property which caused the validation fault to a custom string.&amp;#160; Useful when your property name is something like “accessDate” and you want to return “Access Date”.&amp;#160; Keep in mind that the custom Tag is only read when you have a custom message template.&lt;/p&gt;  &lt;p align="justify"&gt;&lt;strong&gt;MessageTemplate&lt;/strong&gt;     &lt;br /&gt;Each validator provided by the Enterprise Library comes with its own message which gets returned on a validation fault, this can be customised by the developer.&amp;#160; For e.g. for the Range Validator we know (looking at the MSDN documentation) token {2} is the Tag, therefore our message template could be “{2} is invalid.” and we would get “Access Date is invalid.”&lt;/p&gt;  &lt;p align="justify"&gt;&lt;strong&gt;MessageTemplateResourceName/MessageTemplateResouceType &lt;/strong&gt;    &lt;br /&gt;The following items come in handy when you have declared your messages in a resource file.&lt;/p&gt;  &lt;p align="justify"&gt;&lt;strong&gt;Ruleset&lt;/strong&gt;     &lt;br /&gt;Allows the developer to target different validation rules depending on different criteria.&amp;#160; E.g. different clients may have different validation rules depending on different business logic.&amp;#160; This can be done by simply changing the config file to tell the validation block which ruleset to use as shown below:&lt;/p&gt;  &lt;pre class="xml" name="code"&gt;&lt;endpointbehaviors&gt;&lt;br /&gt;	&lt;behavior name="ValidationBehavior"&gt;&lt;br /&gt;		&lt;validation enabled="true" ruleset="Customer1" /&gt;&lt;br /&gt;	&lt;/behavior&gt;&lt;br /&gt;&lt;/endpointbehaviors&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="justify"&gt;To be continued…&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282306487405633620-7216017837995772443?l=ruskin-dantra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruskin-dantra.blogspot.com/feeds/7216017837995772443/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/12/using-microsoft-enterprise-library-vab_21.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/7216017837995772443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/7216017837995772443'/><link rel='alternate' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/12/using-microsoft-enterprise-library-vab_21.html' title='Using Microsoft Enterprise Library VAB with WCF services – Part 2'/><author><name>Ruskin Dantra</name><uri>http://www.blogger.com/profile/11120195758158923383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_si6_UfT-_E0/Sbi1FW8krII/AAAAAAAAACM/4UmHhJsr49U/S220/rus.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282306487405633620.post-4078740687968001435</id><published>2009-12-10T16:21:00.000+13:00</published><updated>2009-12-12T19:56:58.512+13:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>De/Se-rializing C# objects to XML</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;p align='justify'&gt;I have come across many projects over the years which need some sort of serializing and deserializing of C# objects to XML.  I usually remember the general syntax but more than often end up searching for the exact syntax.  There are tonnes of articles on this by the way and this blog is merely to give me a consistent way of doing this rather than anything else.&lt;/p&gt;  &lt;p align='justify'&gt;Say you have a couple of C# classes such that one class contains a collection of the other class and you want to serialize this into XML.&lt;/p&gt;  &lt;p align='justify'&gt;&lt;a href='http://lh6.ggpht.com/_si6_UfT-_E0/SyBuLxxaDzI/AAAAAAAAAM4/NN8JLMD1rYs/s1600-h/image%5B3%5D.png'&gt;&lt;img width='425' height='177' border='0' src='http://lh5.ggpht.com/_si6_UfT-_E0/SyBuM4v5jsI/AAAAAAAAANA/EJ5-j2CGhpU/image_thumb%5B1%5D.png?imgmax=800' alt='image' title='image' style='border-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto;'/&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align='justify'&gt;The way I usually do it is simply by adding some attributes to my C# classes which represent the structure of the resulting XML and run an XML serializer against it.  So my C# classes would potentially look like:&lt;/p&gt;  &lt;pre name='code' class='csharp'&gt;[XmlRoot(ElementName = "Customer", IsNullable = false)]&lt;br /&gt;public class Customer&lt;br /&gt;{&lt;br /&gt;	[XmlElement(ElementName = "Name")]&lt;br /&gt;	public string Name { get; set; }&lt;br /&gt;&lt;br /&gt;	[XmlElement(ElementName = "IsExpired")]&lt;br /&gt;	public bool IsExpired { get; set; }&lt;br /&gt;&lt;br /&gt;	[XmlElement(ElementName = "DOB")]&lt;br /&gt;	public DateTime DOB { get; set; }&lt;br /&gt;&lt;br /&gt;	[XmlArray("Orders")]&lt;br /&gt;	[XmlArrayItem("Order", Type = typeof(Order))]&lt;br /&gt;	public List&amp;lt;order&amp;gt; Orders { get; set; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class Order&lt;br /&gt;{&lt;br /&gt;	[XmlAttribute(AttributeName = "OrderID")]&lt;br /&gt;	public int OrderID { get; set; }&lt;br /&gt;}&lt;/pre&gt;&lt;p&gt;With the above class we get an XML output as shown in the figure below:&lt;/p&gt;&lt;p&gt;&lt;a href='http://lh6.ggpht.com/_si6_UfT-_E0/SyBuNmY_sEI/AAAAAAAAANM/fQpA2ifeZY8/s1600-h/image%5B7%5D.png'&gt;&lt;img width='506' height='199' border='0' src='http://lh3.ggpht.com/_si6_UfT-_E0/SyBuPnl8MVI/AAAAAAAAANY/pxqFQfbyHjc/image_thumb%5B3%5D.png?imgmax=800' alt='image' title='image' style='border-width: 0px; display: inline;'/&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;And the code which actually does the serialization:&lt;/p&gt;&lt;pre name='code' class='csharp'&gt;class Program&lt;br /&gt;{&lt;br /&gt;	static void Main(string[] args)&lt;br /&gt;	{&lt;br /&gt;		Customer c = new Customer()&lt;br /&gt;		{&lt;br /&gt;		    Name = "Ruskin Dantra",&lt;br /&gt;		    DOB = DateTime.Today,&lt;br /&gt;		    IsExpired = false,&lt;br /&gt;		    Orders = new List&amp;lt;order&amp;gt;() &lt;br /&gt;		    {&lt;br /&gt;		        new Order() { OrderID = 1},&lt;br /&gt;		        new Order() { OrderID = 2},&lt;br /&gt;		        new Order() { OrderID = 3}&lt;br /&gt;		    }&lt;br /&gt;		};&lt;br /&gt;&lt;br /&gt;		System.Xml.Serialization.XmlSerializer s = new System.Xml.Serialization.XmlSerializer(typeof(Customer));&lt;br /&gt;&lt;br /&gt;		XmlWriterSettings settings = new XmlWriterSettings();&lt;br /&gt;		settings.Indent = true;&lt;br /&gt;&lt;br /&gt;		XmlWriter writer = XmlWriter.Create(@"Customer.xml", settings); &lt;br /&gt;		s.Serialize(writer, c);&lt;br /&gt;		writer.Close();&lt;br /&gt;	}&lt;br /&gt;}&lt;/pre&gt;&lt;p&gt;If you want to deserialize the above created XML back into the object all you have to do is:&lt;/p&gt;&lt;pre name='code' class='csharp'&gt;System.Xml.Serialization.XmlSerializer s = new System.Xml.Serialization.XmlSerializer(typeof(Customer));&lt;br /&gt;XmlReader reader = XmlReader.Create(@"Customer.xml");&lt;br /&gt;Customer deserializedCustomer = s.Deserialize(reader) as Customer;&lt;br /&gt;reader.Close();&lt;/pre&gt;&lt;p&gt;Its as easy as that :)&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282306487405633620-4078740687968001435?l=ruskin-dantra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruskin-dantra.blogspot.com/feeds/4078740687968001435/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/12/dese-reializing-c-objects-to-xml.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/4078740687968001435'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/4078740687968001435'/><link rel='alternate' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/12/dese-reializing-c-objects-to-xml.html' title='De/Se-rializing C# objects to XML'/><author><name>Ruskin Dantra</name><uri>http://www.blogger.com/profile/11120195758158923383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_si6_UfT-_E0/Sbi1FW8krII/AAAAAAAAACM/4UmHhJsr49U/S220/rus.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_si6_UfT-_E0/SyBuM4v5jsI/AAAAAAAAANA/EJ5-j2CGhpU/s72-c/image_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282306487405633620.post-8024391891141788718</id><published>2009-12-09T13:22:00.000+13:00</published><updated>2009-12-21T15:53:33.273+13:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VAB'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Using Microsoft Enterprise Library VAB with WCF services – Part 1</title><content type='html'>&lt;p align="justify"&gt;I am starting to write a series of blog articles, each varying in complexity, highlighting how we use can the Validation Application Blocks within the &lt;a href="http://msdn.microsoft.com/en-us/library/dd203099.aspx" target="_blank"&gt;Microsoft Enterprise Library&lt;/a&gt; to do really neat validation.&amp;#160; Extremely flexible and configurable at runtime.&amp;#160; Although we will slowly build towards that.&lt;/p&gt;  &lt;p align="justify"&gt;In this first part let me just give a brief introduction to what the VAB actually is some simple ways of using it within a WCF service.&lt;/p&gt;  &lt;p align="justify"&gt;While writing WCF services we often cannot guarantee the data we get passed in, let it be simple data like integers or complex business objects such as Customers or even worse, process definitions.&amp;#160; Although, as developers we have to design some sort of clever program which can intelligently sorting out good data from bad data.&amp;#160; Good data is often derived from pages of use cases and business rules.&amp;#160; These rules tend to change often so it’s only advisable that we allow for this by allowing our program (in this case a WCF service) to read this rules at runtime.&amp;#160; This is our end goal.&lt;/p&gt;  &lt;p align="justify"&gt;In the early days I used to do simple checks on data to determine its validity.&amp;#160; Although strenuous and naive, it worked.&amp;#160; For e.g. if you have a service which finds the square root of a number then we know for a fact that it cannot accept a negative number.&amp;#160; So a developer has the following options:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;     &lt;div align="justify"&gt;Don’t care about the erroneous input&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;Cater for error scenarios (number being less than 0) and return a exception&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;Cater for error scenarios (number being less than 0) and return a message&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;Return an exception which has the message&lt;/div&gt;   &lt;/li&gt; &lt;/ol&gt;  &lt;p align="justify"&gt;Yes, the last option does look the most tempting but a bit harder to implement.&amp;#160; Let us try and work through the other options first, for all our scenarios we will have the same interface and client definition:&lt;/p&gt;  &lt;p align="justify"&gt;&lt;em&gt;Interface:&lt;/em&gt;&lt;/p&gt;  &lt;pre class="csharp" name="code"&gt;namespace VABService&lt;br /&gt;{&lt;br /&gt;	[ServiceContract]&lt;br /&gt;	public interface IMyService&lt;br /&gt;	{&lt;br /&gt;		[OperationContract]&lt;br /&gt;		double SquareRoot(double number);&lt;br /&gt;	}&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;em&gt;Client:&lt;/em&gt; &lt;br /&gt;&lt;br /&gt;&lt;pre class="csharp" name="code"&gt;namespace VABServiceClient&lt;br /&gt;{&lt;br /&gt;	class Program&lt;br /&gt;	{&lt;br /&gt;		static void Main(string[] args)&lt;br /&gt;		{&lt;br /&gt;			service.MyServiceClient client = null;&lt;br /&gt;			try&lt;br /&gt;			{&lt;br /&gt;				client = new VABServiceClient.service.MyServiceClient();&lt;br /&gt;				double result = client.SquareRoot(4);&lt;br /&gt;			}&lt;br /&gt;			catch (Exception e)&lt;br /&gt;			{&lt;br /&gt;			}&lt;br /&gt;			finally&lt;br /&gt;			{&lt;br /&gt;				if (client != null &amp;amp;&amp;amp; client.State != System.ServiceModel.CommunicationState.Faulted)&lt;br /&gt;				{&lt;br /&gt;					try&lt;br /&gt;					{&lt;br /&gt;						client.Close();&lt;br /&gt;					}&lt;br /&gt;					catch (Exception e)&lt;br /&gt;					{&lt;br /&gt;						// don't care&lt;br /&gt;					}&lt;br /&gt;				}&lt;br /&gt;			}&lt;br /&gt;		}&lt;br /&gt;	}&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Don’t care about the erroneous input &lt;/strong&gt;With this approach our implementation looks simple and we end up with:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharp" name="code"&gt;namespace VABService&lt;br /&gt;{&lt;br /&gt;	public class MyService : IMyService&lt;br /&gt;	{&lt;br /&gt;		#region IMyService Members&lt;br /&gt;		public double SquareRoot(double number)&lt;br /&gt;		{&lt;br /&gt;			return Math.Sqrt(number);&lt;br /&gt;		}&lt;br /&gt;		#endregion&lt;br /&gt;	}&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="justify"&gt;This service implementation will allow for the correct square root to be returned but say instead of passing in a positive integer we pass in a negative integer: –4; can the service guarantee a deterministic result?&amp;#160; I don’t think so, the most the developer can say is that it will do whatever the .Net environment is set up to do.&amp;#160; Left as is the result coming back will be &lt;strong&gt;NaN&lt;/strong&gt;.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://lh5.ggpht.com/_si6_UfT-_E0/Sy7jDWTZLJI/AAAAAAAAANg/LOmQzRgULPs/s1600-h/image%5B4%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_si6_UfT-_E0/Sy7jE1xaKxI/AAAAAAAAANk/P8JOcVoEJDw/image_thumb%5B2%5D.png?imgmax=800" width="457" height="100" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="justify"&gt;If the client was a high risk financial application and the service returned this value, the result would be quite catastrophic unless both the client and the service came to some sort of prior agreement about this returned value.&amp;#160; Although wouldn’t it be nice if we raised an exception or an error of some kind sighting the problem?&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="justify"&gt;&lt;strong&gt;Cater for error scenarios (with an Exception)&lt;/strong&gt; To allow for an exception to be raised we have to slightly change the service implementation as shown below:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharp" name="code"&gt;namespace VABService&lt;br /&gt;{&lt;br /&gt;	public class MyService : IMyService&lt;br /&gt;	{&lt;br /&gt;		#region IMyService Members&lt;br /&gt;		public double SquareRoot(double number)&lt;br /&gt;		{&lt;br /&gt;			if (number &amp;lt; 0)&lt;br /&gt;				throw new ArgumentOutOfRangeException(string.Format(&amp;quot;Square root of negative numbers cannot be determined:{0}.&amp;quot;, number));&lt;br /&gt;			return Math.Sqrt(number);&lt;br /&gt;		}&lt;br /&gt;		#endregion&lt;br /&gt;	}&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="justify"&gt;Now with the same client as before if we pass in a negative number we get a&amp;#160; exception although the client is nonetheless wiser than it was before:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://lh6.ggpht.com/_si6_UfT-_E0/Sy7jFnTVyiI/AAAAAAAAANo/cR-L8D2K1Wc/s1600-h/image%5B8%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_si6_UfT-_E0/Sy7jGjt61VI/AAAAAAAAANs/Qxrg1OXRBn8/image_thumb%5B4%5D.png?imgmax=800" width="626" height="355" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="justify"&gt;You see the above exception because of an attempt to hide the implementation details of the service from the clients calling it.&amp;#160; Just as the exception states, if we set the flag &lt;strong&gt;IncludeExceptionDetailsInFaults&lt;/strong&gt; to be &lt;strong&gt;true&lt;/strong&gt;, we will actually see why the exception occurred:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="justify"&gt;&lt;a href="http://lh5.ggpht.com/_si6_UfT-_E0/Sy7jHa0ZGsI/AAAAAAAAANw/0M8c0JhIHOs/s1600-h/image%5B12%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_si6_UfT-_E0/Sy7jIcJrMgI/AAAAAAAAAN0/0xROWI_Wrbg/image_thumb%5B6%5D.png?imgmax=800" width="644" height="307" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="justify"&gt;Although this is opening up our service unnecessarily and clients can get a clear view of our implementation when things go wrong and lets face it, things always can go wrong!&amp;#160; So we want to avoid setting &lt;strong&gt;IncludeExceptionDetailsInFaults&lt;/strong&gt; to &lt;strong&gt;true&lt;/strong&gt; in a production environment.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="justify"&gt;&lt;strong&gt;Cater for error scenarios (with a message)&lt;/strong&gt; To allow for this we have to add even more code to the implementation and also add another parameter to our interface which we can use to pass back the error message, which in this case is the exception text.&amp;#160; We all know how this is going to look, yes UGLY!&amp;#160; We don’t want to do that!!! This brings us to our last option and the most elegant solution.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="justify"&gt;&lt;strong&gt;Return an exception which has the message&lt;/strong&gt; This is where &lt;a href="http://cgeers.wordpress.com/2008/11/09/wcf-extensibility-parameter-inspectors/" target="_blank"&gt;Geers Blog&lt;/a&gt; comes in handy.&amp;#160; WCF exposes really neat things which can be used to do all sorts of validation but why do this when we can go one step further and use an already well thought and designed framework wrapper.&amp;#160; Yes, the VAB is exactly that.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="justify"&gt;&lt;strong&gt;&lt;font size="3"&gt;The Meat &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;/strong&gt;Yes so far all you have seen is bones and why, what…and blah blah, boring stuff.&amp;#160; The meat of the post is now here…let us use the VAB to do simple validation while finding the square root of a number.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="justify"&gt;First step would be to install the enterprise library and add a reference to (within your service project):&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;  &lt;li&gt;&lt;br /&gt;    &lt;div align="justify"&gt;Microsoft.Practices.EnterpriseLibrary.Validation.integration.WCF &lt;/div&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;&lt;br /&gt;    &lt;div&gt;Microsoft.Practices.EnterpriseLibrary.Validation.dll&lt;/div&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;&lt;br /&gt;    &lt;div&gt;Microsoft.Practices.EnterpriseLibrary.Common.dll&lt;/div&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;After doing so we’ll need to make 3 changes…&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;  &lt;li&gt;Service interface change &lt;br /&gt;    &lt;br /&gt;Our service interface will now contain the following code. &lt;br /&gt;&lt;br /&gt;    &lt;pre class="csharp" name="code"&gt;using System;&lt;br /&gt;using System.ServiceModel;&lt;br /&gt;using Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WCF;&lt;br /&gt;using Microsoft.Practices.EnterpriseLibrary.Validation.Validators;&lt;br /&gt;&lt;br /&gt;namespace VABService&lt;br /&gt;{&lt;br /&gt;	[ServiceContract]&lt;br /&gt;	public interface IMyService&lt;br /&gt;	{&lt;br /&gt;		[OperationContract]&lt;br /&gt;		[FaultContract(typeof(ValidationFault))]&lt;br /&gt;		double SquareRoot(&lt;br /&gt;			[RangeValidator(0, RangeBoundaryType.Inclusive, Double.MaxValue, RangeBoundaryType.Inclusive)]&lt;br /&gt;			double number);&lt;br /&gt;	}&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;Note that we now have a rangevalidator for the parameter “number” and also declare that this particular interface method has a fault contract of type ValidationFault associated to it &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;Config file &lt;br /&gt;    &lt;pre class="xml" name="code"&gt;&lt;system.servicemodel&gt;&lt;br /&gt;		&lt;services&gt;&lt;br /&gt;			&lt;service name="VABService.MyService" behaviorconfiguration="VABService.Service1Behavior"&gt;&lt;br /&gt;				&lt;endpoint behaviorconfiguration="ValidationBehavior" address="" binding="wsHttpBinding" contract="VABService.IMyService"&gt;&lt;br /&gt;					&lt;identity&gt;&lt;br /&gt;						&lt;dns value="localhost" /&gt;&lt;br /&gt;					&lt;/identity&gt;&lt;br /&gt;				&lt;/endpoint&gt;&lt;br /&gt;				&lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /&gt;&lt;br /&gt;			&lt;/service&gt;&lt;br /&gt;		&lt;/services&gt;&lt;br /&gt;		&lt;behaviors&gt;&lt;br /&gt;			&lt;servicebehaviors&gt;&lt;br /&gt;				&lt;behavior name="VABService.Service1Behavior"&gt;&lt;br /&gt;					&lt;!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --&gt;&lt;br /&gt;					&lt;servicemetadata httpgetenabled="true" /&gt;&lt;br /&gt;					&lt;!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information --&gt;&lt;br /&gt;					&lt;servicedebug includeexceptiondetailinfaults="false" /&gt;&lt;br /&gt;				&lt;/behavior&gt;&lt;br /&gt;			&lt;/servicebehaviors&gt;&lt;br /&gt;			&lt;endpointbehaviors&gt;&lt;br /&gt;				&lt;behavior name="ValidationBehavior"&gt;&lt;br /&gt;					&lt;validation enabled="true" /&gt;&lt;br /&gt;				&lt;/behavior&gt;&lt;br /&gt;			&lt;/endpointbehaviors&gt;&lt;br /&gt;		&lt;/behaviors&gt;&lt;br /&gt;		&lt;extensions&gt;&lt;br /&gt;			&lt;behaviorextensions&gt;&lt;br /&gt;				&lt;add name="validation" type="Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WCF.ValidationElement, Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WCF, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /&gt;&lt;br /&gt;			&lt;/behaviorextensions&gt;&lt;br /&gt;		&lt;/extensions&gt;&lt;br /&gt;	&lt;/system.servicemodel&gt;&lt;/pre&gt;&lt;br /&gt;Note that we have only added new a endpoint behaviour, a behaviour extension and mapped our already existing endpoint to the newly added endpoint behaviour. &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;Client change &lt;br /&gt;    &lt;pre class="csharp" name="code"&gt;static void Main(string[] args)&lt;br /&gt;		{&lt;br /&gt;			service.MyServiceClient client = null;&lt;br /&gt;			try&lt;br /&gt;			{&lt;br /&gt;				client = new VABServiceClient.service.MyServiceClient();&lt;br /&gt;				double result = client.SquareRoot(-4);&lt;br /&gt;			}&lt;br /&gt;			catch (FaultException&lt;vabserviceclient.service.validationfault&gt; fe)&lt;br /&gt;			{&lt;br /&gt;			}&lt;br /&gt;			catch (Exception e)&lt;br /&gt;			{&lt;br /&gt;			}&lt;br /&gt;			finally&lt;br /&gt;			{&lt;br /&gt;				if (client != null &amp;amp;&amp;amp; client.State != System.ServiceModel.CommunicationState.Faulted)&lt;br /&gt;				{&lt;br /&gt;					try&lt;br /&gt;					{&lt;br /&gt;						client.Close();&lt;br /&gt;					}&lt;br /&gt;					catch (Exception e)&lt;br /&gt;					{&lt;br /&gt;						// don't care&lt;br /&gt;					}&lt;br /&gt;				}&lt;br /&gt;			}&lt;br /&gt;		}&lt;/pre&gt;&lt;br /&gt;With this change in the client, now instead of getting simply exceptions without any message we get a particular type of exception which we can catch and investigate as shown in the image below:&amp;#160; &lt;br /&gt;&lt;a href="http://lh4.ggpht.com/_si6_UfT-_E0/Sy7jJbxoR4I/AAAAAAAAAN4/WkYXVGaio-4/s1600-h/image%5B16%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_si6_UfT-_E0/Sy7jKU6DEHI/AAAAAAAAAN8/cqkTj0xjkB4/image_thumb%5B8%5D.png?imgmax=800" width="822" height="413" /&gt;&lt;/a&gt; &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;We’ll look at other validators in &lt;a href="http://ruskin-dantra.blogspot.com/2009/12/using-microsoft-enterprise-library-vab_21.html" target="_blank"&gt;Part 2&lt;/a&gt;.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282306487405633620-8024391891141788718?l=ruskin-dantra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruskin-dantra.blogspot.com/feeds/8024391891141788718/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/12/using-microsoft-enterprise-library-vab.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/8024391891141788718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/8024391891141788718'/><link rel='alternate' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/12/using-microsoft-enterprise-library-vab.html' title='Using Microsoft Enterprise Library VAB with WCF services – Part 1'/><author><name>Ruskin Dantra</name><uri>http://www.blogger.com/profile/11120195758158923383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_si6_UfT-_E0/Sbi1FW8krII/AAAAAAAAACM/4UmHhJsr49U/S220/rus.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_si6_UfT-_E0/Sy7jE1xaKxI/AAAAAAAAANk/P8JOcVoEJDw/s72-c/image_thumb%5B2%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282306487405633620.post-3819467069524146252</id><published>2009-12-09T11:57:00.000+13:00</published><updated>2009-12-09T12:29:27.528+13:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Debugging VB6 COM DLLs via .Net</title><content type='html'>&lt;p&gt;I am sure there are other ways of doing this but this post is just a simple step by step guide on one of them.&lt;/p&gt;&lt;p align="justify"&gt;More often than not we have to use legacy COM components while writing new applications, let it be for database access, business logic or to simply avoid duplicating code.&amp;#160; Every time I end up using a COM object in my .Net application I lose the ability to debug inside that COM object and mostly have to assume that whatever happens within that call is logically correct.&amp;#160; Sometimes I am not convinced so I need to see proof of it first hand, so what do I do, I debug the COM call.&lt;/p&gt;&lt;p align="justify"&gt;Adding a COM object to .Net cannot be easier, simply add a reference to the COM object which is registered on your computer and .Net automatically creates what we call a CCW (COM Callable Wrapper).&amp;#160; This is widely documented &lt;a href="http://msdn.microsoft.com/en-us/library/f07c8z1c(VS.71).aspx" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;p align="justify"&gt;In order to demonstrate how to debug a COM call let us first create a very simple VB6 DLL called Project1.dll.&amp;#160; In this COM DLL I have a single class called Class1.cls which contains a very simple Add method as shown below:&lt;/p&gt; &lt;pre class="vb" name="code"&gt;Option Explicit&lt;br /&gt;&lt;br /&gt;Public Sub Add(ByVal a As Integer, ByVal b As Integer, ByRef result As Integer)&lt;br /&gt;    result = a + b&lt;br /&gt;    Exit Sub&lt;br /&gt;End Sub&lt;/pre&gt;&lt;p align="justify"&gt;After creating this method, I built the DLL to a location using the default build options within the VB6 IDE by going to File&amp;gt;Make Project1.dll.&lt;/p&gt;&lt;br /&gt;&lt;p align="justify"&gt;After this was done I created a new ConsoleApplication solution in C# to reference this COM DLL.&amp;#160; Added a reference to Project1 which allowed me to do this:&lt;/p&gt;&lt;br /&gt;&lt;pre class="csharp" name="code"&gt;Project1.Class1Class class1 = new Project1.Class1Class();&lt;br /&gt;short res = 0;&lt;br /&gt;class1.Add(1, 2, ref res);&lt;/pre&gt;&lt;p align="justify"&gt;Great, I can now use the add method which I wrote in the COM object, say if the COM method returns the wrong value and I want to step into that code, I simply go Debug&amp;gt;Step Into (F11).&amp;#160; But what happens is that the debugger simply steps over that code and gets the result.&amp;#160; What has happened is that none of the symbols for that Project1.dll were loaded into my IDE:&lt;/p&gt;&lt;p align="justify"&gt;&lt;a href="http://lh3.ggpht.com/_si6_UfT-_E0/Sx7gfOsQb7I/AAAAAAAAAJg/5tG8BywoOtU/s1600-h/image%5B3%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_si6_UfT-_E0/Sx7ggQRD2sI/AAAAAAAAAJs/rFvbGUd-IEU/image_thumb%5B1%5D.png?imgmax=800" width="716" height="36" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;This can be achieved simply by building the VB6 DLL using symbolic information.&amp;#160; You can do this by right clicking on the VB6 project in your IDE and going to Properties&amp;gt;Compile and check the boxes which say “Create Symbolic Debug Info” and also select “No Optimization”.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://lh5.ggpht.com/_si6_UfT-_E0/Sx7ghaeldRI/AAAAAAAAAJ4/eObzrEz_Jdc/s1600-h/image%5B7%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_si6_UfT-_E0/Sx7gixpB4JI/AAAAAAAAAKE/BChqCKZ8aGs/image_thumb%5B3%5D.png?imgmax=800" width="432" height="395" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p align="justify"&gt;After the above is done, rebuild the Project1.dll.&amp;#160; You’&amp;#160; Simply doing the above step will not allow you to step into the “Add” function because the .Net IDE still hasn’t loaded the symbols.&amp;#160; To allow for this we have to enabled “Unmanaged Debugging” for our project, this can be done by going into the Project Properties&amp;gt;Debug and checking the box “Enable unmanaged code debugging” as shown below.&lt;/p&gt;&lt;p align="justify"&gt;&lt;a href="http://lh6.ggpht.com/_si6_UfT-_E0/Sx7glcFSd4I/AAAAAAAAAKQ/9Lg5i3lI4RM/s1600-h/image%5B11%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_si6_UfT-_E0/Sx7gmyQD0VI/AAAAAAAAAKc/VaTIFncuiXg/image_thumb%5B5%5D.png?imgmax=800" width="703" height="520" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Doing the above process will now load the symbols:&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_si6_UfT-_E0/Sx7gnlGn7oI/AAAAAAAAAKo/vUtcvrL_aRo/s1600-h/image%5B24%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_si6_UfT-_E0/Sx7goi4O45I/AAAAAAAAAK0/lUNg-Dlasc0/image_thumb%5B14%5D.png?imgmax=800" width="859" height="26" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Doing the above steps will still not allow us to step into the VB6 code, for this we have to do a manual step.&amp;#160; Open up the code file which has the “Add” function defined and put a breakpoint at the desired line of code.&amp;#160; Now when you step into the “Add” method call you will hit the breakpoint on the VB6 side as shown below:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://lh5.ggpht.com/_si6_UfT-_E0/Sx7grNU2z6I/AAAAAAAAALA/9u7HggNbwmk/s1600-h/image%5B28%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_si6_UfT-_E0/Sx7gsWcbsOI/AAAAAAAAALM/aWnkYSTOaB0/image_thumb%5B16%5D.png?imgmax=800" width="674" height="356" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Voila! :)&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282306487405633620-3819467069524146252?l=ruskin-dantra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruskin-dantra.blogspot.com/feeds/3819467069524146252/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/12/debugging-vb6-com-dlls-via-net.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/3819467069524146252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/3819467069524146252'/><link rel='alternate' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/12/debugging-vb6-com-dlls-via-net.html' title='Debugging VB6 COM DLLs via .Net'/><author><name>Ruskin Dantra</name><uri>http://www.blogger.com/profile/11120195758158923383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_si6_UfT-_E0/Sbi1FW8krII/AAAAAAAAACM/4UmHhJsr49U/S220/rus.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_si6_UfT-_E0/Sx7ggQRD2sI/AAAAAAAAAJs/rFvbGUd-IEU/s72-c/image_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282306487405633620.post-3057767763949075343</id><published>2009-10-24T14:44:00.000+13:00</published><updated>2009-10-24T14:49:54.756+13:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='InstallShield'/><title type='text'>Using VB to show IIS sites within Installshield 2010</title><content type='html'>&lt;p align="justify"&gt;Quite often I have worked on projects where an installer is needed.&amp;#160; So far I am quite familiar with Installshield and its inner workings so this blog describes a simple piece of code which solves a generic issue I had.&lt;/p&gt;  &lt;p align="justify"&gt;More often than not we program in a web based world, a web based installer is needed and the obvious incline is to use IIS, well at least for me considering I am mainly of a .Net developer.&amp;#160; In Installshield everything is easy when it comes to installing something on the local IIS but it gets complicated when you want to customise this process and allow users to choose the website within which the application will be installed or even the name of the application.&lt;/p&gt;  &lt;p align="justify"&gt;Customising the name of the application is easy and can be done simply by using what Installshield refers to as “properties”.&amp;#160; Expose a simple edit box and then in your “Internet Information Services” node simply change the “Name” to point to the property mapped to the edit box (e.g. “[MY_VIRTUAL_DIRECTORY]”).&lt;/p&gt;  &lt;p align="justify"&gt;Things get complicated when you want to show the user a list of websites to which your application can be added to, by default it goes to the “Default Web Site” or at least that’s what I assume but not always as stated by this table &lt;a href="http://documentation.installshield.com/robo/projects/installshield16helplib/IISPortSiteNo.htm" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p align="justify"&gt;Saying that, there is no easy way of showing the user a list of already existing websites on the local computer so after a bit of hunting around I found several solutions on the Installshield forums which advised me of a particular VB script which does what we need.&lt;/p&gt;&lt;pre class="vb" name="code"&gt;Dim objViewDim objDB&lt;br /&gt;Dim objInstaller&lt;br /&gt;Dim objRecord&lt;br /&gt;Dim objW3SVC, objIisWebSite&lt;br /&gt;Dim lngOrder&lt;br /&gt;Set objDB = Session.DatabaseSet &lt;br /&gt;objInstaller = Session.Installer&lt;br /&gt;&lt;br /&gt;'Delete any records that may exist&lt;br /&gt;Set viewList = Database.OpenView(&amp;quot;SELECT * FROM ComboBox&amp;quot;)&lt;br /&gt;viewList.ExecuteSet recList = viewList.Fetch&lt;br /&gt;&lt;br /&gt;'delete any existing records&lt;br /&gt;While Not (recList Is Nothing)&lt;br /&gt;	viewList.Modify 6, recList ' 6 = deleteSet&lt;br /&gt;	recList = viewList.Fetch&lt;br /&gt;Wend&lt;br /&gt;viewList.CloseSet &lt;br /&gt;&lt;br /&gt;objView = objDB.OpenView(&amp;quot;select * from ComboBox&amp;quot;)&lt;br /&gt;&lt;br /&gt;' enumerate webservers on localhost and populate ComboBox tableSet&lt;br /&gt;objW3SVC = GetObject(&amp;quot;IIS://localhost/W3SVC&amp;quot;)&lt;br /&gt;lngOrder = 1&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For Each objIisWebSite In objW3SVC&lt;br /&gt;	If objIisWebSite.Class = &amp;quot;IIsWebServer&amp;quot; Then&lt;br /&gt;		If LCase(objIisWebSite.ServerComment) &amp;lt;&amp;gt; &amp;quot;administration web site&amp;quot; Then&lt;br /&gt;			' add site name to ComboBox table (which is used by our dialog ComboBox)&lt;br /&gt;			Set objRecord = objInstaller.CreateRecord(4)&lt;br /&gt;			objRecord.StringData(1) = &amp;quot;WEBSITE_DROPDOWN&amp;quot; ' property name&lt;br /&gt;			objRecord.IntegerData(2) = lngOrder ' order&lt;br /&gt;			objRecord.StringData(3) = objIisWebSite.Name ' value&lt;br /&gt;			objRecord.StringData(4) = objIisWebSite.ServerComment ' text    &lt;br /&gt;			Call objView.Execute(objRecord) ' now add the record to the table &lt;br /&gt;			Call objView.Modify(7, objRecord) ' (7 = msiViewModifyInsertTemporary)&lt;br /&gt;			&lt;br /&gt;			lngOrder = lngOrder + 1&lt;br /&gt;		End If&lt;br /&gt;	End If&lt;br /&gt;Next&lt;br /&gt;Call objView.Close&lt;/pre&gt;&lt;p align="justify"&gt;Note that the value of the combobox is “objIisWebSite.Name” and you might think this is the human readable string which appears as the website name, but its not.&amp;#160; The name of the website is a unique number (ID) assigned to it as shown in the figure below:&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_si6_UfT-_E0/SteFizxx4uI/AAAAAAAAAII/UckB8hAgeWo/s1600-h/image%5B4%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_si6_UfT-_E0/SteFkMUKL6I/AAAAAAAAAIM/hnJXdOX2eTo/image_thumb%5B2%5D.png?imgmax=800" width="644" height="111" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;Therefore when you want to specify where your application will be added to, you have to modify the “Default Web Site” node (which you will add as the default behaviour and put all your applications under it).&amp;#160; A bit counter intuitive as earlier I simply thought that instead of naming it “Default Web Site” I have to map it to my property which corresponds to the drop down list, i.e. &amp;quot;WEBSITE_DROPDOWN”.&amp;#160; But the trick is to associate the “WEBSITE_DROPDOWN” property to the “Site Number” setting in the Default Web Site node.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282306487405633620-3057767763949075343?l=ruskin-dantra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruskin-dantra.blogspot.com/feeds/3057767763949075343/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/10/using-vb-to-show-iis-sites-within.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/3057767763949075343'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/3057767763949075343'/><link rel='alternate' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/10/using-vb-to-show-iis-sites-within.html' title='Using VB to show IIS sites within Installshield 2010'/><author><name>Ruskin Dantra</name><uri>http://www.blogger.com/profile/11120195758158923383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_si6_UfT-_E0/Sbi1FW8krII/AAAAAAAAACM/4UmHhJsr49U/S220/rus.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_si6_UfT-_E0/SteFkMUKL6I/AAAAAAAAAIM/hnJXdOX2eTo/s72-c/image_thumb%5B2%5D.png?imgmax=800' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282306487405633620.post-7671571930699792111</id><published>2009-04-29T09:16:00.000+12:00</published><updated>2009-04-29T09:31:37.450+12:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cricket'/><title type='text'>Bhai Log Game 5 (28/04/09)</title><content type='html'>&lt;p align="justify"&gt;The game yesterday had some bittersweet moments.&amp;#160; Although we won it was not a victory we ought to cherish nor take into our heads…there is a long long road ahead of us.&lt;/p&gt;  &lt;p align="justify"&gt;We fielded first and luckily I did not have to eat my words when I said “yes we have 8”, when actually we only had 4 players.&amp;#160; It was a mediocre start in the first over which I bowled conceding 11 runs, 9 of those extras although it set up Jacinth with two strikes from the last two deliveries which he executed with class getting a wicket.&amp;#160; Our bowling wasn’t great…it just did enough as the batsman weren’t up to par so I think there is a still a lot of work to be done in that department.&amp;#160; Also our fielding was a bit shaky, we have to communicate!&amp;#160; The pick of the bowlers I have to say was Shashank.&amp;#160; Great pace and always on target.&lt;/p&gt;  &lt;p align="justify"&gt;Our batting was good…well good with respect to the deliveries and fielding of the other team.&amp;#160; We have to start hitting the side nets and not attempt hitting the back nets every time.&amp;#160; Lucky for us it paid of this time around.&amp;#160; We were also helped by poor bowling from the other side as they conceded 25 extras (~ 75 runs).&amp;#160; We also saw some good clean hitting by Kasun and Jessie.&lt;/p&gt;  &lt;p align="justify"&gt;Overall a good performance by the majority of the team although the senior players had a sub-par day, maybe that’s why one of them decided to stay back and make up for it ;).&lt;/p&gt;  &lt;p align="justify"&gt;Let us carry this winning way over to next week when we play the top of the table, an unbeaten team, we’ll change that next week :).&lt;/p&gt;  &lt;p align="justify"&gt;&lt;a href="http://lh6.ggpht.com/_si6_UfT-_E0/Sfd1G7p3nuI/AAAAAAAAAHA/Pthi8kKNnoU/s1600-h/image%5B3%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_si6_UfT-_E0/Sfd1VgsK50I/AAAAAAAAAHE/o8zlHw81Fwk/image_thumb%5B1%5D.png?imgmax=800" width="487" height="295" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_si6_UfT-_E0/Sfd1hCdWisI/AAAAAAAAAHI/YBNrpek7oFU/s1600-h/image%5B7%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_si6_UfT-_E0/Sfd1mQZxUCI/AAAAAAAAAHM/2aN-6kLEppo/image_thumb%5B3%5D.png?imgmax=800" width="487" height="295" /&gt;&lt;/a&gt;&lt;a href="http://lh5.ggpht.com/_si6_UfT-_E0/Sfd1qFRtf9I/AAAAAAAAAHQ/PRX-UZ2heGE/s1600-h/image%5B11%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_si6_UfT-_E0/Sfd1tq002WI/AAAAAAAAAHU/sIp9EApcFjU/image_thumb%5B5%5D.png?imgmax=800" width="487" height="295" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282306487405633620-7671571930699792111?l=ruskin-dantra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruskin-dantra.blogspot.com/feeds/7671571930699792111/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/04/bhai-log-game-5-280409.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/7671571930699792111'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/7671571930699792111'/><link rel='alternate' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/04/bhai-log-game-5-280409.html' title='Bhai Log Game 5 (28/04/09)'/><author><name>Ruskin Dantra</name><uri>http://www.blogger.com/profile/11120195758158923383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_si6_UfT-_E0/Sbi1FW8krII/AAAAAAAAACM/4UmHhJsr49U/S220/rus.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_si6_UfT-_E0/Sfd1VgsK50I/AAAAAAAAAHE/o8zlHw81Fwk/s72-c/image_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282306487405633620.post-3446962093661721806</id><published>2009-04-23T09:21:00.000+12:00</published><updated>2009-04-23T09:30:53.558+12:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cricket'/><title type='text'>Bhai Log Game 4 (21/04/09)</title><content type='html'>&lt;p align="justify"&gt;Bhai Log continues to dive further into slum.&amp;#160; Read more about it &lt;a href="http://www.facebook.com/n/?note.php&amp;amp;note_id=98548215790&amp;amp;mid=5837acG2e29722dG20966e1Ga" target="_blank"&gt;here&lt;/a&gt;.&amp;#160; After a disappointing two weeks of cricket, Bhai Log could not record a win in what could be defined as the easiest game so far.&amp;#160; After restricting the opposition for a meagre 106, Bhai Log failed to deliver with the bat.&lt;/p&gt;  &lt;p align="justify"&gt;A mediocre bowling and fielding attempt from Bhai Log was enough to restrict the opposition to 106 so imagine if Bhai Log fired every time at the right times, they would be the oppositions biggest nightmare.&amp;#160; This week we took a turn in the below par performances where our batting was, no other word for it, absolutely shocking.&amp;#160; We scored a mere 40 runs off the first two partnership with an atrocious third partnership with –4.&amp;#160; I seriously don’t understand what part of “hit the side nets” is so complicated to understand.&amp;#160; The last partnership was a consolidation attempt as in no way were we expecting them to get more than 50 runs.&lt;/p&gt;  &lt;p align="justify"&gt;Jessie was the star of the match which was his first game after he returned from a long vacation in India.&amp;#160; Jessie, were you training there?&amp;#160; Can you tell us how you do it?&lt;/p&gt;  &lt;p align="justify"&gt;Hoping we pick up our act and start getting into the winning habit which has been the essence of Bhai Log since we remember.&lt;/p&gt;  &lt;p align="justify"&gt;Here are the stats.&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://lh4.ggpht.com/_si6_UfT-_E0/Se-MPqHq0yI/AAAAAAAAAGo/bIvf2iQeFPk/s1600-h/image%5B3%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_si6_UfT-_E0/Se-MSHAP15I/AAAAAAAAAGs/IoBG9JkmJFU/image_thumb%5B1%5D.png?imgmax=800" width="487" height="295" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://lh5.ggpht.com/_si6_UfT-_E0/Se-MT7n6WHI/AAAAAAAAAGw/QVf8F5FnDFI/s1600-h/image%5B7%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_si6_UfT-_E0/Se-MZdu68tI/AAAAAAAAAG0/irmD6HC2ZZc/image_thumb%5B3%5D.png?imgmax=800" width="487" height="295" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://lh5.ggpht.com/_si6_UfT-_E0/Se-McLZBJjI/AAAAAAAAAG4/x7ZUlGKk_oU/s1600-h/image%5B11%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_si6_UfT-_E0/Se-MifwwRxI/AAAAAAAAAG8/ylRgpLn8FDA/image_thumb%5B5%5D.png?imgmax=800" width="487" height="295" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282306487405633620-3446962093661721806?l=ruskin-dantra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruskin-dantra.blogspot.com/feeds/3446962093661721806/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/04/bhai-log-game-4-210409.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/3446962093661721806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/3446962093661721806'/><link rel='alternate' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/04/bhai-log-game-4-210409.html' title='Bhai Log Game 4 (21/04/09)'/><author><name>Ruskin Dantra</name><uri>http://www.blogger.com/profile/11120195758158923383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_si6_UfT-_E0/Sbi1FW8krII/AAAAAAAAACM/4UmHhJsr49U/S220/rus.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_si6_UfT-_E0/Se-MSHAP15I/AAAAAAAAAGs/IoBG9JkmJFU/s72-c/image_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282306487405633620.post-9045939172187929071</id><published>2009-04-15T08:34:00.000+12:00</published><updated>2009-04-15T19:05:22.438+12:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cricket'/><title type='text'>Bhai Log Game 3 (14/04/09)</title><content type='html'>&lt;p align="justify"&gt;Following on from our below par performance from &lt;a href="http://ruskin-dantra.blogspot.com/2009/04/bhai-log-game-2-080409.html" target="_blank"&gt;last week&lt;/a&gt; Bhai Log surely lived up to it.&amp;#160; This is a team which came from winning the last season it played to being demolished by two mediocre opponents in two consecutive weeks.&amp;#160; Mind you the team is not the same as last season but yet, it is not the losing that matters, it is the way the loss occurs.&lt;/p&gt;  &lt;p align="justify"&gt;This week we had a 9.35 game and only five team members showed up on time.&amp;#160; You would’ve thought that a late game would mean that everyone would turn up on time.&amp;#160; Worst part is that one team member didn’t show up at all.&amp;#160; Quite a disappointment but that was expected given the history.&amp;#160; So the game began and the only thing we have won so far is the toss.&amp;#160; Elected to bowl considering we have a better chance of chasing and winning as we know how our game should be depending on the score, although that didn’t help at all.&lt;/p&gt;  &lt;p align="justify"&gt;First over was a shocker and unfortunately I was to blame for that giving away 13 runs although the shambles did not stop there.&amp;#160; We bowled atrociously, short balls galore and the batsmen did well to utilise our underpowered field.&amp;#160; There was no urgency in our fielding and I think that’s what lost us the game.&amp;#160; The opponent posted a huge total of 178.&amp;#160; In indoor cricketing terms that is close to impossible to attain.&lt;/p&gt;  &lt;p align="justify"&gt;Our batting started off well with 46 and 40 coming in the first two partnerships although the third partnership didn’t go as well as hoped leaving us to get 58 in the last partnership.&amp;#160; This was a huge ask on its own.&lt;/p&gt;  &lt;p align="justify"&gt;To sum things up, it was yet another below average performance from Bhai Log and shabby umpiring work was partly to blame.&lt;/p&gt;  &lt;p align="justify"&gt;I hope we bounce back in the next game to record our first graded round game win.&amp;#160; Neil and I bowled three overs each.&amp;#160; Matthew Scott batted twice as we were short one player.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_si6_UfT-_E0/SeWHJDldukI/AAAAAAAAAGQ/6XuLsZ3VF0c/s1600-h/image%5B3%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_si6_UfT-_E0/SeWHJ2vX83I/AAAAAAAAAGU/aEoshihidgA/image_thumb%5B1%5D.png?imgmax=800" width="487" height="255" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://lh5.ggpht.com/_si6_UfT-_E0/SeWHKdhmeLI/AAAAAAAAAGY/ozPUG_g1ONU/s1600-h/image%5B7%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_si6_UfT-_E0/SeWHLExZ1PI/AAAAAAAAAGc/ycBYdymbAMI/image_thumb%5B3%5D.png?imgmax=800" width="487" height="295" /&gt;&lt;/a&gt;&amp;#160; &lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://lh4.ggpht.com/_si6_UfT-_E0/SeWHLiJsQAI/AAAAAAAAAGg/9-2arTbuTNE/s1600-h/image%5B11%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_si6_UfT-_E0/SeWHMVToMOI/AAAAAAAAAGk/LT3mssX2djQ/image_thumb%5B5%5D.png?imgmax=800" width="487" height="295" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282306487405633620-9045939172187929071?l=ruskin-dantra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruskin-dantra.blogspot.com/feeds/9045939172187929071/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/04/bhai-log-game-3-140409.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/9045939172187929071'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/9045939172187929071'/><link rel='alternate' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/04/bhai-log-game-3-140409.html' title='Bhai Log Game 3 (14/04/09)'/><author><name>Ruskin Dantra</name><uri>http://www.blogger.com/profile/11120195758158923383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_si6_UfT-_E0/Sbi1FW8krII/AAAAAAAAACM/4UmHhJsr49U/S220/rus.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_si6_UfT-_E0/SeWHJ2vX83I/AAAAAAAAAGU/aEoshihidgA/s72-c/image_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282306487405633620.post-2663935246184634032</id><published>2009-04-12T11:04:00.000+12:00</published><updated>2009-04-14T15:36:20.506+12:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Reading XML Schemas</title><content type='html'>&lt;p align="justify"&gt;XML information is everywhere in these times.&amp;#160; We heavily rely on XML to send and analyse information.&amp;#160; After dealing with XML in every aspect of development I realised that the internet is loaded with information on how to read, write and manipulate XML in every possible language (script) there is.&amp;#160; And to make things worse, I myself have a &lt;a href="http://ruskin-dantra.blogspot.com/2009/03/common-installshield-functions-and.html" target="_blank"&gt;post&lt;/a&gt; up on how to read XML documents using DOM.&lt;/p&gt; &lt;p align="justify"&gt;This motivated me to write this document and to give XML Schemas the respect they require.&amp;#160; What are XML schemas?&amp;#160; They can be simply explained as a skeleton for a given XML file.&amp;#160; An XML file can have any desired structure, XML schemas are what restrict them and keep them well-formed.&amp;#160; So an XML schema is something like a parent which looks after it’s child (the XML document).&lt;/p&gt; &lt;p align="justify"&gt;Let us look at an example:&lt;/p&gt; &lt;pre class="xml" name="code"&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; ?&amp;gt;&lt;br /&gt;&amp;lt;blog&amp;gt;&lt;br /&gt;	&amp;lt;topic date=&amp;quot;2003-08-22&amp;quot;&amp;gt;My first XML document&amp;lt;/topic&amp;gt;&lt;br /&gt;	&amp;lt;topic date=&amp;quot;2006-10-18&amp;quot;&amp;gt;My second XML document&amp;lt;/topic&amp;gt;&lt;br /&gt;&amp;lt;/blog&amp;gt;&lt;/pre&gt;&lt;p&gt;The schema for the above XML is:&lt;/p&gt;&lt;pre class="xml" name="code"&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;&amp;lt;xs:schema attributeFormDefault=&amp;quot;unqualified&amp;quot; elementFormDefault=&amp;quot;qualified&amp;quot; xmlns:xs=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot;&amp;gt;&lt;br /&gt;	&amp;lt;xs:element name=&amp;quot;Blog&amp;quot;&amp;gt;&lt;br /&gt;		&amp;lt;xs:complexType&amp;gt;&lt;br /&gt;			&amp;lt;xs:sequence&amp;gt;&lt;br /&gt;				&amp;lt;xs:element maxOccurs=&amp;quot;unbounded&amp;quot; name=&amp;quot;Topic&amp;quot;&amp;gt;&lt;br /&gt;					&amp;lt;xs:complexType&amp;gt;&lt;br /&gt;						&amp;lt;xs:simpleContent&amp;gt;&lt;br /&gt;							&amp;lt;xs:extension base=&amp;quot;xs:string&amp;quot;&amp;gt;&lt;br /&gt;								&amp;lt;xs:attribute name=&amp;quot;Date&amp;quot; type=&amp;quot;xs:date&amp;quot; use=&amp;quot;required&amp;quot; /&amp;gt;&lt;br /&gt;							&amp;lt;/xs:extension&amp;gt;&lt;br /&gt;						&amp;lt;/xs:simpleContent&amp;gt;&lt;br /&gt;					&amp;lt;/xs:complexType&amp;gt;&lt;br /&gt;				&amp;lt;/xs:element&amp;gt;&lt;br /&gt;			&amp;lt;/xs:sequence&amp;gt;&lt;br /&gt;		&amp;lt;/xs:complexType&amp;gt;&lt;br /&gt;	&amp;lt;/xs:element&amp;gt;&lt;br /&gt;&amp;lt;/xs:schema&amp;gt;&lt;/pre&gt;&lt;p align="justify"&gt;Now that we are familiar with XML schemas let us look at the actual reason of this post.&amp;#160; Given an XML schema, how do we read it?&amp;#160; How do we store the values within the schema, its relationships and other mandatory information required by XML data files.&lt;/p&gt;&lt;p align="justify"&gt;The way I addressed this problem is using two passes:&lt;/p&gt;&lt;ol&gt;&lt;br /&gt;  &lt;li&gt;&lt;div align="justify"&gt;Reading all the information given in XML schema&lt;br /&gt;This was necessary as there can be attribute and element references throughout the file.&amp;#160; Therefore we first need to store all the information about the XML schema and then determine the relationships between each of the data elements.&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;&lt;div align="justify"&gt;Forming relationships between elements&lt;br /&gt;After we store all the information about the XML schema, we need to traverse through it to form the relationships.&amp;#160; Relationships in this aspect represent the nested nature of the XML schema.&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;p align="justify"&gt;Let us look at how we start reading an XML schema.&amp;#160; For that we have to understand a little about the different aspects of an XML schema.&amp;#160; A good introduction is given by the W3C schools &lt;a href="http://www.w3schools.com/Schema/" target="_blank"&gt;here&lt;/a&gt;.&amp;#160; Let me briefly go over the main types here as well just to have a reference to them:&lt;/p&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;div align="justify"&gt;Simple types&lt;/div&gt;&lt;ol&gt;&lt;li&gt;&lt;div align="justify"&gt;Elements&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;Attributes&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;Restrictions&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;&lt;div align="justify"&gt;Complex types&lt;/div&gt;&lt;ol&gt;&lt;li&gt;&lt;div align="justify"&gt;Elements&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;Empty&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;Elements only&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;Text only&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;Mixed&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;Indicators&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;&amp;lt;any&amp;gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;&amp;lt;anyAttribute&amp;gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;Substitution&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;&lt;div align="justify"&gt;Data types&lt;/div&gt;&lt;ol&gt;&lt;li&gt;&lt;div align="justify"&gt;…&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;p align="justify"&gt;I decided that each of the above types can be represented by data structures which I can understand to make things simpler.&amp;#160; You don’t have to do this, you can simply rely on the .NET representation of these schema types.&amp;#160; Let us look at how I chose to represent each of these structures.&amp;#160; Let me introduce a class diagram which we will analyse a bit later.&lt;/p&gt;&lt;br /&gt;&lt;p align="justify"&gt;&lt;a href="http://lh3.ggpht.com/_si6_UfT-_E0/SeQEFoS0v1I/AAAAAAAAAGI/EQjaiJTKSXo/s1600-h/image%5B3%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_si6_UfT-_E0/SeQEGX69YuI/AAAAAAAAAGM/Q3r-5NaGwZo/image_thumb%5B1%5D.png?imgmax=800" width="508" height="363" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;p align="justify"&gt;The above diagram shows three interfaces which help us make things much simpler and it also abstracts us away from the .NET representation the schema:&lt;/p&gt;&lt;ol&gt;&lt;br /&gt;  &lt;li&gt;&lt;div align="justify"&gt;&lt;em&gt;&lt;strong&gt;IAttribute&lt;br /&gt;&lt;/strong&gt;&lt;/em&gt;Any attribute like schema object will inherit from this interface.&amp;#160; Note that I said “attribute type”, as I also want simple types (both implicitly and explicitly declared) to be used as attributes.&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;&lt;div align="justify"&gt;&lt;strong&gt;&lt;em&gt;IElementComplex&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;Represents any complex type object within the schema.&amp;#160; This includes both, implicitly and explicitly declared types.&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;&lt;div align="justify"&gt;&lt;strong&gt;&lt;em&gt;IRelationship&lt;br /&gt;&lt;/em&gt;&lt;/strong&gt;Merely a wrapper around the complex element type which makes us easier to form relationships between them which we will use in our second pass.&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;p align="justify"&gt;&lt;em&gt;&lt;font color="#808080"&gt;Note that the above classes were developed a while ago while working on my Part IV engineering project (in 2005), only now have I realised that there is little to no help on how to read an XML schema, therefore I decided to publish this post.&amp;#160; By no means is this “the only” or “the best” way.&amp;#160; And also I am sure there are better ways of doing this.&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;&lt;p align="justify"&gt;Let me briefly give you an example of what implicitly and explicitly declared schema elements are with the XML schema below:&lt;/p&gt;&lt;pre class="xml" name="code"&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;&amp;lt;xs:schema id=&amp;quot;ImplicityExplicit&amp;quot; xmlns=&amp;quot;http://tempuri.org/ImplicityExplicit.xsd&amp;quot; xmlns:xs=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; xmlns:mstns=&amp;quot;http://tempuri.org/ImplicityExplicit.xsd&amp;quot; elementformdefault=&amp;quot;qualified&amp;quot; targetnamespace=&amp;quot;http://tempuri.org/ImplicityExplicit.xsd&amp;quot;&amp;gt;&lt;br /&gt;	&amp;lt;!--Explicit complex type--&amp;gt;&lt;br /&gt;	&amp;lt;xs:complextype name=&amp;quot;CTEntity&amp;quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;	&amp;lt;!--Implicit complex type--&amp;gt;&lt;br /&gt;	&amp;lt;xs:element name=&amp;quot;CTElemEntity&amp;quot;&amp;gt;&lt;br /&gt;		&amp;lt;xs:complextype&amp;gt;&amp;lt;/xs:complextype&amp;gt;&lt;br /&gt;	&amp;lt;/xs:element&amp;gt;&lt;br /&gt;&lt;br /&gt;	&amp;lt;!--Explicit simple type--&amp;gt;&lt;br /&gt;	&amp;lt;xs:simpletype name=&amp;quot;STEntity&amp;quot;&amp;gt;&lt;br /&gt;		&amp;lt;xs:restriction base=&amp;quot;xs:string&amp;quot; /&amp;gt;&lt;br /&gt;	&amp;lt;/xs:simpletype&amp;gt;&lt;br /&gt;&lt;br /&gt;	&amp;lt;!--Implicit simple type--&amp;gt;&lt;br /&gt;	&amp;lt;xs:element name=&amp;quot;STElemEntity&amp;quot;&amp;gt;&lt;br /&gt;		&amp;lt;xs:simpletype&amp;gt;&lt;br /&gt;			&amp;lt;xs:restriction base=&amp;quot;xs:string&amp;quot; /&amp;gt;&lt;br /&gt;		&amp;lt;/xs:simpletype&amp;gt;&lt;br /&gt;	&amp;lt;/xs:element&amp;gt;&lt;br /&gt;&lt;br /&gt;	&amp;lt;!--Implicit shy simple type--&amp;gt;&lt;br /&gt;	&amp;lt;xs:element name=&amp;quot;STElem&amp;quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;	&amp;lt;!--An attribute--&amp;gt;&lt;br /&gt;	&amp;lt;xs:attribute name=&amp;quot;attribute&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;/xs:schema&amp;gt;&lt;/pre&gt;&lt;p&gt;Now that we know the basic different types of XML schema elements let us look at how we can read/extract them.&amp;#160; For this we rely heavily on the .NET XML classes.&amp;#160; Reading the XML schema is quite simple, it is done using the following code:&lt;/p&gt;&lt;pre name="code" class="c-sharp"&gt;using System;&lt;br /&gt;using System.Xml;&lt;br /&gt;using System.Xml.Schema;&lt;br /&gt;&lt;br /&gt;namespace XmlLibrary&lt;br /&gt;{&lt;br /&gt;	public class SchemaReader&lt;br /&gt;	{&lt;br /&gt;		public String FileName { get; set; }&lt;br /&gt;		public XmlSchema Schema { get; set; }&lt;br /&gt;&lt;br /&gt;		private bool SchemaLoaded { get; set; }&lt;br /&gt;&lt;br /&gt;		public SchemaReader(string fileName)&lt;br /&gt;		{&lt;br /&gt;			FileName = fileName;&lt;br /&gt;			ReadSchema();&lt;br /&gt;		}&lt;br /&gt;&lt;br /&gt;		public void ExtractElements()&lt;br /&gt;		{&lt;br /&gt;			if (SchemaLoaded &amp;&amp; Schema != null)&lt;br /&gt;			{&lt;br /&gt;				XmlSchemaObjectCollection itemsColl = Schema.Items;&lt;br /&gt;				foreach (XmlSchemaObject item in itemsColl)&lt;br /&gt;				{&lt;br /&gt;					// TODO: Implementation&lt;br /&gt;				}&lt;br /&gt;			}&lt;br /&gt;		}&lt;br /&gt;&lt;br /&gt;		private void ReadSchema()&lt;br /&gt;		{&lt;br /&gt;			if (String.IsNullOrEmpty(FileName))&lt;br /&gt;			{&lt;br /&gt;				SchemaLoaded = false;&lt;br /&gt;				Schema = null;&lt;br /&gt;			}&lt;br /&gt;			else&lt;br /&gt;			{&lt;br /&gt;				try&lt;br /&gt;				{&lt;br /&gt;					Schema = XmlSchema.Read(new XmlTextReader(FileName), null);&lt;br /&gt;					SchemaLoaded = true;&lt;br /&gt;				}&lt;br /&gt;				catch (XmlException)&lt;br /&gt;				{&lt;br /&gt;					SchemaLoaded = false;&lt;br /&gt;					Schema = null;&lt;br /&gt;				}&lt;br /&gt;				catch (XmlSchemaException)&lt;br /&gt;				{&lt;br /&gt;					SchemaLoaded = false;&lt;br /&gt;					Schema = null;&lt;br /&gt;				}&lt;br /&gt;			}&lt;br /&gt;		}&lt;br /&gt;&lt;br /&gt;	}&lt;br /&gt;}&lt;/pre&gt;&lt;p align="justify"&gt;The important method in the above code is the “ReadSchema” call.&amp;#160; Note that it takes in a string as a parameter which points to the schema file on disk and then reads this in the populates the &lt;em&gt;System.Xml.Schema.XmlSchema&lt;/em&gt; object.&amp;#160; From this point forward we will only be concentrating on the ExtractElements method.&lt;/p&gt;&lt;br /&gt;&lt;p align="justify"&gt;Let us examine the ExtractElements method closely.&amp;#160; Currently it is stubbed out, although if you remember I mentioned that XML has a nested/recursive nature to it, therefore we expect to call a &lt;em&gt;distinctive&lt;/em&gt; method recursively.&amp;#160; Let us examine how we do it.&amp;#160; After fleshing out the method a bit further we have the following:&lt;/p&gt;&lt;pre class="c-sharp" name="code"&gt;public void ExtractElements()&lt;br /&gt;{&lt;br /&gt;	if (SchemaLoaded &amp;amp;&amp;amp; Schema != null)&lt;br /&gt;	{&lt;br /&gt;		XmlSchemaObjectCollection itemsColl = Schema.Items;&lt;br /&gt;		foreach (XmlSchemaObject item in itemsColl)&lt;br /&gt;		{&lt;br /&gt;			ManipulateSchemaObject(item);&lt;br /&gt;		}&lt;br /&gt;	}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private void ManipulateSchemaObject(XmlSchemaObject schemaObject)&lt;br /&gt;{&lt;br /&gt;	IndentLevel++;&lt;br /&gt;	if (schemaObject is XmlSchemaElement || schemaObject is  XmlSchemaComplexType || schemaObject is  XmlSchemaSimpleType)&lt;br /&gt;	{&lt;br /&gt;		#region XmlSchemaElement&lt;br /&gt;		if (schemaObject is XmlSchemaElement)&lt;br /&gt;		{&lt;br /&gt;			XmlSchemaElement schemaElement = schemaObject as XmlSchemaElement;&lt;br /&gt;			Console.WriteLine(String.Format(&amp;quot;{0}XmlSchemElement: {1} ({2})&amp;quot;, GetIndentationString(), schemaElement, schemaElement.Name));&lt;br /&gt;&lt;br /&gt;			ManipulateSchemaElement(schemaElement);&lt;br /&gt;		}&lt;br /&gt;		#endregion XmlSchemaElement&lt;br /&gt;		#region XmlSchemaComplexType&lt;br /&gt;		else if (schemaObject is  XmlSchemaComplexType)&lt;br /&gt;		{&lt;br /&gt;			XmlSchemaComplexType explicitComplexType = schemaObject as XmlSchemaComplexType;&lt;br /&gt;			Console.WriteLine(String.Format(&amp;quot;{0}XmlSchemaComplexType: {1} ({2})&amp;quot;, GetIndentationString(), explicitComplexType, explicitComplexType.Name));&lt;br /&gt;		}&lt;br /&gt;		#endregion XmlSchemaComplexType&lt;br /&gt;		#region XmlSchemaSimpleType&lt;br /&gt;		else if (schemaObject is XmlSchemaSimpleType)&lt;br /&gt;		{&lt;br /&gt;			XmlSchemaSimpleType explicitSimpleType = schemaObject as XmlSchemaSimpleType;&lt;br /&gt;			Console.WriteLine(String.Format(&amp;quot;{0}XmlSchemaSimpleType: {1} ({2})&amp;quot;, GetIndentationString(), explicitSimpleType, explicitSimpleType.Name));&lt;br /&gt;		}&lt;br /&gt;		#endregion XmlSchemaSimpleType&lt;br /&gt;	}&lt;br /&gt;	else&lt;br /&gt;	{&lt;br /&gt;		#region AttributeGroup&lt;br /&gt;		if (schemaObject is XmlSchemaAttributeGroup)&lt;br /&gt;		{&lt;br /&gt;			XmlSchemaAttributeGroup schemaAttGroup = schemaObject as XmlSchemaAttributeGroup;&lt;br /&gt;			Console.WriteLine(String.Format(&amp;quot;{0}XmlSchemaAttributeGroup: {1} ({2})&amp;quot;, GetIndentationString(), schemaAttGroup, schemaAttGroup.Name));&lt;br /&gt;		}&lt;br /&gt;		#endregion AttributeGroup&lt;br /&gt;		#region Attribute&lt;br /&gt;		else if (schemaObject is XmlSchemaAttribute)&lt;br /&gt;		{&lt;br /&gt;			XmlSchemaAttribute schemaAtt = schemaObject as XmlSchemaAttribute;&lt;br /&gt;			Console.WriteLine(String.Format(&amp;quot;{0}XmlSchemaAttribute: {1} ({2})&amp;quot;, GetIndentationString(), schemaAtt, schemaAtt.Name));&lt;br /&gt;		}&lt;br /&gt;		#endregion Attribute&lt;br /&gt;		#region Group&lt;br /&gt;		else if (schemaObject is XmlSchemaGroup)&lt;br /&gt;		{&lt;br /&gt;			XmlSchemaGroup schemaGroup = schemaObject as XmlSchemaGroup;&lt;br /&gt;			Console.WriteLine(String.Format(&amp;quot;{0}XmlSchemaGroup: {1} ({2})&amp;quot;, GetIndentationString(), schemaGroup, schemaGroup.Name));&lt;br /&gt;		}&lt;br /&gt;		#endregion Group&lt;br /&gt;		else&lt;br /&gt;		{&lt;br /&gt;			Console.WriteLine(GetIndentationString() + schemaObject + &amp;quot; is not handled yet&amp;quot;);&lt;br /&gt;		}&lt;br /&gt;	}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#region schema element&lt;br /&gt;private void ManipulateSchemaElement(XmlSchemaElement schemaElement)&lt;br /&gt;{&lt;br /&gt;	XmlSchemaType schemaElementSchemaType = schemaElement.SchemaType;&lt;br /&gt;&lt;br /&gt;	#region schema type defined&lt;br /&gt;	if (schemaElementSchemaType != null)&lt;br /&gt;	{&lt;br /&gt;		Type xmlSchemaTypeType = schemaElementSchemaType.GetType();&lt;br /&gt;		#region Complex type&lt;br /&gt;		if (schemaElementSchemaType is XmlSchemaComplexType)&lt;br /&gt;		{&lt;br /&gt;			ManipulateSchemaElementComplexType(schemaElement);&lt;br /&gt;		}&lt;br /&gt;		#endregion Complex type&lt;br /&gt;		#region Simple type&lt;br /&gt;		else if (schemaElementSchemaType is XmlSchemaSimpleType)&lt;br /&gt;		{&lt;br /&gt;			ManipulateSchemaElementSimpleType(schemaElement);&lt;br /&gt;		}&lt;br /&gt;		#endregion Simple type&lt;br /&gt;	}&lt;br /&gt;	#endregion schema type defined&lt;br /&gt;	#region Element with no schematype, thus simple&lt;br /&gt;	else&lt;br /&gt;	{&lt;br /&gt;		if (schemaElement.RefName.IsEmpty) // not a reference&lt;br /&gt;		{&lt;br /&gt;			Console.WriteLine(String.Format(&amp;quot;{0}Implicitly implicit simple type: {1}&amp;quot;, GetIndentationString(), schemaElement.Name));&lt;br /&gt;		}&lt;br /&gt;	}&lt;br /&gt;	#endregion&lt;br /&gt;}&lt;br /&gt;#endregion schema element&lt;br /&gt;&lt;br /&gt;#region simple type&lt;br /&gt;private void ManipulateSchemaElementSimpleType(XmlSchemaElement schemaElement)&lt;br /&gt;{&lt;br /&gt;	XmlSchemaSimpleType simpleElement = schemaElement.SchemaType as XmlSchemaSimpleType;&lt;br /&gt;	Console.WriteLine(GetIndentationString() + String.Format(&amp;quot;Simple type encountered: {0}&amp;quot;, schemaElement.Name));&lt;br /&gt;}&lt;br /&gt;#endregion simple type&lt;br /&gt;&lt;br /&gt;#region complex type&lt;br /&gt;private void ManipulateSchemaElementComplexType(XmlSchemaElement schemaElement)&lt;br /&gt;{			&lt;br /&gt;	XmlSchemaComplexType complexElement = schemaElement.SchemaType as XmlSchemaComplexType;&lt;br /&gt;&lt;br /&gt;	XmlSchemaObjectCollection attColl = complexElement.Attributes;&lt;br /&gt;	foreach (XmlSchemaObject attCollObj in attColl)&lt;br /&gt;		ManipulateSchemaObject(attCollObj);&lt;br /&gt;&lt;br /&gt;	if (complexElement.Particle != null)&lt;br /&gt;	{				&lt;br /&gt;		XmlSchemaParticle complexElementParicle = complexElement.Particle;&lt;br /&gt;		ParticleHandlingForElement(complexElementParicle);&lt;br /&gt;	}&lt;br /&gt;	else if (complexElement.ContentModel != null)&lt;br /&gt;	{&lt;br /&gt;		XmlSchemaContentModel complexElementContentModel = complexElement.ContentModel;&lt;br /&gt;		if (complexElementContentModel is XmlSchemaSimpleContent)&lt;br /&gt;		{&lt;br /&gt;			XmlSchemaSimpleContent contentModelSimpleType = complexElementContentModel as XmlSchemaSimpleContent;&lt;br /&gt;			XmlSchemaContent schemaContent = contentModelSimpleType.Content;&lt;br /&gt;			if (schemaContent is XmlSchemaSimpleContentExtension)&lt;br /&gt;			{&lt;br /&gt;				XmlSchemaSimpleContentExtension xmlSchemaExtension = schemaContent as XmlSchemaSimpleContentExtension;&lt;br /&gt;				XmlSchemaObjectCollection objColl = xmlSchemaExtension.Attributes;&lt;br /&gt;				foreach (XmlSchemaObject item in objColl)&lt;br /&gt;				{&lt;br /&gt;					ManipulateSchemaObject(item);&lt;br /&gt;				}&lt;br /&gt;			}&lt;br /&gt;		}&lt;br /&gt;		else&lt;br /&gt;		{&lt;br /&gt;			Console.WriteLine(GetIndentationString() + complexElementContentModel.ToString());&lt;br /&gt;			// Handle restrictions and extensions here (Complex or simple type)&lt;br /&gt;		}&lt;br /&gt;	}&lt;br /&gt;}&lt;br /&gt;#endregion complex type&lt;br /&gt;&lt;br /&gt;#region particle handling for element&lt;br /&gt;private void ParticleHandlingForElement(XmlSchemaParticle complexElementParicle)&lt;br /&gt;{&lt;br /&gt;	Type particleType = complexElementParicle.GetType();&lt;br /&gt;	if (complexElementParicle is XmlSchemaSequence)&lt;br /&gt;	{&lt;br /&gt;		XmlSchemaSequence particleAsSeq = complexElementParicle as XmlSchemaSequence;&lt;br /&gt;		ManipulateSchemaSequence(particleAsSeq);&lt;br /&gt;	}&lt;br /&gt;	else if (particleType.Equals(typeof(XmlSchemaChoice)))&lt;br /&gt;	{&lt;br /&gt;		XmlSchemaChoice complexChoice = complexElementParicle as XmlSchemaChoice;&lt;br /&gt;		ManipulateSchemaChoice(complexChoice);&lt;br /&gt;	}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#region choice&lt;br /&gt;private void ManipulateSchemaChoice(XmlSchemaChoice groupChoice)&lt;br /&gt;{&lt;br /&gt;	XmlSchemaObjectCollection objColl = groupChoice.Items;&lt;br /&gt;	foreach (XmlSchemaObject objCollObj in objColl)&lt;br /&gt;	{&lt;br /&gt;		XmlSchemaObject schemaObj = objCollObj;&lt;br /&gt;		if (schemaObj.GetType().Equals(typeof(XmlSchemaSequence)))&lt;br /&gt;		{&lt;br /&gt;			XmlSchemaSequence choiceSeq = schemaObj as XmlSchemaSequence;&lt;br /&gt;			ManipulateSchemaSequence(choiceSeq);&lt;br /&gt;		}&lt;br /&gt;		else if (schemaObj.GetType().Equals(typeof(XmlSchemaChoice)))&lt;br /&gt;		{&lt;br /&gt;			XmlSchemaChoice choiceChoice = schemaObj as XmlSchemaChoice;&lt;br /&gt;			ManipulateSchemaChoice(choiceChoice);&lt;br /&gt;		}&lt;br /&gt;		else&lt;br /&gt;			ManipulateSchemaObject(schemaObj);&lt;br /&gt;	}&lt;br /&gt;}&lt;br /&gt;#endregion choice&lt;br /&gt;&lt;br /&gt;#region Sequence&lt;br /&gt;private void ManipulateSchemaSequence(XmlSchemaSequence choiceSeq)&lt;br /&gt;{&lt;br /&gt;	XmlSchemaObjectCollection objColl = choiceSeq.Items;&lt;br /&gt;	foreach (XmlSchemaObject objCollObj in objColl)&lt;br /&gt;		ManipulateSchemaObject(objCollObj);&lt;br /&gt;}&lt;br /&gt;#endregion Sequence&lt;/pre&gt;&lt;p align="justify"&gt;There are quite a lot of methods in the above snippet, although they are quite straight forward and most of them recursively call our ExtractElements method.&amp;#160; Let us look at each of the methods which handle each different aspect of XML schema.&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;strong&gt;&lt;em&gt;ManipulateSchemaObject(XmlSchemaObject schemaObject)&lt;br /&gt;&lt;/em&gt;&lt;/strong&gt;Handles various schema objects, this is the recursive method call which is centre of our XML schema reader.&amp;#160; This method acts like a proxy which spreads out the flow depending on the type of the XML schema element.&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;strong&gt;&lt;em&gt;ManipulateSchemaElement(XmlSchemaElement schemaElement)&lt;br /&gt;&lt;/em&gt;&lt;/strong&gt;Handles various schema elements, Complex and Simple.&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;strong&gt;&lt;em&gt;ManipulateSchemaElementSimpleType(XmlSchemaElement schemaElement)&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;Handles the simple type.&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;strong&gt;&lt;em&gt;ManipulateSchemaElementComplexType(XmlSchemaElement schemaElement)&lt;br /&gt;&lt;/em&gt;&lt;/strong&gt;Handles the complex type.&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;strong&gt;&lt;em&gt;ParticleHandlingForElement(XmlSchemaParticle complexElementParicle)&lt;br /&gt;&lt;/em&gt;&lt;/strong&gt;Handles particles, which includes sequences and choice elements.&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p align="justify"&gt;We have looked at how to cleanly handle the XML schema and recursively traverse through its structure.&amp;#160; I’ll get back to this topic in a later post and show you how to I formed relationships between my custom schema based data structures using custom business objects.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282306487405633620-2663935246184634032?l=ruskin-dantra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruskin-dantra.blogspot.com/feeds/2663935246184634032/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/04/reading-xml-schemas.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/2663935246184634032'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/2663935246184634032'/><link rel='alternate' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/04/reading-xml-schemas.html' title='Reading XML Schemas'/><author><name>Ruskin Dantra</name><uri>http://www.blogger.com/profile/11120195758158923383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_si6_UfT-_E0/Sbi1FW8krII/AAAAAAAAACM/4UmHhJsr49U/S220/rus.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_si6_UfT-_E0/SeQEGX69YuI/AAAAAAAAAGM/Q3r-5NaGwZo/s72-c/image_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282306487405633620.post-6786758832000192846</id><published>2009-04-08T21:47:00.000+12:00</published><updated>2009-04-08T21:53:23.343+12:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cricket'/><title type='text'>Bhai Log Game 2 (07/04/09)</title><content type='html'>&lt;p align="justify"&gt;After a convincing win in &lt;a href="http://ruskin-dantra.blogspot.com/2009/04/bhai-log-game-1-310309.html" target="_blank"&gt;Game 1&lt;/a&gt; we could not have done any worse.&amp;#160; After a bismal fielding performance on field we continued along the downward spiral with our batting.&amp;#160; Some brilliant moments did occur but not enough to reward us the win.&amp;#160; The lost was brought upon by our own undoing.&amp;#160; Below are the graphs for the bowling, batting and all round performances of each team member.&amp;#160; Hoping to avenge our downfall in the next game.&amp;#160; You can also read more about the game &lt;a href="http://www.facebook.com/note.php?note_id=86230360790" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p align="justify"&gt;&lt;a href="http://lh3.ggpht.com/_si6_UfT-_E0/Sdxz7mHIgXI/AAAAAAAAAFo/aX1mSl1JwV8/s1600-h/image%5B4%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_si6_UfT-_E0/Sdxz8YFnteI/AAAAAAAAAFs/T4aEh2TXhKM/image_thumb%5B2%5D.png?imgmax=800" width="487" height="295" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="center"&gt;&amp;#160;&lt;a href="http://lh3.ggpht.com/_si6_UfT-_E0/Sdxz9S010oI/AAAAAAAAAFw/O3sz79t429E/s1600-h/image%5B8%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_si6_UfT-_E0/Sdxz-AqQuaI/AAAAAAAAAF0/uwCFpkELtiA/image_thumb%5B4%5D.png?imgmax=800" width="487" height="295" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://lh6.ggpht.com/_si6_UfT-_E0/Sdxz-7J6e_I/AAAAAAAAAF4/4Symyn9PQZo/s1600-h/image%5B12%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_si6_UfT-_E0/Sdxz_uqWx0I/AAAAAAAAAF8/ort8UqdUMXw/image_thumb%5B6%5D.png?imgmax=800" width="487" height="295" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282306487405633620-6786758832000192846?l=ruskin-dantra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruskin-dantra.blogspot.com/feeds/6786758832000192846/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/04/bhai-log-game-2-080409.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/6786758832000192846'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/6786758832000192846'/><link rel='alternate' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/04/bhai-log-game-2-080409.html' title='Bhai Log Game 2 (07/04/09)'/><author><name>Ruskin Dantra</name><uri>http://www.blogger.com/profile/11120195758158923383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_si6_UfT-_E0/Sbi1FW8krII/AAAAAAAAACM/4UmHhJsr49U/S220/rus.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_si6_UfT-_E0/Sdxz8YFnteI/AAAAAAAAAFs/T4aEh2TXhKM/s72-c/image_thumb%5B2%5D.png?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282306487405633620.post-6754781836094115848</id><published>2009-04-03T22:39:00.000+13:00</published><updated>2009-04-03T23:12:32.152+13:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>StackOverflowException aka “The Uncatchable”</title><content type='html'>&lt;p align="justify"&gt;Ever wrote a great little application just to find that at some odd moment calling into a third party DLL throws a nice little StackOverflowException.&amp;#160; Then you go start digging into your code only to find that your call to this third party DLL is surrounded by not only one but two to three try/catch/finally blocks at different levels.&amp;#160; Hmm…weird.&lt;/p&gt; &lt;p align="justify"&gt;The below code can quickly get this error for you and no matter if you surround it one or even 10 try/catch blocks, it will still throw the exception.&lt;/p&gt;  &lt;pre class="csharp" name="code"&gt;class Program&lt;br /&gt;{&lt;br /&gt;	static void Main(string[] args)&lt;br /&gt;	{&lt;br /&gt;		try&lt;br /&gt;		{&lt;br /&gt;			Recurse();&lt;br /&gt;&lt;br /&gt;			Console.WriteLine(&amp;quot;No exception thrown&amp;quot;);&lt;br /&gt;		}&lt;br /&gt;		catch (StackOverflowException e)&lt;br /&gt;		{&lt;br /&gt;			Console.WriteLine(&amp;quot;No exception caught&amp;quot;);&lt;br /&gt;		}&lt;br /&gt;	}&lt;br /&gt;&lt;br /&gt;	private static void Recurse()&lt;br /&gt;	{&lt;br /&gt;		Recurse();&lt;br /&gt;	}&lt;br /&gt;}&lt;/pre&gt;&lt;p align="justify"&gt;&lt;a href="http://lh6.ggpht.com/_si6_UfT-_E0/SdXglRaLWoI/AAAAAAAAAFg/0dHLVePMZw4/s1600-h/image%5B5%5D.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="240" alt="image" src="http://lh4.ggpht.com/_si6_UfT-_E0/SdXgmYbN9mI/AAAAAAAAAFk/00UM8KKCSug/image_thumb%5B3%5D.png?imgmax=800" width="443" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p align="justify"&gt;&lt;strong&gt;Does the catch block not catch StackOverflowException? &lt;br /&gt;    &lt;br /&gt;&lt;/strong&gt;The answer is simple…only after you think about it for a little while.&amp;#160; No! The StackOverflowException cannot be caught by the .NET runtime because simply…according to Microsoft .NET it is bad coding practice.&lt;/p&gt;&lt;br /&gt;&lt;p align="justify"&gt;Below is extracted from &lt;a href="http://msdn.microsoft.com/en-us/library/system.stackoverflowexception.aspx"&gt;http://msdn.microsoft.com/en-us/library/system.stackoverflowexception.aspx&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;&lt;table cellspacing="0" cellpadding="2" width="716" border="1"&gt;&lt;tbody&gt;&lt;br /&gt;    &lt;tr&gt;&lt;br /&gt;      &lt;td valign="top" width="714"&gt;&lt;br /&gt;        &lt;h5&gt;Version Considerations&lt;/h5&gt;&lt;br /&gt;        &lt;p&gt;In prior versions of the .NET Framework, your application could catch a StackOverflowException object (for example, to recover from unbounded recursion). However, that practice is currently discouraged because significant additional code is required to reliably catch a stack overflow exception and continue program execution.&lt;/p&gt;&lt;br /&gt;        &lt;p align="justify"&gt;Starting with the .NET Framework version 2.0, a StackOverflowException object cannot be caught by a try-catch block and the corresponding process is terminated by default. Consequently, users are advised to write their code to detect and prevent a stack overflow. For example, if your application depends on recursion, use a counter or a state condition to terminate the recursive loop. Note that an application that hosts the common language runtime (CLR) can specify that the CLR unload the application domain where the stack overflow exception occurs and let the corresponding process continue. For more information, see&lt;a href="http://msdn.microsoft.com/en-us/library/ms164394.aspx"&gt;ICLRPolicyManager Interface&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/9x0wh2z3.aspx"&gt;Hosting the Common Language Runtime&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;      &lt;/td&gt;&lt;br /&gt;    &lt;/tr&gt;&lt;br /&gt;  &lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;p&gt;I found two great articles on how to handle the StackOverflow exception:&lt;/p&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;  &lt;li&gt;&lt;a href="http://stackoverflow.com/questions/206820/how-do-i-prevent-and-or-handle-a-stackoverflowexception-c"&gt;http://stackoverflow.com/questions/206820/how-do-i-prevent-and-or-handle-a-stackoverflowexception-c&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;&lt;a href="http://cid-ac849ad87e27e83d.skydrive.live.com/self.aspx/.Public/AppDomains.pdf" target="_blank"&gt;AppDomains.pdf&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282306487405633620-6754781836094115848?l=ruskin-dantra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruskin-dantra.blogspot.com/feeds/6754781836094115848/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/04/stackoverflowexception-aka-uncatchable.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/6754781836094115848'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/6754781836094115848'/><link rel='alternate' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/04/stackoverflowexception-aka-uncatchable.html' title='StackOverflowException aka “The Uncatchable”'/><author><name>Ruskin Dantra</name><uri>http://www.blogger.com/profile/11120195758158923383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_si6_UfT-_E0/Sbi1FW8krII/AAAAAAAAACM/4UmHhJsr49U/S220/rus.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_si6_UfT-_E0/SdXgmYbN9mI/AAAAAAAAAFk/00UM8KKCSug/s72-c/image_thumb%5B3%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282306487405633620.post-1838708215512893401</id><published>2009-04-01T20:32:00.000+13:00</published><updated>2009-04-01T20:37:46.416+13:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cricket'/><title type='text'>Bhai Log Game 1 (31/03/09)</title><content type='html'>&lt;p align="justify"&gt;Our first graded game was played last night.&amp;#160; For a change everyone turned up with Shadow aka Rainbow aka Neil making his indoor debut.&amp;#160; Read more about it &lt;a href="http://www.facebook.com/home.php#/note.php?note_id=83069540790" target="_blank"&gt;here&lt;/a&gt;.&amp;#160; Here are the stats graphs for the game.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_si6_UfT-_E0/SdMZrsnc1LI/AAAAAAAAAFA/pkWW06eyY6k/s1600-h/image%5B3%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_si6_UfT-_E0/SdMZsjdX2vI/AAAAAAAAAFE/Hj1PGnHNEX0/image_thumb%5B1%5D.png?imgmax=800" width="487" height="295" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://lh6.ggpht.com/_si6_UfT-_E0/SdMZtarxCgI/AAAAAAAAAFI/sbXlrwyjGeo/s1600-h/image%5B7%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_si6_UfT-_E0/SdMZubFISJI/AAAAAAAAAFM/_uiK4KZmOoA/image_thumb%5B3%5D.png?imgmax=800" width="488" height="309" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://lh6.ggpht.com/_si6_UfT-_E0/SdMZvY5BBEI/AAAAAAAAAFQ/Haned5Qpmnw/s1600-h/image%5B11%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_si6_UfT-_E0/SdMZwuDvJ2I/AAAAAAAAAFU/rjQbGPcluwc/image_thumb%5B5%5D.png?imgmax=800" width="487" height="424" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_si6_UfT-_E0/SdMZxe-ZsmI/AAAAAAAAAFY/tL2O0OftbT8/s1600-h/image%5B15%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_si6_UfT-_E0/SdMZyOCeDaI/AAAAAAAAAFc/UMLahH7eupU/image_thumb%5B7%5D.png?imgmax=800" width="487" height="295" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282306487405633620-1838708215512893401?l=ruskin-dantra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruskin-dantra.blogspot.com/feeds/1838708215512893401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/04/bhai-log-game-1-310309.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/1838708215512893401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/1838708215512893401'/><link rel='alternate' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/04/bhai-log-game-1-310309.html' title='Bhai Log Game 1 (31/03/09)'/><author><name>Ruskin Dantra</name><uri>http://www.blogger.com/profile/11120195758158923383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_si6_UfT-_E0/Sbi1FW8krII/AAAAAAAAACM/4UmHhJsr49U/S220/rus.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_si6_UfT-_E0/SdMZsjdX2vI/AAAAAAAAAFE/Hj1PGnHNEX0/s72-c/image_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282306487405633620.post-5735038575395175343</id><published>2009-03-31T08:56:00.000+13:00</published><updated>2009-04-02T12:29:52.044+13:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>INotifyPropertyChanged made easier using PostSharp</title><content type='html'>&lt;p align="justify"&gt; How many times have you written a C# business class like the one below only to realise that if you want the UI to react to changes you need to implement this cumbersome &lt;em&gt;INotifyPropertyChanged&lt;/em&gt; interface.&lt;/p&gt; &lt;p align="justify"&gt; So the above class will provide no change notification, you’ll have to implement the interface after which your code will look something like this (Note that this is .NET 2.0 syntax):&lt;/p&gt;  &lt;pre class="csharp" name="code"&gt;public class Customer : System.ComponentModel.INotifyPropertyChanged &lt;br /&gt;{&lt;br /&gt;	private String _Name; &lt;br /&gt;	private DateTime _DOB;&lt;br /&gt;&lt;br /&gt;	public String Name &lt;br /&gt;	{ &lt;br /&gt;		get &lt;br /&gt;		{&lt;br /&gt;			return _Name;&lt;br /&gt;		}&lt;br /&gt;		set &lt;br /&gt;		{ &lt;br /&gt;			_Name = value; &lt;br /&gt;			OnPropertyChanged(&amp;quot;Name&amp;quot;);&lt;br /&gt;		} &lt;br /&gt;	} &lt;br /&gt;&lt;br /&gt;	public DateTime DOB &lt;br /&gt;	{ &lt;br /&gt;		get &lt;br /&gt;		{ &lt;br /&gt;			return _DOB; &lt;br /&gt;		} &lt;br /&gt;		set &lt;br /&gt;		{ &lt;br /&gt;			_DOB = value; &lt;br /&gt;			OnPropertyChanged(&amp;quot;DOB&amp;quot;); &lt;br /&gt;		} &lt;br /&gt;	} &lt;br /&gt;	&lt;br /&gt;	#region INotifyPropertyChanged Members &lt;br /&gt;&lt;br /&gt;	public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; &lt;br /&gt;&lt;br /&gt;	protected void OnPropertyChanged(String propertyName) &lt;br /&gt;	{ &lt;br /&gt;		if (PropertyChanged != null) &lt;br /&gt;		{ &lt;br /&gt;			PropertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); &lt;br /&gt;		} &lt;br /&gt;	} &lt;br /&gt;&lt;br /&gt;	#endregion &lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;p align="justify"&gt;That class already looks extremely overloaded and ugly…now imagine if you are able to use .NET 3 or 3.5 and you want to utilise it’s extremely cool feature of auto-implemented properties (e.g. &lt;span style="color: blue"&gt;public int &lt;/span&gt;Age { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; }). Guess what…you can’t!!!! Because where would you put your calls to &lt;em&gt;OnPropertyChanged(…)&lt;/em&gt;? &lt;/p&gt;&lt;p align="justify"&gt;This is where &lt;a href="http://www.postsharp.org/" target="_blank"&gt;PostSharp&lt;/a&gt; saves you. &lt;/p&gt;&lt;p align="justify"&gt;The above class, with auto-implemented properties and the &lt;em&gt;INotifyPropertyChanged&lt;/em&gt; interface. &lt;/p&gt;&lt;pre class="csharp" name="code"&gt;public class Customer : System.ComponentModel.INotifyPropertyChanged &lt;br /&gt;{ &lt;br /&gt;	[Notify] &lt;br /&gt;	public String Name { get; set; } &lt;br /&gt;&lt;br /&gt;	[Notify] &lt;br /&gt;	public DateTime DOB { get; set; } &lt;br /&gt;&lt;br /&gt;	#region INotifyPropertyChanged Members &lt;br /&gt;	&lt;br /&gt;	public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; &lt;br /&gt;&lt;br /&gt;	protected void OnPropertyChanged(String propertyName) &lt;br /&gt;	{ &lt;br /&gt;		if (PropertyChanged != null) &lt;br /&gt;		{ &lt;br /&gt;			PropertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); &lt;br /&gt;		} &lt;br /&gt;	} &lt;br /&gt;&lt;br /&gt;	#endregion &lt;br /&gt;}&lt;/pre&gt;&lt;p align="justify"&gt;That’s cool…from ~50 lines of code to ~25 lines of code. You’ll be wondering, how will the &lt;em&gt;PropertyChanged&lt;/em&gt; event fire now? The answer is within the &lt;em&gt;[Notify]&lt;/em&gt; attribute. This attribute is a special attribute which inherits from the PostSharp class &lt;em&gt;OnMethodBoundaryAspect&lt;/em&gt;. For this you’ll have to add references to the PostSharp DLLs. &lt;/p&gt;&lt;br /&gt;&lt;p align="justify"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-right-width: 0px" height="60" alt="image" src="http://lh3.ggpht.com/_si6_UfT-_E0/SdE8-wsut3I/AAAAAAAAAEs/bHL4DOXyBA0/image_thumb.png?imgmax=800" /&gt;&amp;#160; &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="justify"&gt;The implementation is shown below: &lt;/p&gt;&lt;pre class="csharp" name="code"&gt;[Serializable]&lt;br /&gt;[global::System.AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = false)]&lt;br /&gt;public sealed class NotifyAttribute : OnMethodBoundaryAspect&lt;br /&gt;{&lt;br /&gt;	public override void OnExit(MethodExecutionEventArgs eventArgs)&lt;br /&gt;	{&lt;br /&gt;		if (eventArgs == null)&lt;br /&gt;			return;&lt;br /&gt;&lt;br /&gt;		//Why are property sets not properties? they are methods?&lt;br /&gt;		if ((eventArgs.Method.MemberType &amp;amp; System.Reflection.MemberTypes.Method) == System.Reflection.MemberTypes.Method &amp;amp;&amp;amp; eventArgs.Method.Name.StartsWith(&amp;quot;set_&amp;quot;))&lt;br /&gt;		{&lt;br /&gt;			Type theType = eventArgs.Method.ReflectedType;&lt;br /&gt;			string propertyName = eventArgs.Method.Name.Substring(4);&lt;br /&gt;&lt;br /&gt;			// get the field storing the delegate list that are stored by the event.&lt;br /&gt;			FieldInfo[] fields = theType.GetFields(BindingFlags.Instance | BindingFlags.NonPublic);&lt;br /&gt;			FieldInfo field = null;&lt;br /&gt;			foreach (FieldInfo f in fields)&lt;br /&gt;			{&lt;br /&gt;				if (f.FieldType == typeof(PropertyChangedEventHandler))&lt;br /&gt;				{&lt;br /&gt;					field = f;&lt;br /&gt;					break;&lt;br /&gt;				}&lt;br /&gt;			}&lt;br /&gt;&lt;br /&gt;			if (field != null)&lt;br /&gt;			{&lt;br /&gt;				// get the value of the field&lt;br /&gt;				PropertyChangedEventHandler evHandler = field.GetValue(eventArgs.Instance)as PropertyChangedEventHandler;&lt;br /&gt;&lt;br /&gt;				// invoke the delegate if it's not null (aka empty)&lt;br /&gt;				if (evHandler != null)&lt;br /&gt;				{&lt;br /&gt;					evHandler.Invoke(eventArgs.Instance, new PropertyChangedEventArgs(propertyName));&lt;br /&gt;				}&lt;br /&gt;			}&lt;br /&gt;		}&lt;br /&gt;	}&lt;br /&gt;}&lt;/pre&gt;&lt;p align="justify"&gt;This works perfectly, on every method “exit” the above &lt;em&gt;OnExit(…)&lt;/em&gt; method will fire and invoke the PropertyChangedEventHandler for that particular property with it’s property name.&lt;/p&gt;&lt;br /&gt;&lt;p align="justify"&gt;Neat isn’t it? Let us run some tests against it to make sure that it is actually happening. For this we revert to &lt;a href="http://www.nunit.org/index.php" target="_blank"&gt;NUnit&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;&lt;pre class="csharp" name="code"&gt;[TestFixture]&lt;br /&gt;public class CustomerTest&lt;br /&gt;{&lt;br /&gt;	private Customer _customer;&lt;br /&gt;	private String _propertyChanged;&lt;br /&gt;&lt;br /&gt;	[SetUp]&lt;br /&gt;	protected void Setup()&lt;br /&gt;	{&lt;br /&gt;		_customer = new Customer();&lt;br /&gt;		_customer.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(Customer_PropertyChanged);&lt;br /&gt;	}&lt;br /&gt;&lt;br /&gt;	[TearDown]&lt;br /&gt;	protected void TearDown()&lt;br /&gt;	{&lt;br /&gt;		_propertyChanged = String.Empty;&lt;br /&gt;	}&lt;br /&gt;&lt;br /&gt;	void Customer_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)&lt;br /&gt;	{&lt;br /&gt;		_propertyChanged = e.PropertyName;&lt;br /&gt;	}&lt;br /&gt;&lt;br /&gt;	[Test]&lt;br /&gt;	public void TestNotifyName()&lt;br /&gt;	{&lt;br /&gt;		_customer.Name = &amp;quot;Ruskin&amp;quot;;&lt;br /&gt;		Assert.AreEqual(&amp;quot;Name&amp;quot;, _propertyChanged);&lt;br /&gt;	}&lt;br /&gt;&lt;br /&gt;	[Test]&lt;br /&gt;	public void TestNotifyDOB()&lt;br /&gt;	{&lt;br /&gt;		_customer.DOB = DateTime.Now;&lt;br /&gt;		Assert.AreEqual(&amp;quot;DOB&amp;quot;, _propertyChanged);&lt;br /&gt;	}&lt;br /&gt;}&lt;/pre&gt;&lt;p align="justify"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-right-width: 0px" height="347" alt="image" src="http://lh6.ggpht.com/_si6_UfT-_E0/SdE9B_YZOnI/AAAAAAAAAE0/VeMg6Ki7eHQ/image_thumb%5B9%5D.png?imgmax=800" /&gt;&amp;#160; &lt;br /&gt;You can go one step further…ever had calculated properties in your business classes, for e.g. if you have a property for “Age” which gets calculated depending on the DOB, therefore, if DOB changes, Age changes. In our current implementation we can only mark properties to fire PropertyChanged events for themselves, but we can’t make them trigger events for other properties. This can be easily solved by adding another standard .NET attribute shown below:&lt;/p&gt;&lt;pre class="csharp" name="code"&gt;[Serializable] &lt;br /&gt;[global::System.AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = false)] &lt;br /&gt;public sealed class NotifyChildrenAttribute : Attribute &lt;br /&gt;{ &lt;br /&gt;	public NotifyChildrenAttribute(params string[] dependents) &lt;br /&gt;	{&lt;br /&gt;		Dependents = dependents; &lt;br /&gt;	} &lt;br /&gt;&lt;br /&gt;	public NotifyChildrenAttribute() { } &lt;br /&gt;&lt;br /&gt;	public string[] Dependents { get; set; } &lt;br /&gt;}&lt;/pre&gt;&lt;p align="justify"&gt;Now we add an “Age” property to our Customer class and let us look at the changed version:&amp;#160;&lt;/p&gt;&lt;pre class="csharp" name="code"&gt;public class Customer : System.ComponentModel.INotifyPropertyChanged&lt;br /&gt;{&lt;br /&gt;	[Notify] &lt;br /&gt;	public String Name { get; set; } &lt;br /&gt;&lt;br /&gt;	[Notify] &lt;br /&gt;	[NotifyChildren(&amp;quot;Age&amp;quot;)] &lt;br /&gt;	public DateTime DOB { get; set; } &lt;br /&gt;	&lt;br /&gt;	public int Age { get { return DateTime.Now.Year - DOB.Year; } } &lt;br /&gt;&lt;br /&gt;	#region INotifyPropertyChanged Members &lt;br /&gt;&lt;br /&gt;	public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; &lt;br /&gt;&lt;br /&gt;	protected void OnPropertyChanged(String propertyName) &lt;br /&gt;	{ &lt;br /&gt;		if (PropertyChanged != null) &lt;br /&gt;		{ &lt;br /&gt;			PropertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); &lt;br /&gt;		} &lt;br /&gt;	}&lt;br /&gt;&lt;br /&gt;	#endregion &lt;br /&gt;}&lt;/pre&gt;&lt;p align="justify"&gt;As we can see, we have marked our DOB property to fire a PropertyChanged event not only for itself but also for the Age property. We still need to modify our implementation of the OnExit(…) method slightly to cater for this new attribute. Our implementation will look as follows: &lt;/p&gt;&lt;pre class="csharp" name="code"&gt;[Serializable]&lt;br /&gt;[global::System.AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = false)]&lt;br /&gt;public sealed class NotifyAttribute : OnMethodBoundaryAspect&lt;br /&gt;{&lt;br /&gt;	public override void OnExit(MethodExecutionEventArgs eventArgs)&lt;br /&gt;	{&lt;br /&gt;		if (eventArgs == null)&lt;br /&gt;			return;&lt;br /&gt;&lt;br /&gt;		//Why are property sets not properties? they are methods?&lt;br /&gt;		if ((eventArgs.Method.MemberType &amp;amp; System.Reflection.MemberTypes.Method) == System.Reflection.MemberTypes.Method &amp;amp;&amp;amp; eventArgs.Method.Name.StartsWith(&amp;quot;set_&amp;quot;))&lt;br /&gt;		{&lt;br /&gt;			Type theType = eventArgs.Method.ReflectedType;&lt;br /&gt;			string propertyName = eventArgs.Method.Name.Substring(4);&lt;br /&gt;&lt;br /&gt;			List&amp;lt;string&amp;gt; allPropertiesThatNeedNotification = new List&amp;lt;string&amp;gt;();&lt;br /&gt;			if (!String.IsNullOrEmpty(propertyName))&lt;br /&gt;			{&lt;br /&gt;				PropertyInfo pInfo = theType.GetProperty(propertyName);&lt;br /&gt;				if (pInfo != null)&lt;br /&gt;				{&lt;br /&gt;					// get all the properties which may be affected&lt;br /&gt;					object[] notifyChildren = pInfo.GetCustomAttributes(typeof(NotifyChildrenAttribute), false);&lt;br /&gt;					foreach (var item in notifyChildren)&lt;br /&gt;					{&lt;br /&gt;						if (item is NotifyChildrenAttribute)&lt;br /&gt;						{&lt;br /&gt;							NotifyChildrenAttribute att = item as NotifyChildrenAttribute;&lt;br /&gt;							allPropertiesThatNeedNotification.AddRange(att.Dependents);&lt;br /&gt;						}&lt;br /&gt;					}&lt;br /&gt;				}&lt;br /&gt;				allPropertiesThatNeedNotification.Add(propertyName);&lt;br /&gt;			}&lt;br /&gt;&lt;br /&gt;			// get the field storing the delegate list that are stored by the event.&lt;br /&gt;			FieldInfo[] fields = theType.GetFields(BindingFlags.Instance | BindingFlags.NonPublic);&lt;br /&gt;			FieldInfo field = null;&lt;br /&gt;			foreach (FieldInfo f in fields)&lt;br /&gt;			{&lt;br /&gt;				if (f.FieldType == typeof(PropertyChangedEventHandler))&lt;br /&gt;				{&lt;br /&gt;					field = f;&lt;br /&gt;					break;&lt;br /&gt;				}&lt;br /&gt;			}&lt;br /&gt;&lt;br /&gt;			if (field != null)&lt;br /&gt;			{&lt;br /&gt;				// get the value of the field&lt;br /&gt;				PropertyChangedEventHandler evHandler = field.GetValue(eventArgs.Instance) as PropertyChangedEventHandler;&lt;br /&gt;			&lt;br /&gt;				// invoke the delegate if it's not null (aka empty)&lt;br /&gt;				if (evHandler != null)&lt;br /&gt;				{&lt;br /&gt;					foreach (var item in allPropertiesThatNeedNotification)&lt;br /&gt;					{&lt;br /&gt;						evHandler.Invoke(eventArgs.Instance, new PropertyChangedEventArgs(item));&lt;br /&gt;					}&lt;br /&gt;				}&lt;br /&gt;			}&lt;br /&gt;		}&lt;br /&gt;	}&lt;br /&gt;}&lt;/pre&gt;&lt;p align="justify"&gt;Updating the tests…note that our previously defined tests won’t work now because for every singular property changed there may be a series of PropertyChanged events, we need some kind of collection which we need to test against. This testing is a little bit primitive but this is only for demonstration purposes. &lt;/p&gt;&lt;pre class="csharp" name="code"&gt;[TestFixture]&lt;br /&gt;public class CustomerTest&lt;br /&gt;{&lt;br /&gt;	private Customer _customer; &lt;br /&gt;	private List&amp;lt;String&amp;gt; _propertiesChanged; &lt;br /&gt;&lt;br /&gt;	[SetUp] &lt;br /&gt;	protected void Setup() &lt;br /&gt;	{&lt;br /&gt;		_customer = new Customer(); &lt;br /&gt;		_customer.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(Customer_PropertyChanged); &lt;br /&gt;	}&lt;br /&gt;&lt;br /&gt;	[TearDown] &lt;br /&gt;	protected void TearDown() &lt;br /&gt;	{ &lt;br /&gt;		_propertiesChanged = new List&amp;lt;string&amp;gt;(); &lt;br /&gt;	} &lt;br /&gt;&lt;br /&gt;	void Customer_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) &lt;br /&gt;	{&lt;br /&gt;		Assert.IsTrue(_propertiesChanged.Contains(e.PropertyName), String.Format(&amp;quot;Property {0} is not contained within the list&amp;quot;, e.PropertyName)); &lt;br /&gt;	}&lt;br /&gt;&lt;br /&gt;	[Test] &lt;br /&gt;	public void TestNotifyName() &lt;br /&gt;	{ &lt;br /&gt;		_propertiesChanged.Add(&amp;quot;Name&amp;quot;); &lt;br /&gt;		_customer.Name = &amp;quot;Ruskin&amp;quot;; &lt;br /&gt;	} &lt;br /&gt;&lt;br /&gt;	[Test]&lt;br /&gt;	public void TestNotifyDOB() &lt;br /&gt;	{ &lt;br /&gt;		_propertiesChanged.Add(&amp;quot;DOB&amp;quot;); &lt;br /&gt;		_propertiesChanged.Add(&amp;quot;Age&amp;quot;); &lt;br /&gt;		_customer.DOB = DateTime.Now; &lt;br /&gt;	} &lt;br /&gt;}&lt;/pre&gt;&lt;p align="justify"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-right-width: 0px" height="362" alt="image" src="http://lh5.ggpht.com/_si6_UfT-_E0/SdE9ENp7rBI/AAAAAAAAAE8/nIQ5OyEoXWU/image_thumb%5B12%5D.png?imgmax=800" /&gt;&amp;#160; &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Downloads: &lt;a href="http://www.postsharp.org/" target="_blank"&gt;PostSharp&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282306487405633620-5735038575395175343?l=ruskin-dantra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruskin-dantra.blogspot.com/feeds/5735038575395175343/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/03/inotifypropertychanged-made-easier.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/5735038575395175343'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/5735038575395175343'/><link rel='alternate' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/03/inotifypropertychanged-made-easier.html' title='INotifyPropertyChanged made easier using PostSharp'/><author><name>Ruskin Dantra</name><uri>http://www.blogger.com/profile/11120195758158923383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_si6_UfT-_E0/Sbi1FW8krII/AAAAAAAAACM/4UmHhJsr49U/S220/rus.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_si6_UfT-_E0/SdE8-wsut3I/AAAAAAAAAEs/bHL4DOXyBA0/s72-c/image_thumb.png?imgmax=800' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282306487405633620.post-9136228436131766336</id><published>2009-03-30T14:30:00.001+13:00</published><updated>2009-03-30T14:40:28.094+13:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='InstallShield'/><title type='text'>Common InstallShield functions and their Usage</title><content type='html'>&lt;p&gt;&lt;strong&gt;Getting a property string&lt;/strong&gt;&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;div id="codeSnippet"    style="padding-right: 0px; padding-left: 0px;  padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px;  border-right-style: none; border-left-style: none; background- text-align: left; border-bottom-style: nonefont-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;     &lt;pre    style="padding-right: 0px; padding-left: 0px;  padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px;  border-right-style: none; border-left-style: none; background- text-align: left; border-bottom-style: nonefont-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum1"  style="color:#606060;"&gt;   &lt;/span&gt;&lt;span id="lnum1"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;1:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; NUMBER nvBufferLen;&lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum2"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;   2:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; STRING svInstallDir;&lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum3"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;   3:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; MsiGetProperty(hMSI, &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;"INSTALLDIR"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;, svInstallDir, nvBufferLen);&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Where:&lt;br /&gt;hMSI = handle of the MSI (gets automatically passed into functions)&lt;br /&gt;INSTALLDIR = The name of the property to get&lt;br /&gt;svInstallDir = The variable in which to store the returned property value&lt;br /&gt;nvBufferLen = The length of the buffer, often set to 255.&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;&lt;strong&gt;Setting a property string&lt;/strong&gt; &lt;/p&gt;&lt;div id="codeSnippet"  style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; overflow: visible; width: 100%;  direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: nonecolor:#f4f4f4;"&gt;  &lt;pre   style="padding-right: 0px; padding-left: 0px;  padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%;  direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: nonefont-size:8pt;color:black;"&gt;&lt;span id="lnum1"  style="color:#606060;"&gt;   &lt;/span&gt;&lt;span id="lnum1"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;1:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; MsiSetProperty(hMSI, &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;"INSTALLDIR"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;, &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;"C:\Program Files\InstallationDirectory"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;);&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 0, 0);"&gt;Where:&lt;br /&gt;hMSI = handle of the MSI (gets automatically passed into functions)&lt;br /&gt;INSTALLDIR = The name of the property to set&lt;br /&gt;Value = The value of the property to set to&lt;/span&gt;&lt;br /&gt;&lt;hr /&gt;&lt;p&gt;&lt;strong&gt;Converting a number to string and vice versa&lt;/strong&gt;&lt;/p&gt;&lt;div id="codeSnippetWrapper"&gt;&lt;div id="codeSnippet"    style="padding-right: 0px; padding-left: 0px;  padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px;  border-right-style: none; border-left-style: none; background- text-align: left; border-bottom-style: nonefont-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px;  padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px;  border-right-style: none; border-left-style: none; background- text-align: left; border-bottom-style: nonefont-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum1"  style="color:#606060;"&gt;  &lt;/span&gt;&lt;span id="lnum1"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; 1:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; number nTemp;&lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum2"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;   2:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; svTemp; &lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum3"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;   3:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; nTemp = 25;&lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum4"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;   4:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  &lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum5"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;   5:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; NumToStr(svTemp, nTemp); &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;// 25 -&amp;gt; "25" &lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum6"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span id="lnum6"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;6:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; StrToNum(nTemp, svTemp); &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;// "25" -&amp;gt; 25&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;hr /&gt;&lt;p&gt;&lt;strong&gt;String comparison&lt;/strong&gt;&lt;/p&gt;&lt;div id="codeSnippetWrapper"&gt;&lt;div id="codeSnippet"    style="padding-right: 0px; padding-left: 0px;  padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px;  border-right-style: none; border-left-style: none; background- text-align: left; border-bottom-style: nonefont-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px;  padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px;  border-right-style: none; border-left-style: none; background- text-align: left; border-bottom-style: nonefont-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum1"  style="color:#606060;"&gt;   &lt;/span&gt;&lt;span id="lnum1"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;1:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; (StrCompare(&lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;"String A"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;, &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;"String B"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;) == 0) then&lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum2"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;   2:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;     &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;// do something here&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum3"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;   3:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; endif;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;hr /&gt;&lt;p&gt;&lt;strong&gt;String concatenation&lt;/strong&gt;&lt;/p&gt;&lt;div id="codeSnippetWrapper"&gt;&lt;div id="codeSnippet"    style="padding-right: 0px; padding-left: 0px;  padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px;  border-right-style: none; border-left-style: none; background- text-align: left; border-bottom-style: nonefont-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px;  padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px;  border-right-style: none; border-left-style: none; background- text-align: left; border-bottom-style: nonefont-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum1"  style="color:#606060;"&gt;   &lt;/span&gt;&lt;span id="lnum1"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;1:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; STRING svTemp;&lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum2"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;   2:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; Sprintf(svTemp,  &lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum3"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;   3:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;     &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;"A string taking two parameters %s %s"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;,&lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum4"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;   4:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;     &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;"Parameter 1"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;, &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;"Parameter 2"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;);&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;hr /&gt;&lt;p&gt;&lt;strong&gt;String Trim(…) &lt;/strong&gt;(Extracted from &lt;a href="http://community.installshield.com/showthread.php?t=24423"&gt;http://community.installshield.com/showthread.php?t=24423&lt;/a&gt;)&lt;/p&gt;&lt;div id="codeSnippetWrapper"&gt;&lt;div id="codeSnippet"    style="padding-right: 0px; padding-left: 0px;  padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px;  border-right-style: none; border-left-style: none; background- text-align: left; border-bottom-style: nonefont-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px;  padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px;  border-right-style: none; border-left-style: none; background- text-align: left; border-bottom-style: nonefont-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum1"  style="color:#606060;"&gt;   &lt;/span&gt;&lt;span id="lnum1"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;1:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; function Trim(aString)   &lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum2"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;   2:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;     BOOL done;    &lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum3"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;   3:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;     NUMBER startIndex;   &lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum4"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;   4:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;     NUMBER endIndex;    &lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum5"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;   5:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;     NUMBER aByte;&lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum6"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;   6:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; begin    &lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum7"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;   7:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;     startIndex = 0;  &lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum8"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;   8:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;     endIndex = StrLength( aString ) - 1;&lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum9"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;   9:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;     done = ( startIndex &amp;gt; endIndex );&lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum10"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  10:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;     &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;while&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; ( !done )&lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum11"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  11:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;         GetByte( aByte, aString, startIndex );        &lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum12"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  12:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;         &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; ( aByte = ASCII_SPACE ) then&lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum13"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  13:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;             startIndex = startIndex + 1;&lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum14"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  14:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;             done = ( startIndex &amp;gt; endIndex );&lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum15"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  15:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;         &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;else&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum16"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  16:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;             done = TRUE;&lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum17"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  17:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;         endif;&lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum18"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  18:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;     endwhile;&lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum19"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  19:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;     done = ( startIndex &amp;gt; endIndex );&lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum20"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  20:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  &lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum21"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  21:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;     &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;while&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; ( !done )&lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum22"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  22:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;         GetByte( aByte, aString, endIndex );&lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum23"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  23:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;         &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; ( aByte = ASCII_SPACE ) then&lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum24"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  24:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;             endIndex = endIndex - 1;&lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum25"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  25:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;             done = ( startIndex &amp;gt; endIndex );&lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum26"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  26:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;         &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;else&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum27"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  27:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;             done = TRUE;&lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum28"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  28:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;         endif;&lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum29"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  29:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;     endwhile;&lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum30"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  30:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  &lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum31"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  31:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;     &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; ( startIndex &amp;gt; endIndex ) then&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum32"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  32:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;         aString = &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;""&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum33"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  33:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;     &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;else&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum34"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  34:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;         StrSub( aString, aString, startIndex, endIndex - startIndex + 1 );    &lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum35"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  35:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;     endif;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum36"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  36:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;     &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;return&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; 0;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum37"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  37:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; end;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div id="codeSnippetWrapper"&gt;&lt;br /&gt;&lt;hr /&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Reading XML using MS XML DOM 6 &lt;/strong&gt;(Inspired by &lt;a href="http://community.installshield.com/showthread.php?t=101600&amp;amp;page=2"&gt;http://community.installshield.com/showthread.php?t=101600&amp;amp;page=2&lt;/a&gt;)&lt;/p&gt;&lt;div id="codeSnippetWrapper"&gt;&lt;div id="codeSnippet"    style="padding-right: 0px; padding-left: 0px;  padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px;  border-right-style: none; border-left-style: none; background- text-align: left; border-bottom-style: nonefont-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;br /&gt;  &lt;pre    style="padding-right: 0px; padding-left: 0px;  padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px;  border-right-style: none; border-left-style: none; background- text-align: left; border-bottom-style: nonefont-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum1"  style="color:#606060;"&gt;   &lt;/span&gt;&lt;span id="lnum1"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;1:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; OBJECT oDoc, oNode, oNodeList;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum2"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;   2:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; NUMBER nvBufferLen, nTemp;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum3"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;   3:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; STRING svXPathQuery, svValue, svTemp, svMessage, svError, svLine, svLinePos;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum4"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;   4:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  &lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum5"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;   5:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; set oDoc = CreateObject(&lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;"Msxml2.DOMDocument.6.0"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;);  &lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum6"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;   6:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; (IsObject(oDoc) = FALSE) then&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum7"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;   7:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;     MessageBox(&lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;"MSXML DOM-Document Connection Failed"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;, 0);&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum8"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;   8:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;     &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;return&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; -1;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum9"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;   9:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; endif;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum10"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  10:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;       &lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum11"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  11:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; oDoc.async = FALSE;  &lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum12"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  12:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; oDoc.setProperty(&lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;"SelectionLanguage"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;, &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;"XPath"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;);&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum13"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  13:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; oDoc.load( svInstallDir ^ UI_APP_CONFIG );&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum14"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  14:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  &lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum15"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  15:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; ( oDoc.parseError.errorCode != 0 ) then&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum16"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  16:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;     NumToStr ( svError , oDoc.parseError.errorCode );&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum17"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  17:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;     NumToStr ( svLine , oDoc.parseError.line );&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum18"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  18:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;     NumToStr ( svLinePos , oDoc.parseError.linepos );&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum19"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  19:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;     MessageBox ( &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;"The XML File did not load correctly.\n"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; + &lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum20"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  20:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;                  &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;"Error Code: "&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; + svError + &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;"\n"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; +&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum21"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  21:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;                  &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;"Error Line: "&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; + svLine + &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;"\n"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; + &lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum22"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  22:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;                  &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;"Error Line Position: "&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; + svLinePos + &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;"\n"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; +&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum23"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  23:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;                  oDoc.parseError.reason , 0 );&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum24"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  24:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;else&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; &lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum25"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  25:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;     svXPathQuery = &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;"//XPathQuery"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum26"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  26:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  &lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum27"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  27:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;     &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;try&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; &lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum28"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  28:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;         set oNodeList = objDOMDOC.selectNodes( strXPathQuery );&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum29"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  29:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;     &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;catch&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum30"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  30:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;         nTemp = Err.Number; &lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum31"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  31:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;         NumToStr(svTemp, nTemp);&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum32"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  32:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;         MessageBox(&lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;"Error while selecting "&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; + strXPathQuery + &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;" (Error + "&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; + svTemp + &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;")"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;, 0);&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum33"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  33:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;     endcatch;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum34"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  34:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;     &lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum35"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  35:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;     &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; (oNodeList.length == 0) then&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum36"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  36:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;        MessageBox( &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;"No "&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; + strXPathQuery + &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;" elements found."&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;, 0 );&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum37"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  37:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;     &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;else&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; &lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum38"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  38:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;         &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;for&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; i = 0 to ( oNodeList.length - 1 );&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum39"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  39:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;             set oNode = oNodeList.nextNode;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum40"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  40:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;             &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;try&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum41"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  41:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;                 svValue= oNode.text;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum42"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  42:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;                 &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;//svValue = oNode.attributes.getNamedItem( strAttributeName ).value; // to get attribute value&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum43"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  43:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;             &lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;catch&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum44"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  44:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;                 MessageBox(&lt;/span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;"No value found for "&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; + strXPathQuery, 0);&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum45"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  45:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;             endcatch;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum46"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  46:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;         endfor;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:white;"&gt;&lt;span id="lnum47"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  47:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;     endif;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; overflow-x: visible; overflow-y: visible; width: 100%; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; border-right-style: none; border-left-style: none; border-bottom-style: none; font-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span id="lnum48"&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt;  48:&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(102, 102, 102);"&gt; endif;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282306487405633620-9136228436131766336?l=ruskin-dantra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruskin-dantra.blogspot.com/feeds/9136228436131766336/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/03/common-installshield-functions-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/9136228436131766336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/9136228436131766336'/><link rel='alternate' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/03/common-installshield-functions-and.html' title='Common InstallShield functions and their Usage'/><author><name>Ruskin Dantra</name><uri>http://www.blogger.com/profile/11120195758158923383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_si6_UfT-_E0/Sbi1FW8krII/AAAAAAAAACM/4UmHhJsr49U/S220/rus.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282306487405633620.post-2533298804449134195</id><published>2009-03-30T14:12:00.000+13:00</published><updated>2009-04-01T20:21:51.229+13:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cricket'/><title type='text'>Bhai Log indoor cricket game (Grading game)</title><content type='html'>&lt;p align="justify"&gt;Our virgin game night (first game for our indoor season)…and in all honesty that’s exactly how we played &lt;img alt="smile_sad" src="http://spaces.live.com/rte/emoticons/smile_sad.gif" /&gt;.&lt;/p&gt;&lt;p align="justify"&gt;The game was highly anticipated by most players but especially me as I was captaining our squad this season after giving the veteran captain (Jacinth) a rest.&amp;#160; Big shoes to fill considering we won the last season we played when Jacinth was captain.&lt;/p&gt;&lt;p align="justify"&gt;It did not start well for me…our first game and I had to sit out due to sickness but nonetheless we had enough players.&amp;#160; Luckily it was a grading game so it wasn’t that important.&lt;/p&gt;&lt;p align="justify"&gt;Everyone got to the game in time…this is a rarity as we all follow IST (Indian Standard Time &lt;img alt="smile_wink" src="http://spaces.live.com/rte/emoticons/smile_wink.gif" /&gt;) except this one dude who apparently forgot we had a game…Yes you know who you are &lt;img alt="smile_regular" src="http://spaces.live.com/rte/emoticons/smile_regular.gif" /&gt;.&amp;#160; But then we did get a hold of him and managed to get him down to the venue in time.&lt;/p&gt;&lt;p align="justify"&gt;Our batting performance was good, getting 140ish in the first game is not a bad effort at all but we were let down in the fielding department.&amp;#160; Not to mention that we nearly won the game too…the other team needed one run off the last ball to win as the scores was tied…it was a dot ball which the keeper struggled with (who can blame him…king does bowl which such sheer pace).&amp;#160; The batsmen had time to take a single and win the game…&lt;/p&gt;&lt;p align="justify"&gt;Vengeance will be in our eyes next time &lt;img alt="smile_nerd" src="http://spaces.live.com/rte/emoticons/smile_nerd.gif" /&gt;…opps wrong emoticon…I meant &lt;img alt="smile_shades" src="http://spaces.live.com/rte/emoticons/smile_shades.gif" /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282306487405633620-2533298804449134195?l=ruskin-dantra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruskin-dantra.blogspot.com/feeds/2533298804449134195/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/03/first-bhai-log-indoor-cricket-game.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/2533298804449134195'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/2533298804449134195'/><link rel='alternate' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/03/first-bhai-log-indoor-cricket-game.html' title='Bhai Log indoor cricket game (Grading game)'/><author><name>Ruskin Dantra</name><uri>http://www.blogger.com/profile/11120195758158923383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_si6_UfT-_E0/Sbi1FW8krII/AAAAAAAAACM/4UmHhJsr49U/S220/rus.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282306487405633620.post-9002967167673578737</id><published>2009-03-30T14:05:00.001+13:00</published><updated>2009-03-30T14:05:28.527+13:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Random'/><title type='text'>Change</title><content type='html'>&lt;p align="justify"&gt;I have read quite a few blogs of people mentioning this word.&amp;#160; I am not going to provide a definitive answer and neither am I trying to “change” your viewpoint of what “change” is….I used the word “change” three times already without even analysing exactly of its definition.&lt;/p&gt;  &lt;p align="justify"&gt;&lt;em&gt;&lt;strong&gt;What is change? &lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;  &lt;div align="justify"&gt;   &lt;table cellspacing="0" cellpadding="2" width="700" border="1"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="698"&gt;           &lt;p&gt;As per Google:              &lt;br /&gt;Definitions of &lt;b&gt;change&lt;/b&gt; on the Web:&lt;/p&gt;            &lt;ul&gt;             &lt;li&gt;cause to change; make different; cause a transformation; &amp;quot;The advent of the automobile may have altered the growth pattern of the city&amp;quot;; &amp;quot;The discussion has changed my thinking about the issue&amp;quot; &lt;/li&gt;              &lt;li&gt;an event that occurs when something passes from one state or phase to another; &amp;quot;the change was intended to increase sales&amp;quot;; &amp;quot;this storm is ... &lt;/li&gt;              &lt;li&gt;undergo a change; become different in essence; losing one's or its original nature; &amp;quot;She changed completely as she grew older&amp;quot;; &amp;quot;The weather changed last night&amp;quot; &lt;/li&gt;              &lt;li&gt;a relational difference between states; especially between states before and after some event; &amp;quot;he attributed the change to their marriage&amp;quot; &lt;/li&gt;              &lt;li&gt;become different in some particular way, without permanently losing one's or its former characteristics or essence; &amp;quot;her mood changes in accordance with the weather&amp;quot;; &amp;quot;The supermarket's selection of vegetables varies according to the season&amp;quot; &lt;/li&gt;              &lt;li&gt;the action of changing something; &amp;quot;the change of government had no impact on the economy&amp;quot;; &amp;quot;his change on abortion cost him the election&amp;quot; &lt;/li&gt;              &lt;li&gt;switch: lay aside, abandon, or leave for another; &amp;quot;switch to a different brand of beer&amp;quot;; &amp;quot;She switched psychiatrists&amp;quot;; &amp;quot;The car changed lanes&amp;quot; &lt;/li&gt;              &lt;li&gt;the result of alteration or modification; &amp;quot;there were marked changes in the lining of the lungs&amp;quot;; &amp;quot;there had been no change in the mountains&amp;quot; &lt;/li&gt;              &lt;li&gt;change clothes; put on different clothes; &amp;quot;Change before you go to the opera&amp;quot; &lt;/li&gt;              &lt;li&gt;the balance of money received when the amount you tender is greater than the amount due; &amp;quot;I paid with a twenty and pocketed the change&amp;quot; &lt;/li&gt;              &lt;li&gt;exchange or replace with another, usually of the same kind or category; &amp;quot;Could you convert my dollars into pounds?&amp;quot;; &amp;quot;He changed his name&amp;quot;; &amp;quot;convert centimeters into inches&amp;quot;; &amp;quot;convert holdings into shares&amp;quot; &lt;/li&gt;              &lt;li&gt;a thing that is different; &amp;quot;he inspected several changes before selecting one&amp;quot; &lt;/li&gt;              &lt;li&gt;exchange: give to, and receive from, one another; &amp;quot;Would you change places with me?&amp;quot;; &amp;quot;We have been exchanging letters for a year&amp;quot; &lt;/li&gt;              &lt;li&gt;a different or fresh set of clothes; &amp;quot;she brought a change in her overnight bag&amp;quot; &lt;/li&gt;              &lt;li&gt;transfer: change from one vehicle or transportation line to another; &amp;quot;She changed in Chicago on her way to the East coast&amp;quot;                &lt;br /&gt;&lt;a href="http://www.google.co.nz/url?sa=X&amp;amp;start=0&amp;amp;oi=define&amp;amp;ei=0UzNSZmeNpnGtAPriPCgAw&amp;amp;sig2=P-z5xxWXM7rHXhcJHbTg8g&amp;amp;q=http://wordnet.princeton.edu/perl/webwn%3Fs%3Dchange&amp;amp;usg=AFQjCNEwmgbVZWmLQWmqUwKAsDms821a3Q"&gt;wordnet.princeton.edu/perl/webwn&lt;/a&gt; &lt;/li&gt;           &lt;/ul&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/div&gt;  &lt;p align="justify"&gt;Rather complicated isn’t it…&lt;/p&gt;  &lt;p align="justify"&gt;&lt;strong&gt;&lt;em&gt;How do I see change        &lt;br /&gt;&lt;/em&gt;&lt;/strong&gt;Change is a mindset.&amp;#160; An inevitability which occurs sometimes even without you knowing.&amp;#160; You often change your mind, clothes, time changes, the weather changes, etc… Can you change something without actually changing it, absolutely! Well, that’s at least what I am getting at.&amp;#160; A change can be made simply by how you think about things.&amp;#160; You are changing your thinking and according to me that’s the most important kind of change and not to mention the most powerful change of all.&amp;#160; I do agree as humans we cannot change things which are out of our control…weather is a good example of that although if you can change a mind (your own or some else's) it is an amazing feat in a league of its own.&amp;#160; The greatest leaders in history, sporting legends, coaches, teachers are those who convince their disciples/students to change their way of thinking.&amp;#160; In effect changing their mind.&amp;#160; We are affecting free will, well not directly but nonetheless we are.&lt;/p&gt;  &lt;p align="justify"&gt;You must be thinking…blah blah blah, I know all of this which is true…everyone probably knows the above although this is not what the blog is about.&amp;#160; I am trying to determine and hopefully change &lt;strong&gt;(there the word CHANGE)&lt;/strong&gt; the way you see “change”.&lt;/p&gt;  &lt;p align="justify"&gt;When you get faced with a change, how do you generally react?&amp;#160; I go through a range of feelings generally:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;div align="justify"&gt;nervous&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;excited&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;anxious&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;scared&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;confidence&lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p align="justify"&gt;Now the above will definitely depend on whether the change was voluntary or involuntary and also how big a change is.&amp;#160; When you go through this emotions do you often take into consideration the implications of your change?&amp;#160; How often do you go through a “what-if” analysis trying out different paths of your decision making.&amp;#160; How often do you document or remember of what the reasoning behind your change was?&amp;#160; In all honesty I don’t think any person would go through this kind of analysis for a small to medium size changed…forget that…most people wouldn’t even do those kind of analysis for making bigger life changes (i.e. moving countries, changing jobs, marriage, etc).&amp;#160; Lets face it, we have big expectations from our brains, we attempt to remember the reasons for the change, completely possible to do…although how long will you remember this reasoning?&lt;/p&gt;  &lt;p&gt;This forced me to think, can we make the process of change more reliable by remembering why and when we made a change.&amp;#160; Will this help us make better changes in the future?&amp;#160; This is a more generic solution, what I am currently in the process of doing is looking at this from a software developers perspective.&lt;/p&gt;  &lt;p align="justify"&gt;&lt;strong&gt;&lt;em&gt;A software developer perspective…        &lt;br /&gt;&lt;/em&gt;&lt;/strong&gt;Many a times have I done some work and come back to it and had trouble remember why and when the change was made.&amp;#160; If you work for a company surely they’ll have some sort of mechanism to document exactly this although more often than you think it will fall short of your personal expectations.&amp;#160; Maybe you are compulsive organiser like how I am and start writing endless pages of notes of why a change was required, where it was required, what other modules will the change effect, the tests you did to choose the optimum implementation of the change, etc etc.&amp;#160; Finally this will become hard to manage simply due to so much manual writing, sorting and especially searching back through pages of written work.&amp;#160; Isn’t there a better solution?&lt;/p&gt;  &lt;p align="justify"&gt;Surely there are better solutions out there…which you may have to pay for or other solutions which maybe completely generic and do not cater for your particular flavour of change management.&amp;#160; I really want something which I can use, modify and persist over years.&amp;#160; Something like a blog…but only for your coding changes.&amp;#160; This is when it came to me, I really want a visual DSL which can cater for my obtuse needs as they arise.&amp;#160; I can also use this wherever I go irrespective of the change I am making.&lt;/p&gt;  &lt;p align="justify"&gt;This system could not only help you document what change you made but also help you in determining how successful your change was 1-2 years down the line.&amp;#160; Did you make a change to fix your change, how did your change scale for the future, did you change too much so that you simply ended up writing a whole new feature (which defeats the purpose of change nonetheless it is still technically a change).&lt;/p&gt;  &lt;p align="justify"&gt;I will be documenting on how I went about designing such a DSL in later Blogs.&amp;#160; Hopefully it will give me a better understanding on how to manage change outside the IT sector and apply it to more generic changes…such as company decisions and risk analysis.&lt;/p&gt;  &lt;p align="justify"&gt;Keep an eye out…&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282306487405633620-9002967167673578737?l=ruskin-dantra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruskin-dantra.blogspot.com/feeds/9002967167673578737/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/03/change.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/9002967167673578737'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/9002967167673578737'/><link rel='alternate' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/03/change.html' title='Change'/><author><name>Ruskin Dantra</name><uri>http://www.blogger.com/profile/11120195758158923383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_si6_UfT-_E0/Sbi1FW8krII/AAAAAAAAACM/4UmHhJsr49U/S220/rus.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282306487405633620.post-1880767713144902873</id><published>2009-03-30T13:21:00.001+13:00</published><updated>2009-03-30T14:12:11.797+13:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Versioning'/><title type='text'>Versioning DLLs in C#</title><content type='html'>&lt;div align="justify"&gt;Often I design and implement .NET projects never really worrying about their versions until sometime in the future someone comes back and says, "I have this problem, can you fix it", and then you end up thinking that you have provided a fix, just not sure which version the fix was in. Problems also arise when you are trying to find a threshold point of when an interface in a particular DLL changes so that other files using it are not supported.  Welcome to the age old problem of DLL versioning.  Mind you, at this point in time I am talking about singular DLL versioning and not versioning at a broader scale (product based).&lt;br /&gt;&lt;br /&gt;I am not saying this is the best way or the only way, all I am saying is this is how I have addressed the problem in the past.&lt;br /&gt;&lt;br /&gt;After surfing around and finding various versioning tools/articles like: &lt;/div&gt;  &lt;ol&gt;   &lt;li&gt;     &lt;div align="justify"&gt;&lt;a href="http://code.msdn.microsoft.com/AssemblyInfoTaskvers"&gt;AssmeblyInfoTask&lt;/a&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;&lt;a href="http://sdesmedt.wordpress.com/2006/06/16/version-numbering/"&gt;http://sdesmedt.wordpress.com/2006/06/16/version-numbering/&lt;/a&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;&lt;a href="http://www.codeproject.com/KB/macros/versioningcontrolledbuild.aspx"&gt;http://www.codeproject.com/KB/macros/versioningcontrolledbuild.aspx&lt;/a&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;&lt;a href="http://www.codeproject.com/KB/dotnet/Customizing_csproj_files.aspx"&gt;http://www.codeproject.com/KB/dotnet/Customizing_csproj_files.aspx&lt;/a&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;&lt;a href="http://www.codeproject.com/KB/dotnet/ManagingAssemblyVersions.aspx"&gt;http://www.codeproject.com/KB/dotnet/ManagingAssemblyVersions.aspx&lt;/a&gt;&lt;/div&gt;   &lt;/li&gt; &lt;/ol&gt;  &lt;div align="justify"&gt;All the above versioning schemes are great although I chose to go with AssemblyInfoTask.  There are various (albeit more elegant ways) of using this simple tool but let us examine how I used it.&lt;/div&gt;  &lt;p align="justify"&gt;&lt;span class="Apple-style-span" style="font-weight: bold"&gt;Step 1:&lt;br /&gt;&lt;/span&gt;Well obviously download and install the tool from &lt;a href="http://code.msdn.microsoft.com/AssemblyInfoTaskvers"&gt;here&lt;/a&gt;.  The help file within the installer comes in very handy and it does explain how you can go about changing the version number according to whatever scheme you like.&lt;/p&gt;  &lt;p align="justify"&gt;&lt;span class="Apple-style-span" style="font-weight: bold"&gt;Step 2:&lt;br /&gt;&lt;/span&gt;Edit your project file to include the new versioning task in it.  This can be done by unloading your project in Visual Studio...&lt;/p&gt;  &lt;ol&gt;   &lt;p align="justify"&gt;&lt;img id="BLOGGER_PHOTO_ID_5317651454417175394" style="margin: 0px 0px 10px 10px; width: 144px; cursor: hand; height: 200px" alt="" src="http://1.bp.blogspot.com/_si6_UfT-_E0/ScwX0tvgA2I/AAAAAAAAACw/9-q7plHzTgU/s200/Untitled.png" border="0" /&gt;&lt;/p&gt; &lt;/ol&gt;  &lt;p align="justify"&gt;then you can right click on the unloaded project and go "Edit &amp;lt;ProjectName&amp;gt;".  This will open up your project as an XML file in the VS editor.  Most commonly your last Import statement will read the following: &lt;/p&gt;  &lt;div align="justify"&gt;   &lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Import &lt;/span&gt;&lt;span style="color:red;"&gt;Project&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;"&lt;span style="color:blue;"&gt;$(MSBuildToolsPath)\Microsoft.CSharp.targets&lt;/span&gt;" &lt;span style="color:blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div id="codeSnippetWrapper" align="justify"&gt;Add another line below it which tells your project to also invoke the AssemblyInfoTask targets, your project file will then look like:&lt;/div&gt;&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Import &lt;/span&gt;&lt;span style="color:red;"&gt;Project&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;"&lt;span style="color:blue;"&gt;$(MSBuildToolsPath)\Microsoft.CSharp.targets&lt;/span&gt;" &lt;span style="color:blue;"&gt;/&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Import &lt;/span&gt;&lt;span style="color:red;"&gt;Project&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;"&lt;span style="color:blue;"&gt;$(MSBuildExtensionsPath)\Microsoft\AssemblyInfoTask\Microsoft.VersionNumber.Targets&lt;/span&gt;" &lt;span style="color:blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;div align="justify"&gt;Save the XML file and reload your project now.&lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;span class="Apple-style-span" style="font-weight: bold"&gt;Step 3:&lt;/span&gt; &lt;/div&gt;&lt;div align="justify"&gt;Build the your project and you can see the DLL version skip every time you do a build according to the rules you defined in your &lt;u&gt;AssemblyInfo&lt;/u&gt; target file.&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;img id="BLOGGER_PHOTO_ID_5317667108957010162" style="width: 200px; cursor: pointer; height: 92px" alt="" src="http://3.bp.blogspot.com/_si6_UfT-_E0/ScwmD7cpOPI/AAAAAAAAAC4/wHj43ceKjxc/s200/version.png" border="0" /&gt;&lt;/div&gt;&lt;div align="justify" style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;Above you see that the file version is 1.0.327.0.  According to my target file I have set up the build number as the current date and the revision number simply increments every time I do a build.  I chose M-DD format as that allows me to go all year without changing my revision scheme.  But wait…this does create a problem when you cycle around a year end.  I thought of this and decided that if we do cycle around a year end I can simply change the minor versioning scheme.  This may not always be feasible depending on company regulations and also depends on your release cycle.  Well all I am saying is, use a scheme which works for you.  Depending on your project and it’s release cycle your versioning scheme will differ too.&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;strong&gt;Step 4:&lt;/strong&gt; &lt;/div&gt;&lt;div align="justify"&gt;Great, so now you have a fully functioning versioning scheme.  Note that the above versioning propagates through to the DLL via the AssemblyInfo.cs file.&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;em&gt;What happens if you use some sort of source control in which your files are locked?&lt;/em&gt;&lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;A nice little error will be produced informing you that AssemblyInfo.cs file cannot be edited because it is read-only.  This happened for me as I was using Visual Source Safe, not sure exactly how other source control mechanisms react.  Anyways there is a simple solution: Simply check out AssemblyInfo.cs file.  &lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;span class="Apple-style-span" style="font-style: italic; "&gt;Checking out AssemblyInfo.cs&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;em&gt;&lt;br /&gt;&lt;/em&gt;This will work well and good if you have only one project in your entire solution, although here are the problems you’ll come across:&lt;/div&gt;&lt;ul&gt;  &lt;li&gt;&lt;div align="justify"&gt;What happens if there are 20 projects in your solution, will you be checking out each and every AssemblyInfo.cs file?&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;div align="justify"&gt;What happens if there are multiple developers working on different aspects of the solution, who decides when to check in such an AssemblyInfo.cs file?&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;div align="justify"&gt;A developer may do multiple builds every day, does that mean we are changing the revision every time?&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p align="justify"&gt;Simply checking out the AssemblyInfo.cs file won’t work…what we need is some intelligent way of deciding when to kick off this AssemblyInfoTask target.  This is when conditional logic comes in handy.  Simply change your project XML file (we all know how to edit them now) to look like this:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Import &lt;/span&gt;&lt;span style="color:red;"&gt;Project&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;"&lt;span style="color:blue;"&gt;$(MSBuildToolsPath)\Microsoft.CSharp.targets&lt;/span&gt;" &lt;span style="color:blue;"&gt;/&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Import &lt;/span&gt;&lt;span style="color:red;"&gt;Project&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;"&lt;span style="color:blue;"&gt;$(MSBuildExtensionsPath)\Microsoft\AssemblyInfoTask\Microsoft.VersionNumber.Targets&lt;/span&gt;" &lt;span style="color:red;"&gt;Condition&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;" &lt;span style="color:blue;"&gt;'$(Configuration)' == 'SpecialRelease' &lt;/span&gt;" &lt;span style="color:blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;p align="justify"&gt;All the above statement says is that we only want to invoke our AssemblyInfoTask target when our configuration is “SpecialRelease”.  What is SpecialRelease, it is an arbitrary string.  What is $(Configuration), it is the build configuration you use.  You may already know that every generic C# project comes with two configurations already added for you: Debug and Release.&lt;/p&gt;&lt;p align="justify"&gt;&lt;a href="http://lh5.ggpht.com/_si6_UfT-_E0/Scw37c0j4FI/AAAAAAAAADI/aVKBSTyPHVo/s1600-h/image%5B2%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="75" alt="image" src="http://lh4.ggpht.com/_si6_UfT-_E0/Scw38Ibn8hI/AAAAAAAAADM/M2bH74nrAeQ/image_thumb.png?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p align="justify"&gt;We could have simply used release but I thought that as developers we may use “Release” for some special test cases which may not occur on a “Debug” build.  Anyways, so what we do now is add a new configuration called “SpecialRelease”.  Easily done by clicking on “Configuration Manager…” and the following window opens up:&lt;/p&gt;&lt;p align="justify"&gt;&lt;a href="http://lh4.ggpht.com/_si6_UfT-_E0/SdAQZW_a83I/AAAAAAAAAD8/cYE95932WgQ/s1600-h/image7%5B5%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin: 0px; border-right-width: 0px" height="100" alt="image" src="http://lh3.ggpht.com/_si6_UfT-_E0/Scw39-5370I/AAAAAAAAAEA/isotl81w9Cw/image7_thumb%5B4%5D.png?imgmax=800" width="391" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p align="justify"&gt;There are two aspects to the above window: Solution Configurations and configurations for each project shown below.  Visual Studio comes in really handy in this case…we can add an entire new solution configuration and automatically propagate it down to every project within our solution.&lt;/p&gt;&lt;ol&gt;  &lt;li&gt;&lt;div align="justify"&gt;&lt;a href="http://lh4.ggpht.com/_si6_UfT-_E0/Scw3-b2Ot1I/AAAAAAAAADY/I6_iEz3F9v8/s1600-h/image%5B14%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="77" alt="image" src="http://lh6.ggpht.com/_si6_UfT-_E0/Scw3_PjVv0I/AAAAAAAAADc/4h6rH9Eaf6s/image_thumb%5B10%5D.png?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt;  Click new&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt; &lt;a href="http://lh3.ggpht.com/_si6_UfT-_E0/Scw3_l9oFpI/AAAAAAAAADg/lkOoKFD5QJE/s1600-h/image%5B20%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="128" alt="image" src="http://lh4.ggpht.com/_si6_UfT-_E0/Scw4Ap69zuI/AAAAAAAAADk/4AF1mXB3CvA/image_thumb%5B12%5D.png?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; Type in “SpecialRelease” and copy settings from “Release” (because we are only changing the version numbers on every release or whatever you want).  Make sure the check box which says “Create new project configurations” is checked.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;    &lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;Voila! Your configuration manager will now look like:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh6.ggpht.com/_si6_UfT-_E0/Scw4BdikaWI/AAAAAAAAAEI/cbq4Vxs7zrc/s1600-h/image21%5B2%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="88" alt="image" src="http://lh4.ggpht.com/_si6_UfT-_E0/Scw4CiZ5DiI/AAAAAAAAAEM/LfnKiBvncmw/image21_thumb%5B1%5D.png?imgmax=800" width="348" border="0" /&gt;&lt;/a&gt; &lt;/div&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p align="justify"&gt;&lt;strong&gt;One more quirk!!!!!!&lt;/strong&gt;&lt;/p&gt;&lt;p align="justify"&gt;Doing the above will result in a build error:&lt;/p&gt;&lt;p align="justify"&gt;&lt;a href="http://lh5.ggpht.com/_si6_UfT-_E0/Scw4Da1_gQI/AAAAAAAAAEY/LbjF0o350mA/s1600-h/image26%5B2%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="68" alt="image" src="http://lh5.ggpht.com/_si6_UfT-_E0/Scw4EBCwCtI/AAAAAAAAAEg/_GxOckX3HLg/image26_thumb%5B1%5D.png?imgmax=800" width="417" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p align="justify"&gt;This is because simply adding new configurations does not guarantee that we have done all the necessary steps to cater for this new configuration.  We edit our project XML again and add a block of XML (After the last PropertyGroup): &lt;/p&gt;&lt;div id="codeSnippetWrapper"&gt;&lt;pre id="codeSnippet"    style="padding-right: 0px; padding-left: 0px;  padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px;  border-right-style: none; border-left-style: none; background- text-align: left; border-bottom-style: nonefont-family:'Courier New', courier, monospace;font-size:8pt;color:#f4f4f4;"&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;PropertyGroup&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Condition&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=" '$(Configuration)|$(Platform)' == 'SpecialRelease|AnyCPU' "&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;OutputPath&lt;span class="Apple-style-span" style="color: rgb(0, 0, 255); font-size: 16px; "&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); font-size: 13px; "&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;bin\ReleaseQA\&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 255); font-size: 16px; "&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;lt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); font-size: 13px; "&gt;&lt;span style="color:#0000ff;"&gt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;OutputPath&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;DefineConstants&lt;span class="Apple-style-span" style="color: rgb(0, 0, 255); font-size: 12px; "&gt;&amp;gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); font-size: 13px; "&gt;TRACE&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;DefineConstants&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Optimize&lt;span class="Apple-style-span" style="color: rgb(0, 0, 255); font-size: 12px; "&gt;&amp;gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); font-size: 13px; "&gt;true&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Optimize&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;DebugType&lt;span class="Apple-style-span" style="color: rgb(0, 0, 255); font-size: 12px; "&gt;&amp;gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); font-size: 13px; "&gt;pdbonly&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;DebugType&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;PlatformTarget&lt;span class="Apple-style-span" style="color: rgb(0, 0, 255); font-size: 12px; "&gt;&amp;gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); font-size: 13px; "&gt;AnyCPU&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;PlatformTarget&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;ErrorReport&lt;span class="Apple-style-span" style="color: rgb(0, 0, 255); font-size: 12px; "&gt;&amp;gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); font-size: 13px; "&gt;prompt&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;ErrorReport&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;PropertyGroup&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;  &lt;/div&gt;&lt;p align="justify"&gt;You’ll find that doing the above, setting your configuration as “SpecialRelease” and building your solution will still not work.  This is because $(Configuration) will be coming in as an empty string unfortunately.  I haven’t fully researched understood this issue but I did manage a workaround…use MSBuild.exe to build your solution.  Using MSBuild is really trivial, this is how you use it for the above mentioned “ClassLibrary1” solution:&lt;/p&gt;&lt;p align="left"&gt;&lt;em&gt;&lt;span style="color:#008040;"&gt;MSbuild.exe “$(SolutionDir)\$(SolutionName)” /t:build /p:Configuration="SpecialRelease"&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;&lt;p align="justify"&gt;MSBuild.exe can be found in “&lt;em&gt;C:\WINDOWS\Microsoft.NET\Framework\v3.5\”&lt;/em&gt;.  And also remember that there are different versions of MSBuild.exe depending on your .NET version so make sure you build your solution with the correct version of MSBuild.  More help on MSBuild &lt;a href="http://msdn.microsoft.com/en-us/library/wea2sca5.aspx"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;p align="justify"&gt;You can do this easily using automated build tools which allow you to checkout groups of files (AssemblyInfo.cs) and check them in afterwards.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282306487405633620-1880767713144902873?l=ruskin-dantra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruskin-dantra.blogspot.com/feeds/1880767713144902873/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/03/versioning-dlls-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/1880767713144902873'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/1880767713144902873'/><link rel='alternate' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/03/versioning-dlls-in-c.html' title='Versioning DLLs in C#'/><author><name>Ruskin Dantra</name><uri>http://www.blogger.com/profile/11120195758158923383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_si6_UfT-_E0/Sbi1FW8krII/AAAAAAAAACM/4UmHhJsr49U/S220/rus.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_si6_UfT-_E0/ScwX0tvgA2I/AAAAAAAAACw/9-q7plHzTgU/s72-c/Untitled.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282306487405633620.post-6384625009013022687</id><published>2009-03-30T13:06:00.002+13:00</published><updated>2009-03-30T13:07:13.622+13:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Random'/><title type='text'>Blogs to come</title><content type='html'>&lt;p align="justify"&gt;I am just about to get into blogging and every time I do so I find it hard to come up with a topic...I have decided that I am going to blog about random bits from work, sport and in general every day moments.&amp;#160; In the near future I am planning to blog about the following things: &lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;     &lt;div align="justify"&gt;Reading a list of computers/users on a given domain        &lt;br /&gt;&lt;span class="Apple-style-span" style="font-style: italic"&gt;Comes in really handy while remote desktoping into a computer only to find someone else is already using it.&lt;/span&gt; &lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;Guest lecturing at university        &lt;br /&gt;&lt;span class="Apple-style-span" style="font-style: italic"&gt;I am about to give two lectures at uni about my recent thesis, that will be an interesting experience.&lt;/span&gt; &lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;WPF quirks and weirdness        &lt;br /&gt;&lt;span class="Apple-style-span" style="font-style: italic"&gt;Will be compiling a list of those soon.&lt;/span&gt; &lt;/div&gt;   &lt;/li&gt; &lt;/ol&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282306487405633620-6384625009013022687?l=ruskin-dantra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruskin-dantra.blogspot.com/feeds/6384625009013022687/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/03/blogs-to-come.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/6384625009013022687'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/6384625009013022687'/><link rel='alternate' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/03/blogs-to-come.html' title='Blogs to come'/><author><name>Ruskin Dantra</name><uri>http://www.blogger.com/profile/11120195758158923383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_si6_UfT-_E0/Sbi1FW8krII/AAAAAAAAACM/4UmHhJsr49U/S220/rus.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8282306487405633620.post-5917068889556215914</id><published>2009-03-30T13:06:00.001+13:00</published><updated>2009-03-30T13:06:44.602+13:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='University'/><category scheme='http://www.blogger.com/atom/ns#' term='Thesis'/><title type='text'>CS732 &amp; SE450 Guest Lecture</title><content type='html'>&lt;p align="justify"&gt;I recently finished my ME at Auckland University and was &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_0"&gt;privileged&lt;/span&gt; to be invited to give a couple of guest lectures to the current undergraduates.&amp;#160; It was a great opportunity and something definitely worth writing about. &lt;/p&gt;  &lt;div align="justify"&gt;   &lt;br /&gt;&lt;/div&gt;  &lt;div align="justify"&gt;I prepared a &lt;a href="http://cid-ac849ad87e27e83d.skydrive.live.com/self.aspx/.Public/CS732%7C_SE450%7C_GuestLecture.pptx"&gt;presentation&lt;/a&gt; outlining my research etc and used that as a teaching aid.&amp;#160; I was extremely nervous before giving the first lecture, it was a computer science honours class and I wasn't at all familiar with any of the students there but nervousness soon faded away and then it just felt like I was talking about my work to my peers.&amp;#160; I did feel like I rushed the presentation but I guess that happens naturally when you are slightly nervous.&amp;#160; Although one positive did come out of that, I had plenty of time to give a live demo of my tool which is always a good thing while talking.&lt;/div&gt;  &lt;div align="justify"&gt;   &lt;br /&gt;&lt;/div&gt;  &lt;div align="justify"&gt;The second lecture I was meant to give was on the next day but unfortunately I could not stick to that schedule as I was feeling a bit under the weather.&amp;#160; So we rescheduled and finally managed to give the lecture two days later.&amp;#160; This time it was a 4&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;th&lt;/span&gt; year software engineering class.&amp;#160; Great class and the students were nothing like how &amp;quot;we&amp;quot; were back in university, they did actually listen...this time around the lecture seemed easier as I was familiar with the students and had tutored them the year before.&amp;#160; The lecture went well but unfortunately I could not give them a live demo of the tool as my laptop had no battery left :(.&amp;#160; Nonetheless the lecture finished early so I am sure the students must have been glad.&lt;/div&gt;  &lt;div align="justify"&gt;   &lt;br /&gt;&lt;/div&gt;  &lt;div align="justify"&gt;To sum things up...it was a great experience.&amp;#160; Giving a talk about something you spent a whole year on...designing and implementing is really easy.&amp;#160; Mind you this is me talking in hindsight...at the time I was shaking in my boots :)&lt;/div&gt;  &lt;div align="justify"&gt;   &lt;br /&gt;&lt;/div&gt;  &lt;div align="justify"&gt;Downloads: &lt;a href="http://cid-ac849ad87e27e83d.skydrive.live.com/self.aspx/.Public/CS732%7C_SE450%7C_GuestLecture.pptx"&gt;Presentation&lt;/a&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8282306487405633620-5917068889556215914?l=ruskin-dantra.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruskin-dantra.blogspot.com/feeds/5917068889556215914/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/03/cs732-se450-guest-lecture.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/5917068889556215914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8282306487405633620/posts/default/5917068889556215914'/><link rel='alternate' type='text/html' href='http://ruskin-dantra.blogspot.com/2009/03/cs732-se450-guest-lecture.html' title='CS732 &amp;amp; SE450 Guest Lecture'/><author><name>Ruskin Dantra</name><uri>http://www.blogger.com/profile/11120195758158923383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://4.bp.blogspot.com/_si6_UfT-_E0/Sbi1FW8krII/AAAAAAAAACM/4UmHhJsr49U/S220/rus.jpg'/></author><thr:total>0</thr:total></entry></feed>
