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

<channel>
	<title>Pearl Tech</title>
	<atom:link href="http://blog.pearltechnology.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.pearltechnology.com</link>
	<description></description>
	<lastBuildDate>Thu, 05 Jan 2012 14:47:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>JQGrid and Jquery &#8211; Move toolbar below pager</title>
		<link>http://blog.pearltechnology.com/jqgrid-and-jquery-move-toolbar-below-pager/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://blog.pearltechnology.com/jqgrid-and-jquery-move-toolbar-below-pager/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 14:47:55 +0000</pubDate>
		<dc:creator>Chad Ferguson</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[JQGrid]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://blog.pearltechnology.com/?p=1288</guid>
		<description><![CDATA[For a current client it was requested that I move the JQGrid toolbar below the pager if a pager exists. The Toolbar is a nice feature of the JQGrid which can be used for pratically anything. Unfortunately the way the toolbar is set up can be hard to work with. The toolbar can be set [...]]]></description>
			<content:encoded><![CDATA[<p>For a current client it was requested that I move the JQGrid toolbar below the pager if a pager exists. The Toolbar is a nice feature of the JQGrid which can be used for pratically anything. Unfortunately the way the toolbar is set up can be hard to work with. The toolbar can be set into one of 3 positions: Above the header row (Top), below the footer row (Bottom), and both (Both). When the either the top or bottom option is selected a toolbar with id t_<your gridid> is created. If the Both option is selected the Top toolbar will have an id of t_<your gridid> and the bottom will have an id of tb_<your gridid>. This complicates things since I only want to move the bottom toolbar. Thankefully Jquery has a method, <a href="http://api.jquery.com/last/">Last</a>, that will solve the problem. Last does what we need which is grab the last child of a selector. The grid&#8217;s sections are divided up into divs under a parent div with the id of gview_<your gridid>. If a bottom toolbar exists, it will always be the last div under that parent. So first we check if a pager exists, then get the last child of the gview div, and if that child has a class of ui-userdata, which indicates that it is a toolbar, we can detach it and insert it after the pager as seen below.</p>
<p><code><br />
function moveLowerJQGridToolbar(gridid) {<br />
    var pager = $('#' + gridid + '_pager');<br />
    if ($(pager).exists()) {<br />
        var lastChild = $('#gview_' + gridid).children().last();<br />
        if (lastChild.hasClass('ui-userdata')) {<br />
            var toolbar = $(lastChild).detach();<br />
            $(toolbar).insertAfter(pager);<br />
        }<br />
    }<br />
}</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pearltechnology.com/jqgrid-and-jquery-move-toolbar-below-pager/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XNA Tutorial Series 1: Golf (Patience) Solitaire Part II – Deck Class</title>
		<link>http://blog.pearltechnology.com/xna-tutorial-series-1-golf-patience-solitaire-part-ii-%e2%80%93-deck-class/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://blog.pearltechnology.com/xna-tutorial-series-1-golf-patience-solitaire-part-ii-%e2%80%93-deck-class/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 19:46:32 +0000</pubDate>
		<dc:creator>Chad Ferguson</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Game Programming]]></category>
		<category><![CDATA[XNA; Solitaire]]></category>

		<guid isPermaLink="false">http://blog.pearltechnology.com/?p=1283</guid>
		<description><![CDATA[Golf Solitaire as described by wikipedia:
Golf is a Patience game where players try to earn the lowest number of points (as in golf, the sport) over the course of nine deals (or &#8220;holes&#8221; to further use golfing teminology). It has a tableau of 35 face-up cards and a higher ratio of skill to luck than [...]]]></description>
			<content:encoded><![CDATA[<p>Golf Solitaire as described by wikipedia:</p>
<p>Golf is a Patience game where players try to earn the lowest number of points (as in golf, the sport) over the course of nine deals (or &#8220;holes&#8221; to further use golfing teminology). It has a tableau of 35 face-up cards and a higher ratio of skill to luck than most other solitaire card games.</p>
<p>My attempts in this tutorial series will be able to keep the code reusable and hopefully build onto this series with other Card/Solitaire games. </p>
<p><strong>XNA Tutorial Series 1: Golf (Patience) Solitaire Part III &#8211; Deck Class</strong><br />
For this tutorial we will focus on the class that will handle the logic for a group of cards. Start by right clicking on your classes folder and adding a new class called Deck.cs. The first thing we will need to do is setup are using&#8217;s as follows:<br />
<code><br />
        using System;<br />
        using System.Collections.Generic;<br />
        using System.Linq;<br />
        using Microsoft.Xna.Framework;<br />
        using Microsoft.Xna.Framework.Content;<br />
        using Microsoft.Xna.Framework.Graphics;<br />
        using Microsoft.Xna.Framework.Input;<br />
</code></p>
<p>Next set your class to be public.</p>
<p>Now we can begin by adding a Enum to our class to represent a deck type:<br />
<code><br />
        public enum DeckType<br />
        {<br />
            User = 1,<br />
            Source,<br />
            Waste,<br />
            Target<br />
        };<br />
</code></p>
<p>Now we can setup the individual properties that a Card will have, I will show the code first and then proceed to explain what each property is for:<br />
<code><br />
        protected List cards = new List();<br />
        protected Point pos;<br />
        protected int deckID;<br />
        protected DeckType deckType;<br />
        Texture2D background;</p>
<p>        public virtual Point Position<br />
        {<br />
            get<br />
            {<br />
                return pos;<br />
            }<br />
            set<br />
            {<br />
                pos = value;<br />
            }<br />
        }</p>
<p>        public DeckType Type<br />
        {<br />
            get<br />
            {<br />
                return deckType;<br />
            }<br />
        }<br />
</code><br />
cards will be a list of the cards in the deck, pos is a point that is used for offsetting a card image so you can have one card on top of another and see the values for both. deckID is an ID for keeping track of the decks. DeckType to indicate the enum for which type of deck it is, and a texture to store the decks background.</p>
<p>Next we have our constructors:<br />
<code><br />
        public Deck()<br />
        {<br />
            deckType = DeckType.User;<br />
        }</p>
<p>        public Deck(int id)<br />
        {<br />
            deckID = id;<br />
            deckType = DeckType.User;<br />
        }<br />
</code></p>
<p>Since this deck class is going to be a base type it will default to being a user deck, other deck types (waste, source, etc..) will implement the desk class. Next we will need some basic methods for maintaining the list of cards that are in the deck.</p>
<p>First we will need to be able to retrieve the number of cards in the deck:<br />
<code><br />
        public virtual int CardCount()<br />
        {<br />
            return cards.Count();<br />
        }</p>
<p>Get the last card(top) of the deck<br />
        public virtual Card GetLast()<br />
        {<br />
            return cards.Last();<br />
        }</p>
<p>Remove the last card<br />
        public virtual Card RemoveLast()<br />
        {<br />
            Card card = cards.Last();<br />
            cards.Remove(card);<br />
            return card;<br />
        }</p>
<p>And finally get a card<br />
        public virtual Card GetCard(int index)<br />
        {<br />
            return cards[index];<br />
        }<br />
</code></p>
<p>In the second part of the deck class we will look at Adding cards, handling input, and drawing the cards.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pearltechnology.com/xna-tutorial-series-1-golf-patience-solitaire-part-ii-%e2%80%93-deck-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JQGrid and a getRowData issue</title>
		<link>http://blog.pearltechnology.com/jqgrid-and-a-getrowdata-issue/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://blog.pearltechnology.com/jqgrid-and-a-getrowdata-issue/#comments</comments>
		<pubDate>Fri, 16 Dec 2011 16:24:46 +0000</pubDate>
		<dc:creator>Chad Ferguson</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">http://blog.pearltechnology.com/?p=1278</guid>
		<description><![CDATA[Recent work for a client has involved a large amount of work with the excellent Jquery plugin JQGrid. Per the clients requirements I needed to fire an event on row select that would execute another event that is stored in the object. Part of the JQGrid api is a function that allows you to retrieve [...]]]></description>
			<content:encoded><![CDATA[<p>Recent work for a client has involved a large amount of work with the excellent <a href="http://jquery.com/">Jquery</a> plugin <a href="http://www.trirand.com/blog/">JQGrid</a>. Per the clients requirements I needed to fire an event on row select that would execute another event that is stored in the object. Part of the JQGrid api is a function that allows you to retrieve the data associated with a row and do what you please with it.<br />
<code><br />
$(gridid).jqGrid('getRowData', rowid);<br />
</code><br />
Unfortunately this only returns the data that was actually being displayed by the grid and any other undisplayed objects are not returned. Since I had a complex object that would not be displayed in the grid but was needed for actions in the grid I had to find a way to retrieve the entire object that was used to populate the row. Another option is too use the the grid params and retrieve that data object.<br />
<code><br />
$(gridid).jqGrid('getGridParam', 'data');<br />
</code><br />
However, I quickly discovered that method only works with local data. So to solve my problem I had to leverage a nice Jquery function known as <a href="http://api.jquery.com/jQuery.data/">.Data()</a>. With this function I could store my grid data and associate it to the grid. Then using the the rowid of the selected row I could quickly find the full object that was used to create the row. So to do this I first had to assign the data, which is done via the jqgrid event &#8216;LoadComplete&#8217;. Then in my select row event I can retrieve that data and find my row object.<br />
<code><br />
function jqGridLoadComplete(data, gridid) {<br />
    $('#' + gridid).data("jqData", data.Rows);<br />
}<br />
function onJQRowSelect(rowid, status, callback, gridid) {<br />
    var alldata = $('#' + gridid).data("jqData");<br />
    var data = alldata[rowid - 1];<br />
}<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pearltechnology.com/jqgrid-and-a-getrowdata-issue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XNA Tutorial Series 1: Golf (Patience) Solitaire Part I &#8211; Card Class</title>
		<link>http://blog.pearltechnology.com/xna-tutorial-series-1-golf-patience-solitaire-part-i-card-class/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://blog.pearltechnology.com/xna-tutorial-series-1-golf-patience-solitaire-part-i-card-class/#comments</comments>
		<pubDate>Tue, 22 Nov 2011 13:24:26 +0000</pubDate>
		<dc:creator>Chad Ferguson</dc:creator>
				<category><![CDATA[Application Development]]></category>

		<guid isPermaLink="false">http://blog.pearltechnology.com/?p=1237</guid>
		<description><![CDATA[Golf Solitaire as described by wikipedia:
Golf is a Patience game where players try to earn the lowest number of points (as in golf, the sport) over the course of nine deals (or &#8220;holes&#8221; to further use golfing teminology). It has a tableau of 35 face-up cards and a higher ratio of skill to luck than [...]]]></description>
			<content:encoded><![CDATA[<p><em>Golf Solitaire as described by wikipedia:<br />
Golf is a Patience game where players try to earn the lowest number of points (as in golf, the sport) over the course of nine deals (or &#8220;holes&#8221; to further use golfing teminology). It has a tableau of 35 face-up cards and a higher ratio of skill to luck than most other solitaire card games.</em></p>
<p>My attempts in this tutorial series will be able to keep the code reusable and hopefully build onto this series with other Card/Solitaire games. Also this tutorial assumes that you have basic XNA knowledge. </p>
<p><u><strong>XNA Tutorial Series 1: Golf (Patience) Solitaire Part I &#8211; Project Setup</strong></u></p>
<p>Start by creating a new XNA 4.0 Windows game project. In my sample I named the project &#8220;Patience&#8221; but you are free to name it whatever you like. Then in the main project right click the project and add a new folder called classes. This will be where we define our game logic.</p>
<p><img src="http://blog.pearltechnology.com/wp-content/uploads/2011/07/project.JPG" alt="project" title="project" width="212" height="305" class="aligncenter size-full wp-image-1240" /></p>
<p>Also in your Content Project right click and add  &#8220;Cards&#8221; and &#8220;Fonts&#8221; Directories. Where the actual game art will be stored. Right now that gives us the basis for starting our game. In the next tutorial we will focus on creating the Card class.</p>
<p>For this tutorial we will focus on the class that will handle the logic for one individual card. Start by right clicking on your classes folder and adding a new class called Card.cs. The first thing we will need to do is setup are using&#8217;s as follows:<br />
<code><br />
using System;<br />
using Microsoft.Xna.Framework;<br />
using Microsoft.Xna.Framework.Content;<br />
using Microsoft.Xna.Framework.Graphics;<br />
using Microsoft.Xna.Framework.Input;<br />
</code></p>
<p>Next set your class to be public.</p>
<p>Now we can begin by adding some Enums to our class. The first enum will deal with the suit of the cards:<br />
<code><br />
public enum CardSuit<br />
{<br />
             Clubs = 1,<br />
             Diamonds,<br />
             Hearts,<br />
             Spades<br />
}<br />
</code><br />
The next enum will be for the value of the cards:<br />
<code><br />
 public enum CardValue<br />
        {<br />
             Ace = 1,<br />
             Two,<br />
             Three,<br />
             Four,<br />
             Five,<br />
             Six,<br />
             Seven,<br />
             Eight,<br />
             Nine,<br />
             Ten,<br />
             Jack,<br />
             Queen,<br />
             King<br />
        }<br />
</code><br />
The final enum will be for indicating what color the card is:<br />
<code><br />
public enum CardColor<br />
        {<br />
             Black = 1,<br />
             Red<br />
        }<br />
</code></p>
<p>Now we can setup the individual properties that a Card will have, I will show the code first and then proceed to explain what each property is for:<br />
<code></p>
<p>public CardSuit Suit { get; set; }<br />
        public CardValue Value { get; set; }<br />
        public CardColor TheColor { get; set; }<br />
        public Boolean IsTurned { get; set; }<br />
        public Card ParentCard { get; set; }<br />
        public Card ChildCard { get; set; }<br />
        public int ZOrder { get; set; }<br />
        public String CardName { get; set; }<br />
        public Deck OwnerDeck { get; set; }<br />
        public Rectangle OriginRect { get; set; }<br />
        public static int CARD_WIDTH = 80;<br />
        public static int CARD_HEIGHT = 110;<br />
        Texture2D card = null;<br />
        Texture2D cardBack = null;<br />
        Rectangle rect;</p>
<p>        public Rectangle CardRectangle<br />
        {<br />
            get<br />
            {<br />
                return rect;<br />
            }<br />
            set<br />
            {<br />
                rect = value;<br />
            }<br />
        }<br />
</code></p>
<p>The first three will be used to set the enums(Suit, value, and color) for the specific card. IsTurned will be used to determine if the front or the back of the card should be drawn. ParentCard and ChildCard will be used for indicating what card is above and below the card on the screen. ZOrder is similar to the css property z-index and will be used for card drag and drop. Though this game does not have drag and drop capability we are adding the ZOrder property for future use. CardName will be a string that will indicate which artwork to use, it will be made up of concatenating the cards suit with a &#8220;-&#8221; and the cards value. If you choose to use cards other than the ones I provide, please be sure they follow this naming convention. OwnerDeck will refer to which deck the card is currently in (draw pile, plateau, waste, etc&#8230;) this refers to a class that we will develop in part 3 of this series. Teh we have the OriginRect this is a placeholder value so that we always know where the card came from, in case we ever need to return it to that spot. Then we have two static variables for storing the size of the card. Next we have two XNA textures that will store the card image and the back of the card image. Finally we have the rectangle where those card images will be drawn.</p>
<p>Next up is the constructor followed by a description:<br />
<code><br />
public Card(CardSuit suit, CardValue value, int z, ContentManager contentManager)<br />
        {<br />
            ZOrder = z;<br />
            ParentCard = null;<br />
            ChildCard = null;<br />
            OwnerDeck = null;</p>
<p>            LoadCard(suit, value, contentManager);<br />
        }<br />
</code></p>
<p>Since we are just declaring the card and not yet putting it in a deck we will be setting several of the properties to null, and then lastly we call another method to load the cards content based on the suit and value that we passed in.</p>
<p>The cards Load method is detailed next:<br />
<code><br />
 public void LoadCard(CardSuit suit, CardValue value, ContentManager contentManager)<br />
        {<br />
            if (suit == CardSuit.Clubs || suit == CardSuit.Spades)<br />
                TheColor = CardColor.Black;<br />
            else<br />
                TheColor = CardColor.Red;</p>
<p>            Suit = suit;<br />
            Value = value;</p>
<p>            //Set default pos and size<br />
            CardRectangle = new Rectangle(0, 0, CARD_WIDTH, CARD_HEIGHT);</p>
<p>            // Card background<br />
            cardBack = contentManager.Load("Cards/card_background");</p>
<p>            CardName = suit.ToString() + "_" + value.ToString();</p>
<p>            card = contentManager.Load("Cards/" + CardName);<br />
        }<br />
</code></p>
<p>Based on the suit we first determine the cards color, Clubs/Spades are black and Hearts/Diamonds are red. We set the cards suit and value from the passed in parameters and then we create the rectangle that will hold the card texture. Next we load the cards background picture into its texture, and then after determine the cards name we load the card image into its texture.</p>
<p>Finally we have the method that will draw the card to the screen:<br />
<code><br />
public void Draw(SpriteBatch theSpriteBatch)<br />
        {<br />
            if (IsTurned)<br />
            {<br />
                if (card != null)<br />
                    theSpriteBatch.Draw(card, CardRectangle, Color.White);<br />
            }<br />
            else<br />
            {<br />
                if (cardBack != null)<br />
                    theSpriteBatch.Draw(cardBack, CardRectangle, Color.White);<br />
            }<br />
        }<br />
</code><br />
Here we are determining if the card is face up or face down and drawing that particular image to the screen.</p>
<p>That is it right now for our card class. In the future it will be expanded more to handle different input types like drag and drop but for now clicking on the card is all that is necessary.  Also not the reason the card has no coordinates is because it&#8217;s draw location will be based on the location of it&#8217;s stack/deck. Stay tuned for the next part in the series where we will make a deck class.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pearltechnology.com/xna-tutorial-series-1-golf-patience-solitaire-part-i-card-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Improve Website Performance by Using a Single Background Image for Your Whole Website</title>
		<link>http://blog.pearltechnology.com/a-single-background-image-for-your-whole-website/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://blog.pearltechnology.com/a-single-background-image-for-your-whole-website/#comments</comments>
		<pubDate>Fri, 04 Nov 2011 13:38:15 +0000</pubDate>
		<dc:creator>Geer</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Background Image]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://blog.pearltechnology.com/?p=1249</guid>
		<description><![CDATA[How to improve performance of your website by using a single background image...]]></description>
			<content:encoded><![CDATA[<p>Have you ever tried to learn or borrow design ideas from other good websites?  I have.  I happened to see an idea of using one background image for all background images that are needed for the entire website.  I thought it was a very clever idea, so wrote this post to share it.</p>
<p>Basically, you would integrate and organize all little background images that your website needs into one &#8220;big&#8221; (won&#8217;t be too big anyway) image file, like the one shown below.</p>
<p><img class="size-full wp-image-1251 aligncenter" title="Combined Background Image" src="http://blog.pearltechnology.com/wp-content/uploads/2011/11/background.png" alt="Combined Background Image" width="47" height="82" /><br />
It has got some corner images for cornered boxes and a few icons.  All images are combined into this one image file while each one of them is laid out nicely.  Well, it’s nice to look at and organize them that way, but how you can use them?  Suppose you want to use the contact icon in front of some text.  Normally, you could do something like:</p>
<pre name="code" language="XML">
<span style="background:url(images/background.png) no-repeat; padding-left:20px;">Contact Name</span>
</pre>
<p><img class="aligncenter size-full wp-image-1252" title="bg1" src="http://blog.pearltechnology.com/wp-content/uploads/2011/11/bg1.JPG" alt="bg1" width="153" height="39" /></p>
<p>However, with the combined image, it won’t show the background image as expected.</p>
<p>To make it work, you just need to do something like:</p>
<pre name="code" language="XML">
<span style="background:url(images/background.png) no-repeat -25px 0px; padding-left:20px;">Contact Name</span>
</pre>
<p><img class="aligncenter size-full wp-image-1254" title="bg2" src="http://blog.pearltechnology.com/wp-content/uploads/2011/11/bg2.JPG" alt="bg2" width="126" height="32" /></p>
<p>As you can see, it’s fairly easy – you just need to set the position of the background image instead of using the default position, so that only the appropriate background image shows up and rest of the image remains hidden.</p>
<p>Why are you doing this?  I don’t claim that I fully understand the purpose behind this idea, but here is one reason that I can think of: performance.</p>
<p>When you view a web page, everything you see on the screen needs to be downloaded, and each download is initiated by an HTTP request.  The more files you download, the more HTTP requests are needed, and the more load is put on the web server to handle these requests.  Usually, the time spent on processing an HTTP request is much less than the time spent on downloading, but if the file size is small, the processing time for the request will take a big portion of the whole processing time.  In the other words, it will be more efficient to send one request and download a big size file than to send a bunch of requests to download smaller files.  Although it still takes little time for the web server to process a request, it could use a noticeable amount of resources of the web server to handle them, if there are thousands of people hitting your web server.  Also, a web server can only process a certain number of requests at the same time.  If there are 50 background images that are used on most of the pages on your website, the web browser will probably need to send that many requests to download each one of them separately, unless they are already cached by the web browser.  So, if you can combine those 50 files and let the browser only request and download it once, you allow your web server to run more efficiently.  Previously, the web server has to process 50 requests to get those background images to the web browser, but now it only needs to process 1 request, and get the same content to the web browser.  Make sense?</p>
<p>There may be other practical reasons for this idea.  Please share your input below if you find any. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pearltechnology.com/a-single-background-image-for-your-whole-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft Certification Prep Tips</title>
		<link>http://blog.pearltechnology.com/microsoft-certification-prep-tips/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://blog.pearltechnology.com/microsoft-certification-prep-tips/#comments</comments>
		<pubDate>Mon, 09 May 2011 16:47:15 +0000</pubDate>
		<dc:creator>Chad Ferguson</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[70-500]]></category>
		<category><![CDATA[70-501]]></category>
		<category><![CDATA[70-502]]></category>
		<category><![CDATA[70-503]]></category>
		<category><![CDATA[70-504]]></category>
		<category><![CDATA[70-505]]></category>
		<category><![CDATA[70-506]]></category>
		<category><![CDATA[70-507]]></category>
		<category><![CDATA[70-508]]></category>
		<category><![CDATA[70-509]]></category>
		<category><![CDATA[70-510]]></category>
		<category><![CDATA[70-511]]></category>
		<category><![CDATA[70-512]]></category>
		<category><![CDATA[70-513]]></category>
		<category><![CDATA[70-514]]></category>
		<category><![CDATA[70-515]]></category>
		<category><![CDATA[70-516]]></category>
		<category><![CDATA[70-517]]></category>
		<category><![CDATA[70-518]]></category>
		<category><![CDATA[70-519]]></category>
		<category><![CDATA[70-520]]></category>
		<category><![CDATA[70-521]]></category>
		<category><![CDATA[70-522]]></category>
		<category><![CDATA[70-523]]></category>
		<category><![CDATA[70-524]]></category>
		<category><![CDATA[70-525]]></category>
		<category><![CDATA[70-526]]></category>
		<category><![CDATA[70-527]]></category>
		<category><![CDATA[70-528]]></category>
		<category><![CDATA[70-529]]></category>
		<category><![CDATA[70-530]]></category>
		<category><![CDATA[70-531]]></category>
		<category><![CDATA[70-532]]></category>
		<category><![CDATA[70-533]]></category>
		<category><![CDATA[70-534]]></category>
		<category><![CDATA[70-535]]></category>
		<category><![CDATA[70-536]]></category>
		<category><![CDATA[70-537]]></category>
		<category><![CDATA[70-538]]></category>
		<category><![CDATA[70-539]]></category>
		<category><![CDATA[70-540]]></category>
		<category><![CDATA[70-541]]></category>
		<category><![CDATA[70-542]]></category>
		<category><![CDATA[70-543]]></category>
		<category><![CDATA[70-544]]></category>
		<category><![CDATA[70-545]]></category>
		<category><![CDATA[70-546]]></category>
		<category><![CDATA[70-547]]></category>
		<category><![CDATA[70-548]]></category>
		<category><![CDATA[70-549]]></category>
		<category><![CDATA[70-550]]></category>
		<category><![CDATA[70-551]]></category>
		<category><![CDATA[70-552]]></category>
		<category><![CDATA[70-553]]></category>
		<category><![CDATA[70-554]]></category>
		<category><![CDATA[70-555]]></category>
		<category><![CDATA[70-556]]></category>
		<category><![CDATA[70-557]]></category>
		<category><![CDATA[70-558]]></category>
		<category><![CDATA[70-559]]></category>
		<category><![CDATA[70-560]]></category>
		<category><![CDATA[70-561]]></category>
		<category><![CDATA[70-562]]></category>
		<category><![CDATA[70-563]]></category>
		<category><![CDATA[70-564]]></category>
		<category><![CDATA[70-565]]></category>
		<category><![CDATA[70-566]]></category>
		<category><![CDATA[70-567]]></category>
		<category><![CDATA[70-568]]></category>
		<category><![CDATA[70-569]]></category>
		<category><![CDATA[70-570]]></category>
		<category><![CDATA[70-571]]></category>
		<category><![CDATA[70-572]]></category>
		<category><![CDATA[70-573]]></category>
		<category><![CDATA[70-574]]></category>
		<category><![CDATA[70-575]]></category>
		<category><![CDATA[70-576]]></category>
		<category><![CDATA[70-577]]></category>
		<category><![CDATA[70-578]]></category>
		<category><![CDATA[70-579]]></category>
		<category><![CDATA[70-580]]></category>
		<category><![CDATA[70-581]]></category>
		<category><![CDATA[70-582]]></category>
		<category><![CDATA[70-583]]></category>
		<category><![CDATA[70-584]]></category>
		<category><![CDATA[70-585]]></category>
		<category><![CDATA[70-586]]></category>
		<category><![CDATA[70-587]]></category>
		<category><![CDATA[70-588]]></category>
		<category><![CDATA[70-589]]></category>
		<category><![CDATA[70-590]]></category>
		<category><![CDATA[70-591]]></category>
		<category><![CDATA[70-592]]></category>
		<category><![CDATA[70-593]]></category>
		<category><![CDATA[70-594]]></category>
		<category><![CDATA[70-595]]></category>
		<category><![CDATA[70-596]]></category>
		<category><![CDATA[70-597]]></category>
		<category><![CDATA[70-598]]></category>
		<category><![CDATA[70-599]]></category>
		<category><![CDATA[certification]]></category>
		<category><![CDATA[MCITP]]></category>
		<category><![CDATA[MCP]]></category>
		<category><![CDATA[MCPD]]></category>
		<category><![CDATA[MCTS]]></category>

		<guid isPermaLink="false">http://blog.pearltechnology.com/?p=1218</guid>
		<description><![CDATA[In recent years I have luckily been very successful with passing a few of Microsoft&#8217;s certification exams. Like many others when I first attempted certification I went out and acquired the typical textbooks and practice exams, spent several months reading and re-reading, and took the practice exams to the point that I didn&#8217;t even have [...]]]></description>
			<content:encoded><![CDATA[<p>In recent years I have luckily been very successful with passing a few of Microsoft&#8217;s certification exams. Like many others when I first attempted certification I went out and acquired the typical textbooks and practice exams, spent several months reading and re-reading, and took the practice exams to the point that I didn&#8217;t even have to read the question before answering. The result: I failed. A lot of the preparatory textbooks out there just do not cut it when helping you to prepare for the exam. Even though exam requirements usually dictate that you should have anywhere from 1-5 years experience in the particular subject matter, the books always seem to be written for an audience that has 0 years of experience. Much of the time leaving you feeling like the book taught you nothing and the exam content was a lot more in-depth than expected. Plus on top of all of that the exam materials are usually written before the exam is released and does not always cover the required materials as exam content is subject to change. Additionally, some of the preparatory material is known for unfortunately having a long list of errata, which just doesn&#8217;t cut it when you are trying to prepare for an exam. </p>
<p>So that brings me to my solution which is simple and free, and no it is not braindumps which will just hurt you in the long run. Microsoft provides you all you need to prepare by giving you the outline. Utilizing the outline and MSDN it is relatively easy, though very time consuming, to essentially frame out your own book that will be current and error free. So for example lets take a look at the outline for exam <a href="http://www.microsoft.com/learning/en/us/exam.aspx?ID=70-573&#038;locale=en-us">70-573: Microsoft SharePoint 2010, Application Development</a>. The first section deals with interacting with the Sharepoint UI via .NET, more specifically in the first bullet point of utilizing the SPWeb and SPSite objects. What I will do is copy the contents of the outline in to my own html file and proceed to seek out links, preferabbly to the MSDN, detailing the content that the bullet point refers to. So for the example of the 1st bullet point in exam 70-573 the outline has as follows: (Content is subject to change at Microsoft&#8217;s discretion)<br /><strong><br />
This objective may include but is not limited to: creating sub webs, referencing SPFiles, manipulating property bag, when to call Update, referencing SPContext, SPSite, SPWeb,  SPSite.OpenWeb, SPWeb.Webs, feature activiation and deactivation</p>
<p>This objective does not include: trivial cases such as setting title and other loose properties of the objects<br />
</strong></p>
<p>I then proceed to build up my content links similar to what I show here:<br />
<br />
<strong>This objective may include but is not limited to:</strong> </p>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/ms473633.aspx">Site<br />
		Architecture</a></li>
<li>
		<a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfile.aspx">SPFiles</a></li>
<li>
		<a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spcontext.aspx">SPContext</a></li>
<li>
		<a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsite.aspx">SPSite</a></li>
<li>
		<a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsite.features.aspx"><br />
		SPSite.Features</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/ms431062.aspx"><br />
		SPFeatureCollection</a></li>
<li>
		<a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.aspx">SPWeb</a></li>
<li>
		<a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.features.aspx"><br />
		SPWeb.Features</a></li>
<li>
		<a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.properties.aspx"><br />
		SPWeb.Properties</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/ms454879.aspx">SPSite.OpenWeb</a></li>
<li>
		<a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.webs.aspx">SPWeb.Webs</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/ms465759.aspx"><br />
		SPWebCollection</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/ee557362.aspx"><br />
		Disposal</a></li>
</ul>
<p>Not only are you getting the content from the source that the exams are based off, but as you delve deeper and deeper into the MSDN you will get a more fuller and rewarding experience then most of the preparatory textbooks will provide. This has become a popular technique for preparation over the past few years, and sometimes you may find bloggers that will post their MSDN linked outlines online, but usually I prefer to create my own since they may have excluded content that they didnt neccesarily need for their own preperation. So hopefully this technique will help you some in your own preparation, and good luck.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pearltechnology.com/microsoft-certification-prep-tips/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Lessons Learned: XSS Security Scan</title>
		<link>http://blog.pearltechnology.com/lessons-learned-xss-security-scan/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://blog.pearltechnology.com/lessons-learned-xss-security-scan/#comments</comments>
		<pubDate>Mon, 25 Apr 2011 18:25:53 +0000</pubDate>
		<dc:creator>Geer</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Security Scan]]></category>
		<category><![CDATA[XSS]]></category>

		<guid isPermaLink="false">http://blog.pearltechnology.com/?p=1212</guid>
		<description><![CDATA[Lessons learned during cross-site scripting security scan...]]></description>
			<content:encoded><![CDATA[<p>During the code review process for an ASP.NET web application that we built for a client, a cross-site scripting (XSS) security scanner was used to check whether the application was secure enough to survive during XSS attacks.  Fortunately, the application was well designed and coded leaving no chance for the scanner to inject even a single line of script for XSS attack.  Alright, I will be honest with you &#8211; we did found a couple issues during the scan, but we were able to fix them before the application was delivered to our customer.  So, here are the two notes I would like to share:</p>
<ol>
<li><strong>Watch out for those non-ASP.NET components</strong>.  Actually, all ASP.NET components were designed very well and the scanner was not able to inject any script on any page.  The only problem we found was on the error page which accepts some parameters in the query string and displays part of the information on the error page which is a fairly common implementation.  Because it is simply an HTML page and does not contain server-side code, it was overlooked for XSS attack.  The scanner was able to embed scripts in the query string, and had them executed when the error page tried to render them on the page.  Although the error page cannot post any data back to the ASP.NET application itself or insert any data to the database, it is still a security risk.  You never know what hackers can do with this small hole in your site.</li>
<li><strong>DO NOT perform the scan on production database</strong>.  We performed the scan on our QA environment assuming it would not do any harm to our database because it was only for XSS scan.  However, we have found that it entered thousands of records in a table in our database through a page which only requires one field for data entering.  As a result, the scanner tried all possible injection scripts on that page, and entered them all into the table in the database.  Now, we have a list of scripts we can try on other sites to have some fun. : )  So, I guess we shouldn&#8217;t have done this in the QA environment which points to our production database.  Even if we had to do so for whatever reason, we probably should have pointed the application to a test database for the duration of the scan.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.pearltechnology.com/lessons-learned-xss-security-scan/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project Info &#8211; What&#8217;s needed and What&#8217;s not?</title>
		<link>http://blog.pearltechnology.com/project-info-whats-needed-and-whats-not/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://blog.pearltechnology.com/project-info-whats-needed-and-whats-not/#comments</comments>
		<pubDate>Fri, 22 Apr 2011 18:20:43 +0000</pubDate>
		<dc:creator>StaceyC</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">http://blog.pearltechnology.com/?p=1208</guid>
		<description><![CDATA[ As the saying goes, you get what you ask for, and deciding what information is important to get from the team is one of the most important and challenging things for a Project Manager.  Most of the time team members are going to give you no more information than exactly what you are asking them [...]]]></description>
			<content:encoded><![CDATA[<p> As the saying goes, you get what you ask for, and deciding what information is important to get from the team is one of the most important and challenging things for a Project Manager.  Most of the time team members are going to give you no more information than exactly what you are asking them for.  One very important factor is determining what information you really want, and then phrasing the questions so that you will actually get useful information.  For example, if you ask a team member working on a task “How is it going? How are you doing on this task?” – you will most likely get a response like this “I am about 60% done with that or I <em>should </em>be done with that by next Friday”.  What is this information actually telling you?  In my opinion, a whole lot of nothing.  When did they start the task?  What was the original duration on the task?  Are they working full time on this task and this task only?  Maybe a better way to phrase the question to the team member would be…  “When do you expect to be done with the task, on what day?”  The point here is to actually get a date from the team member that they are committing to. </p>
<p>This now leads to inputting this information into the software that you are using to manage your project.  How important is it to understand the software application that you are using to manage your projects?  Not understanding what the software does or how it works can result in giving false information and dates to Sponsors, Stakeholders, and Team Members.  Most software applications have many advanced settings that people do not even know exist.  It is extremely important to figure out how you want to track information in the schedule and set it up correctly before beginning the project.  If you are going to be tracking duration then make sure that the settings are set on fixed duration, or if you are going to be tracking effort worked of the resource then make sure that the settings are set on fixed work, etc.  Trouble will definitely start to arise if these settings are not being used appropriately since this is how the dates are calculated in the software.  This now leads to a lot of other very important questions: 1) Are the calendars in your project set up correctly with all of the holidays and time off?  2) What type of constraints will be used in the plan?  3) Do you understand how these constraints are affecting your project and critical path?  4) How will you be defining critical activities and using critical paths in the plan?  5) Are you using a baseline to be able to show variance and slippage on tasks in the plan?  6) Do you have multiple views set up to fit the needs of the different audiences that will be viewing the plan?  7)  How often will you be updating status on the plan?  <img src='http://blog.pearltechnology.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> How often will you be changing the Data Date in the plan?</p>
<p>As a Project Manager you are managing time, cost, and scope/quality.  Managing any of these without an accurate schedule is very difficult and probably inaccurate.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pearltechnology.com/project-info-whats-needed-and-whats-not/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a custom pipeline component for Biztalk 2010 server (Part 1)</title>
		<link>http://blog.pearltechnology.com/creating-a-custom-pipeline-component-for-biztalk-2010-server-part-1/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://blog.pearltechnology.com/creating-a-custom-pipeline-component-for-biztalk-2010-server-part-1/#comments</comments>
		<pubDate>Fri, 22 Apr 2011 13:34:35 +0000</pubDate>
		<dc:creator>HassanW</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">http://blog.pearltechnology.com/?p=1190</guid>
		<description><![CDATA[This tutorial will show how to create a custom pipeline component for Biztalk server 2010. The pipeline component will be called "PeopleReader". The pipeline task is simple; it is going to consume an xml file on the receive port from a specified location, and then write a modified file to another location.The tutorial is going to cover all aspects of the custom pipeline coding, adding to orchestration, setting up ports, and debugging.]]></description>
			<content:encoded><![CDATA[<p><span style="color: black; font-size: 14pt; text-decoration: underline;"><strong>Custom Pipeline Component in C#:<br />
</strong></span></p>
<p><span style="color:black">Introduction<br />
</span></p>
<p><span style="color:black">This tutorial will show how to create a custom pipeline component for Biztalk server 2010. The pipeline component will be called &#8220;PeopleReader&#8221;. The pipeline task is simple; it is going to consume an xml file on the receive port from a specified location, and then write a modified file to another location.<br />
</span></p>
<p><span style="color:black">The xml content before passing through BizTalk:<br />
</span></p>
<p><span style="font-family:Courier New">&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;ISO-8859-1&#8243;?&gt;<br />
</span></p>
<p><span style="font-family:Courier New">&lt;People&gt;<br />
</span></p>
<p style="margin-left: 36pt"><span style="font-family:Courier New">&lt;FirstName&gt;Peter&lt;/FirstName&gt;<br />
</span></p>
<p style="margin-left: 36pt"><span style="font-family:Courier New">&lt;LastName&gt;Decosta&lt;/LastName&gt;<br />
</span></p>
<p><span style="font-family:Courier New">&lt;/People&gt;<br />
</span></p>
<p><span style="color:black; font-size:12pt">The final xml file after passing through Biztalk :<br />
</span></p>
<p><span style="font-family:Courier New">&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;ISO-8859-1&#8243;?&gt;<br />
</span></p>
<p><span style="font-family:Courier New">&lt;People&gt;<br />
</span></p>
<p style="margin-left: 36pt"><span style="font-family:Courier New">&lt;FirstName&gt;your_First_Name&lt;/FirstName&gt;<br />
</span></p>
<p style="margin-left: 36pt"><span style="font-family:Courier New">&lt;LastName&gt;your_Last_Name&lt;/LastName&gt;<br />
</span></p>
<p><span style="font-family:Courier New">&lt;/People&gt;<br />
</span></p>
<p><span style="color:black">The tutorial is going to cover all aspects of the custom pipeline coding, adding to orchestration, setting up ports, and debugging.<br />
</span></p>
<ol>
<li><span style="color:black">Creating C# project:<br />
</span></li>
</ol>
<p><span style="color:black">Open VS 2010 as administrator then go to &#8220;<strong>New Project</strong>&#8220;, then under Visual C# select Windows then class library, and name it People Reader (fig.1).<br />
</span></p>
<p><img src="http://blog.pearltechnology.com/wp-content/uploads/2011/04/042211_1324_Creatingacu11.png" alt="" /><span style="color:black; font-size:12pt"><br />
</span></p>
<p style="text-align: justify"><span style="color:black; font-size:12pt"><strong>Fig. 1</strong> creating the PeopleReader Class for the Custom Pipeline component<br />
</span></p>
<p style="text-align: justify">1.2 Adding references</p>
<p style="text-align: justify">The first step after the project is created is to add a reference to the BizTalk pipeline. In order to accomplish that, go to solution explorer; right click <strong>&#8220;references &#8220;</strong>then select <strong>&#8220;Add&#8221;</strong>.  On the Add Reference Dialog box select the <strong>&#8220;Browse&#8221;</strong> tab then go to your Biztalk server 2010  installation directory, in the case of this tutorial it&#8217;s <strong>&#8220;C:\Program Files (x86)\Microsoft BizTalk Server 2010&#8243;</strong> then select the reference <strong>&#8220;Microsoft.BizTalk.Pipeline.dll&#8221; </strong>then hit the &#8220;OK&#8221; button (fig2). Then right Click on <strong>&#8220;Class1.cs&#8221;</strong> then <strong>&#8220;rename&#8221;</strong>. Call the file &#8220;<strong>PeopleReader.cs&#8221;. </strong>Next Step is to add the namespaces necessary for this project and these are the following:</p>
<p><span style="font-family:Consolas; font-size:9pt"><span style="color:blue">using</span> System;<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><span style="color:blue">using</span> System.Xml;<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><span style="color:blue">using</span> System.IO;<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><span style="color:blue">using</span> System.Collections;<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><span style="color:blue">using</span> System.Text;<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><span style="color:green">//Biztalk stuff</span><br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><span style="color:blue">using</span> Microsoft.BizTalk.Message.Interop;<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><span style="color:blue">using</span> Microsoft.BizTalk.Component.Interop;<br />
</span></p>
<p><img src="http://blog.pearltechnology.com/wp-content/uploads/2011/04/042211_1324_Creatingacu21.png" alt="" />Fig.2 Adding a reference to <strong>&#8220;Microsoft.BizTalk.Pipeline.dll&#8221;.<br />
</strong></p>
<p style="text-align: justify">In order to build a custom Pipeline class, our Peoplereader class need to inherit from four interfaces which are in no specific order: IComponent, IcomponentUI,IpersistPropertyBag and IbaseComponent.</p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">Public</span><br />
<span style="color:blue">class</span><br />
<span style="color:#2b91af">PeopleReader</span>: <span style="color:#2b91af">IbaseComponent</span><br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> ,<span style="color:#2b91af">IcomponentUI</span><br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> ,<span style="color:#2b91af">IpersistPropertyBag</span><br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> ,<span style="color:#2b91af">IcomponentUI</span><br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> {<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> }<br />
</span></p>
<p style="text-align: justify">Since this is a small project all the code can be in one file, however, in case the pipeline required heavy coding, I would recommend declaring the people reader class as partial, then separating the code to different files each inheriting from a different Interface, that will greatly facilitate readability, and scalability since multiple developer could be working on different parts of the Custom Pipeline.</p>
<p style="text-align: justify">Our next step is to declare that this class is going to a Pipeline component we do that by adding the following:[<span style="color:#2b91af">ComponentCategory</span>(<span style="color:#2b91af">CategoryTypes</span>.CATID_PipelineComponent)]  above the class declaration. Then we define where in the pipeline this component will go, by adding [<span style="color:#2b91af">ComponentCategory</span>(<span style="color:#2b91af">CategoryTypes</span>.CATID_Decoder)] which means that the component can only be added in the decoder stage of a receive pipeline. Last we need to create a &#8220;GUID&#8221; since it&#8217;s required for use in COM interop. To generate a new &#8220;GUID&#8221; go to the Tools Menu, then select the &#8220;Create GUID&#8221; Option, select GUID format 6 then hit copy (fig. 3). Paste the new GUID in [System.Runtime.InteropServices.<span style="color:#2b91af">Guid</span>(<span style="color:#a31515">"0D212B7D-F3E9-418B-92BA-9FBC36CF2948"</span>)] right above the class declaration.</p>
<p style="text-align: justify">
<p style="text-align: justify"><img src="http://blog.pearltechnology.com/wp-content/uploads/2011/04/042211_1324_Creatingacu31.png" alt="" /><span style="font-family:Consolas; font-size:9pt"><br />
</span></p>
<p>Fig.3 Creating a new GUID</p>
<ol>
<li>
<div style="text-align: justify">Defining public properties</div>
<p style="text-align: justify">
</li>
</ol>
<p style="text-align: justify">After adding the GUID, we declare two private member strings (m_FirstName, m_LastName) along with their (get, set) properties.  Those properties will allow the user to modify the content of &lt;FirstName&gt; and &lt;LastName&gt; Tags by exposing the properties to the pipeline designer at design time.</p>
<p style="text-align: justify">Your code should look like this at this point</p>
<p style="text-align: justify">
<p><span style="font-family:Consolas; font-size:9pt"> [<span style="color:#2b91af">ComponentCategory</span>(<span style="color:#2b91af">CategoryTypes</span>.CATID_PipelineComponent)]<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> [<span style="color:#2b91af">ComponentCategory</span>(<span style="color:#2b91af">CategoryTypes</span>.CATID_Decoder)]<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> [System.Runtime.InteropServices.<span style="color:#2b91af">Guid</span>(<span style="color:#a31515">"0D212B7D-F3E9-418B-92BA-9FBC36CF2948"</span>)]<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">public</span><br />
<span style="color:blue">partial</span><br />
<span style="color:blue">class</span><br />
<span style="color:#2b91af">PeopleReader</span>: <span style="color:#2b91af">IBaseComponent</span><br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> ,<span style="color:#2b91af">IcomponentUI</span><br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> ,<span style="color:#2b91af">IpersistPropertyBag</span><br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> ,<span style="color:#2b91af">IcomponentUI</span><br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> {<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">private</span><br />
<span style="color:blue">string</span> m_FirstName;<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">private</span><br />
<span style="color:blue">string</span> m_LastName;<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">public</span><br />
<span style="color:blue">string</span> FirstName<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> {<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">get</span><br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> {<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">return</span> m_FirstName;<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> }<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">set</span><br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> {<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> m_FirstName = <span style="color:blue">value</span>;<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> }<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> }<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">public</span><br />
<span style="color:blue">string</span> LastName<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> {<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">get</span><br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> {<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">return</span> m_LastName;<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> }<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">set</span><br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> {<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> m_LastName = <span style="color:blue">value</span>;<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> }<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> }<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> }<br />
</span></p>
<p>1.4 Defining the IBaseComponent Members</p>
<p style="text-align: justify">Next we will define the IBaseComponent members. For ease of readability we create a new region then define the properties Description, Name, and version which represent the description for the Pipeline component we are creating, the Name as it will be seen in the BizTalk project and the version number.</p>
<p><span style="font-family:Consolas; font-size:9pt"><span style="color:blue"> #region</span> IBaseComponent members<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">public</span><br />
<span style="color:blue">string</span> Description<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> {<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">get</span><br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> {<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">return</span><br />
<span style="color:#a31515">&#8220;Pipeline component to Read XML with Peoples Name&#8221;</span>;<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> }<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> }<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">public</span><br />
<span style="color:blue">string</span> Name<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> {<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">get</span><br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> {<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">return</span><br />
<span style="color:#a31515">&#8220;PeopleReader Test Pipeline&#8221;</span>;<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> }<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> }<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">public</span><br />
<span style="color:blue">string</span> Version<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> {<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">get</span><br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> {<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">return</span><br />
<span style="color:#a31515">&#8220;1.0.0.0&#8243;</span>;<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> }<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> }<br />
</span></p>
<p><span style="color:blue; font-family:Consolas; font-size:9pt"> #endregion<br />
</span></p>
<ol>
<li>Defining the IComponentUI Members</li>
</ol>
<p style="text-align: justify">Next up is the IcomponentUI interface members, which contains the icon that will show up in Biztalk toolbox for pipeline and a validate method. We are going to define the icon to be the default system icon, and as far as validation we are not going to add any validation at this stage.</p>
<p><span style="font-family:Consolas; font-size:9pt"><span style="color:blue">#region</span> IcomponentUI members<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">public</span><br />
<span style="color:#2b91af">IntPtr</span> Icon<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> {<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">get</span><br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> {<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">return</span><br />
<span style="color:blue">new</span> System.<span style="color:#2b91af">IntPtr</span>();<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> }<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> }<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">public</span><br />
<span style="color:#2b91af">Ienumerator</span> Validate(<span style="color:blue">object</span> projectSystem)<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> {<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">return</span><br />
<span style="color:blue">null</span>;<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> }<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><span style="color:blue"> #endregion</span><br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> }<br />
</span></p>
<p>1.6 Defining the IPersistPropertyBag Members</p>
<p>IPersistPropertyBag Has 4 methods: GetClassID, InitNew, Load and Save</p>
<p>GetClassID: return a unique ID (the GUID we defined earlier) that represents the component</p>
<p>InitNew: used to establish structures (data, caching..) used by other IPersistPropertyBag methods, we are going to leave it blank for this tutorial</p>
<p>Load: used to load the properties values (in this case the value the user enters at design time)</p>
<p>Save: same as load but used to save the values.</p>
<p>In the code below I used two helper functions ReadPropertyBag and WritePropertyBag that are called from within the Load and Save methods.</p>
<p><span style="font-family:Consolas; font-size:9pt"><span style="color:blue"> #region</span> IPersistPropertyBag members<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">public</span><br />
<span style="color:blue">void</span> GetClassID(<span style="color:blue">out</span><br />
<span style="color:#2b91af">Guid</span> classID)<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> {<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> classID = <span style="color:blue">new</span><br />
<span style="color:#2b91af">Guid</span>(<span style="color:#a31515">&#8220;0D212B7D-F3E9-418B-92BA-9FBC36CF2948&#8243;</span>);<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> }<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">public</span><br />
<span style="color:blue">void</span> InitNew()<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> {<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> }<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">public</span><br />
<span style="color:blue">void</span> Load(<span style="color:#2b91af">IPropertyBag</span> propertyBag, <span style="color:#2b91af">Int32</span> errorLog)<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> {<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">string</span> val = (<span style="color:blue">string</span>)ReadPropertyBag(propertyBag, <span style="color:#a31515">&#8220;FirstName&#8221;</span>);<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">if</span> (val != <span style="color:blue">null</span>)<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> m_FirstName = val;<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">else</span><br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> m_FirstName = <span style="color:#a31515">&#8220;N/A&#8221;</span>;<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> val = (<span style="color:blue">string</span>)ReadPropertyBag(propertyBag, <span style="color:#a31515">&#8220;LastName&#8221;</span>);<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">if</span> (val != <span style="color:blue">null</span>)<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> m_LastName = val;<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">else</span><br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> m_LastName = <span style="color:#a31515">&#8220;N/A&#8221;</span>;<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> }<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">public</span><br />
<span style="color:blue">void</span> Save(<span style="color:#2b91af">IPropertyBag</span> propertyBag, <span style="color:blue">bool</span> clearDirty, <span style="color:blue">bool</span> saveAllProperties)<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> {<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">object</span> val = (<span style="color:blue">object</span>)m_FirstName;<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> WritePropertyBag(propertyBag,<span style="color:#a31515">&#8220;FirstName&#8221;</span>,val);<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> val=(<span style="color:blue">object</span>)m_LastName;<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> WritePropertyBag(propertyBag,<span style="color:#a31515">&#8220;LastName&#8221;</span>,val);<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> }<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">private</span><br />
<span style="color:blue">static</span><br />
<span style="color:blue">object</span> ReadPropertyBag(<span style="color:#2b91af">IPropertyBag</span> propertyBag, <span style="color:blue">string</span> propertyName)<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> {<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">object</span> val = <span style="color:blue">null</span>;<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">try</span><br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> {<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> propertyBag.Read(propertyName, <span style="color:blue">out</span> val, 0);<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> }<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">catch</span> (<span style="color:#2b91af">ArgumentException</span>)<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> {<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">return</span> val;<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> }<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">catch</span> (<span style="color:#2b91af">Exception</span> ex)<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> {<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">throw</span><br />
<span style="color:blue">new</span><br />
<span style="color:#2b91af">ApplicationException</span>(<span style="color:#a31515">&#8220;Error reading propertybag: &#8220;</span> + ex.Message);<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> }<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">return</span> val;<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> }<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><span style="color:blue">private</span><br />
<span style="color:blue">static</span><br />
<span style="color:blue">void</span> WritePropertyBag(<span style="color:#2b91af">IPropertyBag</span> propertyBag, <span style="color:blue">string</span> propertyName, <span style="color:blue">object</span> val)<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> {<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">try</span><br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> {<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> propertyBag.Write(propertyName, <span style="color:blue">ref</span> val);<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> }<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">catch</span> (<span style="color:#2b91af">Exception</span> ex)<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> {<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">throw</span><br />
<span style="color:blue">new</span><br />
<span style="color:#2b91af">ApplicationException</span>(<span style="color:#a31515">&#8220;Error Writing propertybag: &#8220;</span> + ex.Message);<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> }<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> }<br />
</span></p>
<p><span style="color:blue; font-family:Consolas; font-size:9pt"> #endregion<br />
</span></p>
<p style="text-align: justify">1.7 Defining IComponent Members</p>
<p style="text-align: justify">Finally the most important Interface of the custom pipeline Icomponent which has one method Execute. BizTalk calls the execute method to process the message, and then passes the context of the message and the message.</p>
<p><span style="font-family:Consolas; font-size:9pt"><span style="color:blue">#region</span> Icomponent members<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">public</span><br />
<span style="color:#2b91af">IbaseMessage</span> Execute(<span style="color:#2b91af">IpipelineContext</span> pContext, <span style="color:#2b91af">IbaseMessage</span> pInMsg)<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> {<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:#2b91af">IbaseMessagePart</span> bodyPart = pInMsg.BodyPart;<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:#2b91af">StringBuilder</span> outputMessageText = <span style="color:blue">null</span>;<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">if</span> (bodyPart != <span style="color:blue">null</span>)<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> {<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:#2b91af">Stream</span> originalStream = bodyPart.GetOriginalDataStream();<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">if</span> (originalStream != <span style="color:blue">null</span>)<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> {<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:#2b91af">XmlDocument</span> xdoc = <span style="color:blue">new</span><br />
<span style="color:#2b91af">XmlDocument</span>();<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> xdoc.Load(originalStream);<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:#2b91af">XmlElement</span> root = xdoc.DocumentElement;<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:#2b91af">XmlNodeList</span> firstName = xdoc.GetElementsByTagName(<span style="color:#a31515">&#8220;FirstName&#8221;</span>);<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:#2b91af">XmlNodeList</span> lastName = xdoc.GetElementsByTagName(<span style="color:#a31515">&#8220;LastName&#8221;</span>);<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> outputMessageText = <span style="color:blue">new</span><br />
<span style="color:#2b91af">StringBuilder</span>();<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> outputMessageText.Append(<span style="color:#a31515">&#8220;&lt;?xml version=\&#8221;1.0\&#8221;<br />
</span></span></p>
<p style="margin-left: 72pt"><span style="font-family:Consolas; font-size:9pt"><span style="color:#a31515">encoding=\&#8221;ISO-8859-1\&#8221;?&gt;&#8221;</span>);<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> outputMessageText.Append(<span style="color:#a31515">&#8220;&lt;&#8221;</span> + root.Name + <span style="color:#a31515">&#8220;&gt;&#8221;</span>);<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> outputMessageText.Append(<span style="color:#a31515">&#8220;&lt;&#8221;</span> + firstName[0].Name + <span style="color:#a31515">&#8220;&gt;&#8221;</span><br />
</span></p>
<p style="margin-left: 72pt"><span style="font-family:Consolas; font-size:9pt"> + <span style="color:blue">this</span>.m_FirstName + <span style="color:#a31515">&#8220;&lt;/&#8221;</span> + firstName[0].Name + <span style="color:#a31515">&#8220;&gt;&#8221;</span>);<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> outputMessageText.Append(<span style="color:#a31515">&#8220;&lt;&#8221;</span> + lastName[0].Name + <span style="color:#a31515">&#8220;&gt;&#8221;</span><br />
</span></p>
<p style="margin-left: 36pt"><span style="font-family:Consolas; font-size:9pt"> + <span style="color:blue">this</span>.m_LastName  + <span style="color:#a31515">&#8220;&lt;/&#8221;</span> + lastName[0].Name + <span style="color:#a31515">&#8220;&gt;&#8221;</span>);<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> outputMessageText.Append(<span style="color:#a31515">&#8220;&lt;/&#8221;</span> + root.Name + <span style="color:#a31515">&#8220;&gt;&#8221;</span>);<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">byte</span>[] outBytes =<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> System.Text.<span style="color:#2b91af">Encoding</span>.ASCII.GetBytes(outputMessageText.ToString());<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:#2b91af">MemoryStream</span> memStream = <span style="color:blue">new</span><br />
<span style="color:#2b91af">MemoryStream</span>();<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> memStream.Write(outBytes, 0, outBytes.Length);<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> memStream.Position = 0;<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> bodyPart.Data = memStream;<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> pContext.ResourceTracker.AddResource(memStream);<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> }<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> }<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
<span style="color:blue">return</span> pInMsg;<br />
</span></p>
<p><span style="font-family:Consolas; font-size:9pt"> }<br />
</span></p>
<p><span style="color:blue; font-family:Consolas; font-size:9pt"> #endregion<br />
</span></p>
<p style="text-align: justify">
<p style="text-align: justify">1.8 Compilation and strong key creation for Assembly</p>
<p style="text-align: justify">Finally we can compile the code and check that the solution build succeeded. Next step though is to assign a key to the assembly.</p>
<p style="text-align: justify">Start the &#8220;Visual Studio&#8221; command prompt (fig 1.4). Make sure it&#8217;s not the windows command prompt!!!</p>
<p style="text-align: justify"><img src="http://blog.pearltechnology.com/wp-content/uploads/2011/04/042211_1324_Creatingacu41.png" alt="" /><span style="font-size:12pt"><br />
</span></p>
<p style="text-align: justify">Fig.1.4 starting the VS command Prompt</p>
<p style="text-align: justify">Go to the directory where your solution is, to do that type CD\ + whatever_your_directory_is  in our case it&#8217;s CD\ Users\yourusername\Documents\Visual Studio 2010\Projects then hit enter. For the simplicity I am going to create a key under C:\temp (fig. 5)</p>
<p style="text-align: justify"><img src="http://blog.pearltechnology.com/wp-content/uploads/2011/04/042211_1324_Creatingacu51.png" alt="" /><span style="font-size:12pt"><br />
</span></p>
<p style="text-align: justify">Fig. 5 creating a strong key</p>
<p style="text-align: justify">After the key is created go to solution explorer, then right click on your project and select properties. Select the signing tab then check the &#8220;sign assembly&#8221; check box, and from the drop down menu select browse, then navigate to where you create your strong key (fig. 6).</p>
<p style="text-align: justify"><img src="http://blog.pearltechnology.com/wp-content/uploads/2011/04/042211_1324_Creatingacu61.png" alt="" /><span style="font-size:12pt"><br />
</span></p>
<p style="text-align: justify">Fig. 6 attaching the strong key to the assembly</p>
<p style="text-align: justify">
<p style="text-align: justify">Then compile again!</p>
<p style="text-align: justify"><span style="font-size:12pt"><br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pearltechnology.com/creating-a-custom-pipeline-component-for-biztalk-2010-server-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting out of a bind &#8212; with bindings</title>
		<link>http://blog.pearltechnology.com/getting-out-of-a-bind-with-bindings/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://blog.pearltechnology.com/getting-out-of-a-bind-with-bindings/#comments</comments>
		<pubDate>Tue, 12 Apr 2011 12:12:52 +0000</pubDate>
		<dc:creator>RobB</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Bindings]]></category>
		<category><![CDATA[Converters]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[XAML]]></category>

		<guid isPermaLink="false">http://blog.pearltechnology.com/?p=1152</guid>
		<description><![CDATA[Converters in WPF are quite possibly the most useful tool that I&#8217;ve used in the relatively short time I&#8217;ve spent developing WPF applications.  They give the ability to format data, style controls, and more, based on the value supplied from a binding.  And it doesn&#8217;t even have to be a binding to a data source.  [...]]]></description>
			<content:encoded><![CDATA[<p>Converters in WPF are quite possibly the most useful tool that I&#8217;ve used in the relatively short time I&#8217;ve spent developing WPF applications.  They give the ability to format data, style controls, and more, based on the value supplied from a binding.  And it doesn&#8217;t even have to be a binding to a data source.  You can bind to a property of another control on the page.  Lets take a look at a couple of examples.</p>
<p><span style="text-decoration: underline;">Setting a property based on a data value:</span></p>
<p>In this example, we have a label on a form that will display a dollar amount from our data source.  If the dollar amount is negative we want the label&#8217;s background to be red, and green if the value is positive.  To do this, we simply create a converter class in our code behind page.  This will use the numeric value and return a Brush object which we will use in our label&#8217;s Background property.  Here&#8217;s the code for the converter:</p>
<p style="text-align: center;"><img class="size-large wp-image-1153 aligncenter" title="cellbackgroundconverter" src="http://blog.pearltechnology.com/wp-content/uploads/2011/04/cellbackgroundconverter-1024x312.jpg" alt="cellbackgroundconverter" width="1024" height="312" /></p>
<p>We then have to create a simple reference to our converter class in our ResourceDictionary in the Window.Resources section of our XAML:</p>
<p><img class="alignnone size-full wp-image-1154" title="converterdefinition" src="http://blog.pearltechnology.com/wp-content/uploads/2011/04/converterdefinition.JPG" alt="converterdefinition" width="397" height="30" /></p>
<p>So far so good.  Now all we have to do is bind the label&#8217;s background property to the converter and data value.  Notice that we have to bind both the label&#8217;s content (text) and background to the Amount value from our data context.  We also can set the ContentStringFormat property to automatically format the value as currency:</p>
<p style="text-align: center;"><img class="size-full wp-image-1155 aligncenter" title="labelwithconverterbinding" src="http://blog.pearltechnology.com/wp-content/uploads/2011/04/labelwithconverterbinding.JPG" alt="labelwithconverterbinding" width="709" height="39" /></p>
<p><span style="text-decoration: underline;">Setting a property based on another control&#8217;s property:</span></p>
<p>This method is useful when there isn&#8217;t a data field to bind to, but there is a need to conditionally set a control&#8217;s property.  Let&#8217;s assume we need to set a button control&#8217;s IsEnabled property based on a check box&#8217;s IsChecked property:</p>
<p style="text-align: center;"><img class="size-full wp-image-1158 aligncenter" title="bindingtocontrolproperties" src="http://blog.pearltechnology.com/wp-content/uploads/2011/04/bindingtocontrolproperties1.JPG" alt="bindingtocontrolproperties" width="754" height="144" /></p>
<p>As you can see, we&#8217;ve bound the IsEnabled property of the buttons to the IsChecked property of  the check box by specifying the ElementName (control&#8217;s name) and Path (control&#8217;s property).  We also bound the Content property of the button to the same IsChecked property using the same method, to show the current state of the button (which the framework automatically converts from a boolean to a string).  The best part about this method?  No code behind!  Here&#8217;s the result:</p>
<p style="text-align: center;"><img class="size-full wp-image-1159 aligncenter" title="bindingtocontrolpropertiesresult" src="http://blog.pearltechnology.com/wp-content/uploads/2011/04/bindingtocontrolpropertiesresult.JPG" alt="bindingtocontrolpropertiesresult" width="115" height="101" /></p>
<p style="text-align: left;">This is a very simple overview of the power of converters and bindings, and how they can be used to help you do more than just display the data on your page.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pearltechnology.com/getting-out-of-a-bind-with-bindings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

