<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">dot net miscellany</title><subtitle type="html" /><id>http://blogs.msdn.com/jowardel/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/jowardel/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/jowardel/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2008-04-16T16:41:00Z</updated><entry><title>ASP.NET MVC + RSS ActionResult</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/jowardel/archive/2009/03/11/asp-net-rss-actionresult.aspx" /><id>http://blogs.msdn.com/jowardel/archive/2009/03/11/asp-net-rss-actionresult.aspx</id><published>2009-03-11T17:39:00Z</published><updated>2009-03-11T17:39:00Z</updated><content type="html">&lt;p&gt;ASP.NET’s new MVC framework (currently at &lt;a href="http://go.microsoft.com/fwlink/?LinkId=144443" target="_blank"&gt;RC2 release&lt;/a&gt;) makes syndicating your data ridiculously simple to implement.&lt;/p&gt; &lt;h4&gt;&lt;u&gt;A Trivial Example&lt;/u&gt;&lt;/h4&gt; &lt;p&gt;For example, in a trivial blogging MVC site your ‘Home’ Controller may have a ‘Posts’ Action handler, so when you navigate to ‘http://server/home/posts’ the ‘Posts’ action handler will retrieve all blog posts (or the 5 most recent) and set them as the View’s Model data. &lt;/p&gt; &lt;p&gt;Also, if your ‘Posts’ Action handler accepts an int32 parameter you could view a specific blog entry by navigating to ‘http://server/home/posts/123’. In this case, the&amp;nbsp; ‘Posts’ action handler will retrieve only post number ‘123’ and will set that post as the View’s Model data.&lt;/p&gt; &lt;p&gt;ASP.NET MVC allows you to return the Model data retrieved by the Controller in a variety of ‘out-of-the-box’ formats, including the ASPX, JSON, Plain Text etc.&lt;/p&gt; &lt;p&gt;There isn’t currently an RSS/Atom ActionResult (which is what every Action Handler in a Controller must return), but its really easy to ‘roll your own’. See the steps below.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h4&gt;&lt;u&gt;Implementation&lt;/u&gt;&lt;/h4&gt; &lt;h5&gt;1) Build your own RssResult : ActionResult&lt;/h5&gt; &lt;p&gt;Firstly, you need to create a new class and derive from the abstract class ActionResult. I’ve called mine ‘RssResult’. Create it wherever you see fit, but I just put mine in the Controllers namespace.&lt;/p&gt; &lt;p&gt;The only method you need to override in your new derived class is the ‘ExecuteResult’ method. This method effectively creates the output (be it; HTML, JSON, Plain Text etc) which is to be returned to the client.&lt;/p&gt; &lt;p&gt;So in our overriden ‘ExecuteResult’ method, we first set the response’s content type to ‘application/rss+xml’, then pass our syndication feed to the Rss20FeedFormatter which is part of WCF’s System.ServiceModel.Syndication namespace. &lt;/p&gt; &lt;p&gt;This formats all our syndication feed data into RSS compliant XML which is then written to the response stream, which eventually will be returned to the calling client.&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;namespace &lt;/span&gt;RssMvc.Controllers
{
    &lt;span style="color: blue"&gt;using &lt;/span&gt;System;
    &lt;span style="color: blue"&gt;using &lt;/span&gt;System.Collections.Generic;
    &lt;span style="color: blue"&gt;using &lt;/span&gt;System.Linq;
    &lt;span style="color: blue"&gt;using &lt;/span&gt;System.Web;
    &lt;span style="color: blue"&gt;using &lt;/span&gt;System.Web.Mvc;
    &lt;span style="color: blue"&gt;using &lt;/span&gt;System.ServiceModel.Syndication;
    &lt;span style="color: blue"&gt;using &lt;/span&gt;System.Xml;

    &lt;span style="color: blue"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;RssResult &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;ActionResult
    &lt;/span&gt;{
        &lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;SyndicationFeed &lt;/span&gt;Feed { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; }

        &lt;span style="color: blue"&gt;public &lt;/span&gt;RssResult() { }

        &lt;span style="color: blue"&gt;public &lt;/span&gt;RssResult(&lt;span style="color: #2b91af"&gt;SyndicationFeed &lt;/span&gt;feed)
        {
            &lt;span style="color: blue"&gt;this&lt;/span&gt;.Feed = feed;
        }

        &lt;span style="color: blue"&gt;public override void &lt;/span&gt;ExecuteResult(&lt;span style="color: #2b91af"&gt;ControllerContext &lt;/span&gt;context)
        {
            context.HttpContext.Response.ContentType = &lt;span style="color: #a31515"&gt;"application/rss+xml"&lt;/span&gt;;

            &lt;span style="color: #2b91af"&gt;Rss20FeedFormatter &lt;/span&gt;formatter = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Rss20FeedFormatter&lt;/span&gt;(&lt;span style="color: blue"&gt;this&lt;/span&gt;.Feed);

            &lt;span style="color: blue"&gt;using &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;XmlWriter &lt;/span&gt;writer = &lt;span style="color: #2b91af"&gt;XmlWriter&lt;/span&gt;.Create(context.HttpContext.Response.Output))
            {
                formatter.WriteTo(writer);
            }
        }
    }
}&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h5&gt;2) Add a new Action Handler in your Controller&lt;/h5&gt;
&lt;p&gt;Next, create a new Controller Action inside your ‘Home’ controller (or whatever controller you want). &lt;/p&gt;
&lt;p&gt;Inside the Action we will create the syndication feed and syndication items therein. (in my example, I’m creating a few dummy feed items, but in the real-world you would make a call to the Model to return this data).&lt;/p&gt;
&lt;p&gt;Once you have created your Syndication feed and feed items (once again using the System.ServiceModel.Syndication namespace), return an instance of your new RssResult, passing your feed.&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ActionResult &lt;/span&gt;Rss()
{
    &lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;SyndicationItem&lt;/span&gt;&amp;gt; items = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;SyndicationItem&lt;/span&gt;[] 
    {
        &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;SyndicationItem&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"Blog 1"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"Joe's 1st Blog"&lt;/span&gt;, &lt;span style="color: blue"&gt;null&lt;/span&gt;),
        &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;SyndicationItem&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"Blog 1"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"Joe's 1st Blog"&lt;/span&gt;, &lt;span style="color: blue"&gt;null&lt;/span&gt;),
        &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;SyndicationItem&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"Blog 1"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"Joe's 1st Blog"&lt;/span&gt;, &lt;span style="color: blue"&gt;null&lt;/span&gt;)
    }.ToList();

    &lt;span style="color: #2b91af"&gt;SyndicationFeed &lt;/span&gt;feed = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;SyndicationFeed&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"Joe's Blog Posts"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"http://blogs.msdn.com/jowardel RSS Feed"&lt;/span&gt;,Request.Url, items);
                

    &lt;span style="color: blue"&gt;return new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;RssResult&lt;/span&gt;(feed);
}
&lt;/pre&gt;
&lt;h5&gt;&amp;nbsp;&lt;/h5&gt;
&lt;h5&gt;3) Done! – People can subscribe to your Blogs by RSS&lt;/h5&gt;
&lt;p&gt;So now when you navigate to ‘server/home/rss’ your ‘Rss’ action is invoked inside the ‘Home’ controller, which creates the feed and passes it to the RssResult which formats it and writes it to the HttpContext’s Response stream to be rendered in your browser of choice!&lt;/p&gt;
&lt;p&gt;Comment or contact me direct if you have any questions, suggestions etc – I’d be interested in hearing from you. Hope this helps.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jowardel/WindowsLiveWriter/ASP.NETRSS_9522/image_4.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://blogs.msdn.com/blogfiles/jowardel/WindowsLiveWriter/ASP.NETRSS_9522/image_thumb_1.png" width="755" height="596"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Code available here: &lt;/p&gt;
&lt;p&gt;&lt;iframe style="border-bottom: #dde5e9 1px solid; border-left: #dde5e9 1px solid; padding-bottom: 0px; background-color: #ffffff; margin: 3px; padding-left: 0px; width: 240px; padding-right: 0px; height: 66px; border-top: #dde5e9 1px solid; border-right: #dde5e9 1px solid; padding-top: 0px" marginheight="0" src="http://cid-109ddf8b2e86eadf.skydrive.live.com/embedrowdetail.aspx/blog/RssMvc.zip" frameborder="0" marginwidth="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9470626" width="1" height="1"&gt;</content><author><name>jowardel</name><uri>http://blogs.msdn.com/members/jowardel.aspx</uri></author><category term="Patterns and Practices" scheme="http://blogs.msdn.com/jowardel/archive/tags/Patterns+and+Practices/default.aspx" /><category term="ASP.NET MVC" scheme="http://blogs.msdn.com/jowardel/archive/tags/ASP.NET+MVC/default.aspx" /><category term="MVC" scheme="http://blogs.msdn.com/jowardel/archive/tags/MVC/default.aspx" /><category term="ActionResult" scheme="http://blogs.msdn.com/jowardel/archive/tags/ActionResult/default.aspx" /><category term="Syndication" scheme="http://blogs.msdn.com/jowardel/archive/tags/Syndication/default.aspx" /><category term="RSS" scheme="http://blogs.msdn.com/jowardel/archive/tags/RSS/default.aspx" /></entry><entry><title>ASP.NET MVC + Silverlight</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/jowardel/archive/2009/03/09/asp-net-mvc-silverlight.aspx" /><id>http://blogs.msdn.com/jowardel/archive/2009/03/09/asp-net-mvc-silverlight.aspx</id><published>2009-03-09T18:29:00Z</published><updated>2009-03-09T18:29:00Z</updated><content type="html">&lt;p&gt;I’ve recently been playing around with ASP.NET’s new MVC (Model View Controller) framework and have to say, its pretty cool. You can find MVC downloads, tutorials and other errata &lt;a href="http://www.asp.net/mvc/" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;However, I ran into abit of a problem with MVC when using Silverlight applications inside MVC Views. Views should simply display the Model data passed to it by the Controller using (as illustrated in diagram 1).&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;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;Content &lt;/span&gt;&lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;="indexContent" &lt;/span&gt;&lt;span style="color: red"&gt;ContentPlaceHolderID&lt;/span&gt;&lt;span style="color: blue"&gt;="MainContent" &lt;/span&gt;&lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;h2&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;= &lt;/span&gt;Html.Encode(ViewData[&lt;span style="color: #a31515"&gt;"Message"&lt;/span&gt;]) &lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;h2&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;p&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
        &lt;/span&gt;To learn more about ASP.NET MVC visit &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;a &lt;/span&gt;&lt;span style="color: red"&gt;href&lt;/span&gt;&lt;span style="color: blue"&gt;="http://asp.net/mvc" &lt;/span&gt;&lt;span style="color: red"&gt;title&lt;/span&gt;&lt;span style="color: blue"&gt;="ASP.NET MVC Website"&amp;gt;&lt;/span&gt;http://asp.net/mvc&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;a&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;.
    &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;p&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;Content&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&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you want your View to contain a Silverlight app that contains no Model data, then there’s no problem. Simply embed the Silverlight into the ASPX View using either the raw HTML or the ASP.NET Silverlight control and it works.&lt;/p&gt;
&lt;p&gt;However, the problem comes when you want the Silverlight app to display/manipulate/use the Model data passed to the View by the Controller. You can of course get the Model data into Silverlight using web service calls or by making HTTP requests from Silverlight to your Controller (as illustrated by Tim Heuer in &lt;a href="http://timheuer.com/blog/archive/2009/02/09/silverlight-as-a-view-in-aspnet-mvc.aspx" target="_blank"&gt;this post&lt;/a&gt;), but this violates the MVC pattern. Ideally your Silverlight app should work in a similar way to the MVC Views, simply displaying the data that is passed to it.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So, how do you initialise Silverlight with the data it needs? Well, I found that I could pass all the data my Silverlight app needed to display using the ‘initParams’! – sneaky huh.&lt;/p&gt;
&lt;p&gt;Basically, these are the steps involved:&lt;/p&gt;
&lt;h5&gt;Controller&lt;/h5&gt;
&lt;ul&gt;
&lt;li&gt;Create your custom Action inside your Controller (in this example, the controller is ‘Home’ and the Action is ‘Search')&lt;br&gt;
&lt;li&gt;The Controller invokes the Search function in the appropriate Model&lt;br&gt;
&lt;li&gt;The Model returns the search results to the Controller&lt;br&gt;
&lt;li&gt;The Controller returns the ActionResult containing the Search Results as the View’s Model data&lt;/li&gt;&lt;/ul&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ActionResult &lt;/span&gt;Search()
{
    &lt;span style="color: green"&gt;// Call Model to do Search

    // Set results as View's Model data (we're using dummy data)
    &lt;/span&gt;ViewData.Model = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;SearchResult&lt;/span&gt;[] 
    {
        &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;SearchResult&lt;/span&gt;(){Title=&lt;span style="color: #a31515"&gt;"Search Result 1"&lt;/span&gt;, Relevance=100}, 
        &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;SearchResult&lt;/span&gt;(){Title=&lt;span style="color: #a31515"&gt;"Search Result 2"&lt;/span&gt;, Relevance=75}, 
        &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;SearchResult&lt;/span&gt;(){Title=&lt;span style="color: #a31515"&gt;"Search Result 3"&lt;/span&gt;, Relevance=100} 
    }.ToList();

    &lt;span style="color: green"&gt;// Return View ActionResult containing our Model Data
    &lt;/span&gt;&lt;span style="color: blue"&gt;return &lt;/span&gt;View();
}&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;pre class="csharpcode"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;h5&gt;View&lt;/h5&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;ul&gt;
&lt;li&gt;Next, create your View ASPX page. I’ve made my View strongly typed, so I can reference the collection of type SearchResult (Model data) directly instead of having to cast it&lt;br&gt;
&lt;li&gt;On your View page, embed the standard Silverlight HTML markup&lt;br&gt;
&lt;li&gt;Inside the containing div I have some inline C# which copies the Model data into a new collection of anonymous type (you could just use the SearchResult collection passed in, but if I was only interested in a subset of the properties in SearchResult, or wanted to add my own or change their names etc, then creating a collection of a new anonymous type is very handy. Just make sure the type you will deserialize the JSON to inside your Silverlight app contains the exact same properties as your new anonymous type!)&lt;br&gt;
&lt;li&gt;The new collection is then serialized to JSON using the System.Web.Script.Serialization.JavaScriptSerializer and stored in a StringBuilder&lt;br&gt;
&lt;li&gt;The JSON is then URL encoded and concatenated into a string which matches Silverlight’s InitParams definition (e.g. key=value)&lt;br&gt;
&lt;li&gt;Finally, some more inline code to output the necessary ‘initParams’ param markup, passing our custom initParams string as the value&lt;/li&gt;&lt;/ul&gt;&lt;pre class="code"&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;@ &lt;/span&gt;&lt;span style="color: #a31515"&gt;Page &lt;/span&gt;&lt;span style="color: red"&gt;Title&lt;/span&gt;&lt;span style="color: blue"&gt;="" &lt;/span&gt;&lt;span style="color: red"&gt;Language&lt;/span&gt;&lt;span style="color: blue"&gt;="C#" &lt;/span&gt;&lt;span style="color: red"&gt;MasterPageFile&lt;/span&gt;&lt;span style="color: blue"&gt;="~/Views/Shared/Site.Master" &lt;/span&gt;&lt;span style="color: red"&gt;Inherits&lt;/span&gt;&lt;span style="color: blue"&gt;="System.Web.Mvc.ViewPage&amp;lt;List&amp;lt;MvcSilverlight.SearchResult&amp;gt;&amp;gt;" &lt;/span&gt;&lt;span style="background: #ffee62"&gt;%&amp;gt;

&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;Content &lt;/span&gt;&lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;="Content1" &lt;/span&gt;&lt;span style="color: red"&gt;ContentPlaceHolderID&lt;/span&gt;&lt;span style="color: blue"&gt;="head" &lt;/span&gt;&lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;title&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;Silverlight&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;title&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;Content&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;Content &lt;/span&gt;&lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;="Content2" &lt;/span&gt;&lt;span style="color: red"&gt;ContentPlaceHolderID&lt;/span&gt;&lt;span style="color: blue"&gt;="MainContent" &lt;/span&gt;&lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;h2&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;Silverlight Results Page&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;h2&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
    
    
    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;div &lt;/span&gt;&lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;="silverlightControlHost"&amp;gt;
    
        &lt;/span&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;             
            System.Text.&lt;span style="color: #2b91af"&gt;StringBuilder &lt;/span&gt;jsonText = &lt;span style="color: blue"&gt;new &lt;/span&gt;System.Text.&lt;span style="color: #2b91af"&gt;StringBuilder&lt;/span&gt;();

            &lt;span style="color: blue"&gt;var &lt;/span&gt;results = ViewData.Model.Select(sr =&amp;gt; &lt;span style="color: blue"&gt;new &lt;/span&gt;{Title=sr.Title, Relevance = sr.Relevance });            
                
            System.Web.Script.Serialization.&lt;span style="color: #2b91af"&gt;JavaScriptSerializer &lt;/span&gt;serializer = &lt;span style="color: blue"&gt;new &lt;/span&gt;System.Web.Script.Serialization.&lt;span style="color: #2b91af"&gt;JavaScriptSerializer&lt;/span&gt;();

            serializer.Serialize(results, jsonText);

            &lt;span style="color: blue"&gt;string &lt;/span&gt;initParams = &lt;span style="color: blue"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #a31515"&gt;"{0}={1}"&lt;/span&gt;,&lt;span style="color: #a31515"&gt;"model"&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;HttpUtility&lt;/span&gt;.UrlEncode(jsonText.ToString()));

        &lt;span style="background: #ffee62"&gt;%&amp;gt;
&lt;/span&gt;        
        &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;object &lt;/span&gt;&lt;span style="color: red"&gt;data&lt;/span&gt;&lt;span style="color: blue"&gt;="data:application/x-silverlight-2" &lt;/span&gt;&lt;span style="color: red"&gt;type&lt;/span&gt;&lt;span style="color: blue"&gt;="application/x-silverlight-2" &lt;/span&gt;&lt;span style="color: red"&gt;width&lt;/span&gt;&lt;span style="color: blue"&gt;="300px" &lt;/span&gt;&lt;span style="color: red"&gt;height&lt;/span&gt;&lt;span style="color: blue"&gt;="300px"&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;param &lt;/span&gt;&lt;span style="color: red"&gt;name&lt;/span&gt;&lt;span style="color: blue"&gt;="source" &lt;/span&gt;&lt;span style="color: red"&gt;value&lt;/span&gt;&lt;span style="color: blue"&gt;="/ClientBin/SilverlightApplication1.xap" /&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;param &lt;/span&gt;&lt;span style="color: red"&gt;name&lt;/span&gt;&lt;span style="color: blue"&gt;="minRuntimeVersion" &lt;/span&gt;&lt;span style="color: red"&gt;value&lt;/span&gt;&lt;span style="color: blue"&gt;="2.0.31005.0" /&amp;gt;
            &lt;/span&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt; Response.Write(&lt;span style="color: blue"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #a31515"&gt;"&amp;lt;param name=\"initParams\" value=\"{0}\"/&amp;gt;"&lt;/span&gt;, initParams)); &lt;span style="background: #ffee62"&gt;%&amp;gt;
&lt;/span&gt;            &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;param &lt;/span&gt;&lt;span style="color: red"&gt;name&lt;/span&gt;&lt;span style="color: blue"&gt;="windowless" &lt;/span&gt;&lt;span style="color: red"&gt;value&lt;/span&gt;&lt;span style="color: blue"&gt;="true" /&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;param &lt;/span&gt;&lt;span style="color: red"&gt;name&lt;/span&gt;&lt;span style="color: blue"&gt;="Background" &lt;/span&gt;&lt;span style="color: red"&gt;value&lt;/span&gt;&lt;span style="color: blue"&gt;="#00FFFFFF" /&amp;gt;
        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;object&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;div&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;Content&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;pre class="csharpcode"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;h5&gt;Silverlight&lt;/h5&gt;
&lt;ul&gt;
&lt;li&gt;Modify your App.xaml.cs file in your Silverlight project&lt;br&gt;
&lt;li&gt;In the Application_Startup event handler store the InitParams to a static IDictionary&amp;lt;string,string&amp;gt; for reference later&lt;/li&gt;&lt;/ul&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public static &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IDictionary&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;, &lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt; initParams = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Dictionary&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;, &lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt;();

&lt;span style="color: blue"&gt;private void &lt;/span&gt;Application_Startup(&lt;span style="color: blue"&gt;object &lt;/span&gt;sender, &lt;span style="color: #2b91af"&gt;StartupEventArgs &lt;/span&gt;e)
{
    &lt;span style="color: blue"&gt;this&lt;/span&gt;.RootVisual = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Page&lt;/span&gt;();

    &lt;span style="color: #2b91af"&gt;App&lt;/span&gt;.initParams = e.InitParams;
}&lt;br&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;In your Silverlight application’s Page_Loaded event handler in Page.xaml.cs (or wherever you want really), retrieve the Model data from the IDictionary, using the key (“model”)&lt;br&gt;
&lt;li&gt;Once you have your Model data as a string, Url decode it, then deserialize using the DataContractJsonSerializer. &lt;br&gt;
&lt;li&gt;If you are passing complex types to Silverlight as we are in this example, you must have a class defined in your Silverlight app to cast the Model data to. This class must be attributed with the DataContract attribute, and each of its publicly accessible properties must attributed with the DataMember attribute&lt;br&gt;
&lt;li&gt;Finally, cast the deserialized object to your replica type / collection of replica type, and you’re done!&lt;/li&gt;&lt;/ul&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;void &lt;/span&gt;Page_Loaded(&lt;span style="color: blue"&gt;object &lt;/span&gt;sender, &lt;span style="color: #2b91af"&gt;RoutedEventArgs &lt;/span&gt;e)
{
    &lt;span style="color: green"&gt;// Deserialize Init Params
    &lt;/span&gt;&lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;SearchResult&lt;/span&gt;&amp;gt; results = &lt;span style="color: blue"&gt;null&lt;/span&gt;;

    &lt;span style="color: blue"&gt;using &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;MemoryStream &lt;/span&gt;ms = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;MemoryStream&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Encoding&lt;/span&gt;.UTF8.GetBytes(&lt;span style="color: #2b91af"&gt;HttpUtility&lt;/span&gt;.UrlDecode(&lt;span style="color: #2b91af"&gt;App&lt;/span&gt;.initParams[&lt;span style="color: #a31515"&gt;"model"&lt;/span&gt;].ToString()))))
    {
        &lt;span style="color: #2b91af"&gt;DataContractJsonSerializer &lt;/span&gt;serializer = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;DataContractJsonSerializer&lt;/span&gt;(&lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;SearchResult&lt;/span&gt;&amp;gt;));

        results = (&lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;SearchResult&lt;/span&gt;&amp;gt;)serializer.ReadObject(ms);
    }

    &lt;span style="color: green"&gt;// Set deserialized search results as DataGrid ItemsSource
    &lt;/span&gt;&lt;span style="color: blue"&gt;this&lt;/span&gt;.ResultsGrid.ItemsSource = results.ToList();            
}
&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h4&gt;&amp;nbsp;&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Tada! The SearchResult collection is passed from the Model through the Controller, to the View and finally into Silverlight. Without breaking any MVC rules!&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jowardel/WindowsLiveWriter/SilverlightASP.NETMVC_BA25/2_2.png"&gt;&lt;img style="border-right-width: 0px; margin: 0px 0px 0px 60px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="2" border="0" alt="2" src="http://blogs.msdn.com/blogfiles/jowardel/WindowsLiveWriter/SilverlightASP.NETMVC_BA25/2_thumb.png" width="480" height="442"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Hope that helps. You can get the source code for this sample &lt;a href="http://zplzpa.blu.livefilestore.com/y1p1vvxQiytOMDTnbMuPMlGnoYvGgKKoiI24TwRBGbqBZU6fmNm0FYtGKyLCUYsRDw81ts64EcBF1QX-nyc8PKdxA/MvcSilverlight.zip?download" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;iframe style="border-bottom: #dde5e9 1px solid; border-left: #dde5e9 1px solid; padding-bottom: 0px; background-color: #ffffff; margin: 3px; padding-left: 0px; width: 240px; padding-right: 0px; height: 66px; border-top: #dde5e9 1px solid; border-right: #dde5e9 1px solid; padding-top: 0px" marginheight="0" src="http://cid-109ddf8b2e86eadf.skydrive.live.com/embedrowdetail.aspx/blog/MvcSilverlight.zip" frameborder="0" marginwidth="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9467931" width="1" height="1"&gt;</content><author><name>jowardel</name><uri>http://blogs.msdn.com/members/jowardel.aspx</uri></author><category term="Silverlight" scheme="http://blogs.msdn.com/jowardel/archive/tags/Silverlight/default.aspx" /><category term="C#" scheme="http://blogs.msdn.com/jowardel/archive/tags/C_2300_/default.aspx" /><category term="Patterns and Practices" scheme="http://blogs.msdn.com/jowardel/archive/tags/Patterns+and+Practices/default.aspx" /><category term="ASP.NET MVC" scheme="http://blogs.msdn.com/jowardel/archive/tags/ASP.NET+MVC/default.aspx" /><category term="MVC" scheme="http://blogs.msdn.com/jowardel/archive/tags/MVC/default.aspx" /></entry><entry><title>Extending Object!</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/jowardel/archive/2009/02/19/extending-object.aspx" /><link rel="enclosure" type="image/x-png" length="209773" href="http://blogs.msdn.com/jowardel/attachment/9433587.ashx" /><id>http://blogs.msdn.com/jowardel/archive/2009/02/19/extending-object.aspx</id><published>2009-02-19T11:44:00Z</published><updated>2009-02-19T11:44:00Z</updated><content type="html">&lt;P&gt;Ever wanted to add your own methods to Object...or any other type for that matter?&lt;/P&gt;
&lt;P&gt;I've recently started playing around with Extension methods in C# and they're pretty damn cool.&lt;/P&gt;
&lt;P&gt;To add your own method to a Type:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;First create a static class, and inside it make a static method with your chosen method signature. The important thing to note is that the method takes as an argument 'this object obj'. This tells the compiler that this method should be callable from type 'object'. The 'this' keyword is a little confusing but it is really to differntiate the argument from a regular static method which accepts an object arg&lt;BR&gt;&lt;BR&gt;My method 'SayHello' simply returns the string "Hello Joe" - a trivial and narcissistic example :)&lt;BR&gt;&lt;BR&gt;&lt;IMG src="http://zplzpa.bay.livefilestore.com/y1p_Y3WTewFHWwbRdPP3umEEigtAiX3AegmMVizqW8mlIQRmGtZyw338JkjXexCiLyCdD2yuSVor8XgiJIlmH_cJQ/8-1.png" mce_src="http://zplzpa.bay.livefilestore.com/y1p_Y3WTewFHWwbRdPP3umEEigtAiX3AegmMVizqW8mlIQRmGtZyw338JkjXexCiLyCdD2yuSVor8XgiJIlmH_cJQ/8-1.png"&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Now if you create any instance of the object type in your code (the namespace that hosts your extension method must be imported) the SayHello() extension method is available! &lt;BR&gt;&lt;BR&gt;It is also included in every derived type - which in .NET is every single type! (e.g. Int32)&lt;/LI&gt;&lt;/OL&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://zplzpa.bay.livefilestore.com/y1pONaKzuYwE2WfPmR9AoMPcZ1dYZlsfTqqpJRODrwVZ6rlxqrJKEAglWL51oZbcFWl3TSUQEzre7qftHYo1p65aw/8-2.png" mce_src="http://zplzpa.bay.livefilestore.com/y1pONaKzuYwE2WfPmR9AoMPcZ1dYZlsfTqqpJRODrwVZ6rlxqrJKEAglWL51oZbcFWl3TSUQEzre7qftHYo1p65aw/8-2.png"&gt;&lt;BR&gt;&lt;BR&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;This is about as trivial an example as you are likely to find on extension methods but they can be extremely useful - for example, the whole LINQ infastructure is made with extension methods.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;Enjoy&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9433587" width="1" height="1"&gt;</content><author><name>jowardel</name><uri>http://blogs.msdn.com/members/jowardel.aspx</uri></author><category term="Extension Methods" scheme="http://blogs.msdn.com/jowardel/archive/tags/Extension+Methods/default.aspx" /><category term="LINQ" scheme="http://blogs.msdn.com/jowardel/archive/tags/LINQ/default.aspx" /><category term="C#" scheme="http://blogs.msdn.com/jowardel/archive/tags/C_2300_/default.aspx" /></entry><entry><title>How to host Silverlight in SharePoint</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/jowardel/archive/2009/01/17/how-to-host-silverlight-in-sharepoint.aspx" /><id>http://blogs.msdn.com/jowardel/archive/2009/01/17/how-to-host-silverlight-in-sharepoint.aspx</id><published>2009-01-17T21:30:00Z</published><updated>2009-01-17T21:30:00Z</updated><content type="html">&lt;P mce_keep="true"&gt;Hosting Silverlight in SharePoint is actually pretty simple in its basic form. If you want more control over your Silverlight app within SharePoint there's always the excellent &lt;A href="http://www.codeplex.com/SL4SP" mce_href="http://www.codeplex.com/SL4SP"&gt;Silverlight Blueprints&lt;/A&gt;. The only prerequisite i'm aware of is that the IIS server SharePoint is running on has a mime type that support Silverlight (extension: .XAP, MIME-type: application/x-silverlight).&lt;/P&gt;
&lt;P mce_keep="true"&gt;The simple way I've been doing it, is as follows:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Upload the Silverlight XAP to your SharePoint site's 'Shared Documents' document library.&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;IMG style="WIDTH: 1026px; HEIGHT: 742px" src="http://zplzpa.bay.livefilestore.com/y1pzoS5ocaKJ8bZAB3315aJsRufKZWwie4kVQTAVKmpyFtt60C-rZVqrv11VyNDa4OGvikRZ1aQm_AW0qPgQHuBTg/6-4.png" width=1026 height=742 mce_src="http://zplzpa.bay.livefilestore.com/y1pzoS5ocaKJ8bZAB3315aJsRufKZWwie4kVQTAVKmpyFtt60C-rZVqrv11VyNDa4OGvikRZ1aQm_AW0qPgQHuBTg/6-4.png"&gt;&lt;BR&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Create a new Web Part page in SharePoint (ensure the&amp;nbsp;Document Library is set to 'Shared Documents')&lt;BR&gt;&lt;BR&gt;&lt;IMG style="WIDTH: 1026px; HEIGHT: 742px" src="http://zplzpa.bay.livefilestore.com/y1pf4_j9-HB0XtSD9Z9AweDXBu0nreDKH4W3RW0vq6Gb_Si0_AfnddwVcMDbepcLQemtrT5bbyodOGoDdpUCDSmXw/6-1.png" width=1026 height=742 mce_src="http://zplzpa.bay.livefilestore.com/y1pf4_j9-HB0XtSD9Z9AweDXBu0nreDKH4W3RW0vq6Gb_Si0_AfnddwVcMDbepcLQemtrT5bbyodOGoDdpUCDSmXw/6-1.png"&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Then Edit the page and add a Content Editor WebPart&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;IMG style="WIDTH: 1026px; HEIGHT: 742px" src="http://zplzpa.bay.livefilestore.com/y1pgxHPs9j9DqYno8UY3Besuhj2LY6vHcE1ZvZ3_SXF8E2PRRPkp64sOHEL8S45nQpaK8jJQwXF11BG_Dhcl8yvdw/6-2.png" width=1026 height=742 mce_src="http://zplzpa.bay.livefilestore.com/y1pgxHPs9j9DqYno8UY3Besuhj2LY6vHcE1ZvZ3_SXF8E2PRRPkp64sOHEL8S45nQpaK8jJQwXF11BG_Dhcl8yvdw/6-2.png"&gt;&lt;BR&gt;&lt;BR&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Open the Source Editor and paste the HTML source from your Silverlight test page&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;IMG style="WIDTH: 1021px; HEIGHT: 740px" src="http://zplzpa.bay.livefilestore.com/y1pWvIcoH7uwJWZtNeaCwC77BgFZVwPqD9q7zUSotRzb6mludcAdg8s-GTG_5hBRmTUT-g1HvbstV0OQi4Il0dUPQ/6-3.png" width=1021 height=740 mce_src="http://zplzpa.bay.livefilestore.com/y1pWvIcoH7uwJWZtNeaCwC77BgFZVwPqD9q7zUSotRzb6mludcAdg8s-GTG_5hBRmTUT-g1HvbstV0OQi4Il0dUPQ/6-3.png"&gt;&lt;BR&gt;&lt;BR&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Adjust the Width and Height so you can see the page and your Silverlight app&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;IMG src="http://zplzpa.bay.livefilestore.com/y1p-OpFzc7LKknrXu1osWzbUeqZonQIv8oo03YcERKygZQxN0LyNsATNZ0pgSo7P-6a_bWFdoaxC520fheBKmYmdA/6-5.png" mce_src="http://zplzpa.bay.livefilestore.com/y1p-OpFzc7LKknrXu1osWzbUeqZonQIv8oo03YcERKygZQxN0LyNsATNZ0pgSo7P-6a_bWFdoaxC520fheBKmYmdA/6-5.png"&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;&lt;EM&gt;And you're done!&lt;/EM&gt;&lt;/STRONG&gt; - Your Silverlight app is hosted in SharePoint. My next blog post will show how you can use SharePoint's web services to perform actions on WSS from within your Silverlight App. Quite an appealing prospect given that the world and his dog are now using SharePoint but still with the standard vanilla UI. Imagine the possibilities of sexing up WSS' collaboration features with Silverlight.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://zplzpa.bay.livefilestore.com/y1p3wte8wtadic9PX2CkU4bcqAU-rMY8s9ocGm9FSqW70rz2e1NZMoQAWaMaTe-uRco2vYntz-Ma_3QEgIZuYM0fg/6-6.png" mce_src="http://zplzpa.bay.livefilestore.com/y1p3wte8wtadic9PX2CkU4bcqAU-rMY8s9ocGm9FSqW70rz2e1NZMoQAWaMaTe-uRco2vYntz-Ma_3QEgIZuYM0fg/6-6.png"&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9336395" width="1" height="1"&gt;</content><author><name>jowardel</name><uri>http://blogs.msdn.com/members/jowardel.aspx</uri></author><category term="sharepoint" scheme="http://blogs.msdn.com/jowardel/archive/tags/sharepoint/default.aspx" /><category term="Silverlight" scheme="http://blogs.msdn.com/jowardel/archive/tags/Silverlight/default.aspx" /></entry><entry><title>Using the Model-View-Presenter (MVP) Design Pattern to enable Presentational Interoperability and Increased Testability</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/jowardel/archive/2008/09/09/using-the-model-view-presenter-mvp-design-pattern-to-enable-presentational-interoperability-and-increased-testability.aspx" /><id>http://blogs.msdn.com/jowardel/archive/2008/09/09/using-the-model-view-presenter-mvp-design-pattern-to-enable-presentational-interoperability-and-increased-testability.aspx</id><published>2008-09-09T16:10:00Z</published><updated>2008-09-09T16:10:00Z</updated><content type="html">&lt;DIV style="BORDER-BOTTOM: #dbe5f1 3pt solid; BORDER-LEFT: #dbe5f1 3pt solid; PADDING-BOTTOM: 0cm; PADDING-LEFT: 0cm; PADDING-RIGHT: 0cm; BACKGROUND: #dbe5f1; BORDER-TOP: #dbe5f1 3pt solid; BORDER-RIGHT: #dbe5f1 3pt solid; PADDING-TOP: 0cm; mso-element: para-border-div; mso-border-themecolor: accent1; mso-border-themetint: 51; mso-background-themecolor: accent1; mso-background-themetint: 51"&gt;
&lt;H2 style="MARGIN: 10pt 0cm 0pt"&gt;&lt;FONT size=3 face=Calibri&gt;What is MVP?&lt;/FONT&gt;&lt;/H2&gt;&lt;/DIV&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;Model View Presenter (MVP) is a software design pattern which essentially isolates the user interface from the business logic. MVP is derived from the Model View Controller (MVC) pattern, and originally conceived by the renowned Agile software architect, Martin Fowler.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;The principal behind the MVP pattern is that an implementing application should be split into three core components; Model, View and Presenter:&lt;BR style="mso-special-character: line-break"&gt;&lt;BR style="mso-special-character: line-break"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 10pt 0cm 0pt 36pt; mso-list: l2 level1 lfo1" class=MsoListParagraphCxSpFirst&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;§&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;The &lt;B style="mso-bidi-font-weight: normal"&gt;Model&lt;/B&gt; component encapsulates all Business Logic and Data in the application. This may be a database transaction or a call to a web service, etc.&lt;BR style="mso-special-character: line-break"&gt;&lt;BR style="mso-special-character: line-break"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l2 level1 lfo1" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;§&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;The &lt;B style="mso-bidi-font-weight: normal"&gt;View&lt;/B&gt; component represents the application’s Presentation layer (User Interface); this may be a standard Win Forms client, an ASP.NET Web part or Mobile client. In the MVP pattern, the View should be simplistic and responsible for rendering and accepting user input only.&lt;BR style="mso-special-character: line-break"&gt;&lt;BR style="mso-special-character: line-break"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 10pt 36pt; mso-list: l2 level1 lfo1" class=MsoListParagraphCxSpLast&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;§&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;The &lt;B style="mso-bidi-font-weight: normal"&gt;Presenter&lt;/B&gt; component is responsible for orchestrating all the application’s use cases. For example a sample operation would involve; taking user input from the View, invoking operations on the Model and if needed, setting data in the View to indicate the operation’s result.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /&gt;&lt;v:group style="Z-INDEX: 13; POSITION: absolute; MARGIN-TOP: 12.65pt; WIDTH: 338.8pt; HEIGHT: 224.2pt; MARGIN-LEFT: 46.6pt" id=_x0000_s1067 coordorigin="1739,8526" coordsize="8146,5372"&gt;&lt;v:roundrect style="POSITION: absolute; WIDTH: 3002px; HEIGHT: 1752px; TOP: 8781px; LEFT: 1739px" id=_x0000_s1068 arcsize="10923f" fillcolor="#f79646 [3209]" strokecolor="#f79646 [3209]" strokeweight="10pt"&gt;&lt;FONT face=Calibri&gt;&lt;v:stroke linestyle="thinThin"&gt;&lt;/v:stroke&gt;&lt;v:shadow opacity=".5" on="t" color="#d8d8d8 [2732]" offset="6pt,6pt"&gt;&lt;/v:shadow&gt;&lt;/FONT&gt;&lt;/v:roundrect&gt;&lt;v:roundrect style="POSITION: absolute; WIDTH: 3002px; HEIGHT: 1752px; TOP: 12146px; LEFT: 6883px" id=_x0000_s1069 arcsize="10923f" fillcolor="#9bbb59 [3206]" strokecolor="#9bbb59 [3206]" strokeweight="10pt"&gt;&lt;FONT face=Calibri&gt;&lt;v:stroke linestyle="thinThin"&gt;&lt;/v:stroke&gt;&lt;v:shadow opacity=".5" on="t" color="#d8d8d8 [2732]" offset="6pt,6pt"&gt;&lt;/v:shadow&gt;&lt;/FONT&gt;&lt;/v:roundrect&gt;&lt;v:roundrect style="POSITION: absolute; WIDTH: 3002px; HEIGHT: 1752px; TOP: 8781px; LEFT: 6785px" id=_x0000_s1070 arcsize="10923f" fillcolor="#4f81bd [3204]" strokecolor="#4f81bd [3204]" strokeweight="10pt"&gt;&lt;FONT face=Calibri&gt;&lt;v:stroke linestyle="thinThin"&gt;&lt;/v:stroke&gt;&lt;v:shadow opacity=".5" on="t" color="#d8d8d8 [2732]" offset="6pt,6pt"&gt;&lt;/v:shadow&gt;&lt;/FONT&gt;&lt;/v:roundrect&gt;&lt;v:shapetype id=_x0000_t202 coordsize="21600,21600" path="m,l,21600r21600,l21600,xe" o:spt="202"&gt;&lt;v:stroke joinstyle="miter"&gt;&lt;/v:stroke&gt;&lt;v:path o:connecttype="rect" gradientshapeok="t"&gt;&lt;/v:path&gt;&lt;/v:shapetype&gt;&lt;v:shape style="POSITION: absolute; WIDTH: 2133px; HEIGHT: 842px; TOP: 8526px; LEFT: 2160px" id=_x0000_s1071 type="#_x0000_t202" stroked="f" filled="f"&gt;&lt;v:shadow on="t" color="#d8d8d8 [2732]"&gt;&lt;/v:shadow&gt;&lt;v:textbox style="mso-next-textbox: #_x0000_s1071"&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0"&gt;
&lt;DIV&gt;
&lt;P style="TEXT-ALIGN: center; MARGIN: 10pt 0cm" class=MsoNormal align=center&gt;&lt;SPAN style="LINE-HEIGHT: 115%; COLOR: white; FONT-SIZE: 18pt; mso-themecolor: background1; mso-bidi-font-size: 10.0pt"&gt;&lt;FONT face=Calibri&gt;View&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/v:textbox&gt;&lt;/v:shape&gt;&lt;v:shape style="POSITION: absolute; WIDTH: 2133px; HEIGHT: 842px; TOP: 8536px; LEFT: 7209px" id=_x0000_s1072 type="#_x0000_t202" stroked="f" filled="f"&gt;&lt;v:shadow on="t" color="#d8d8d8 [2732]"&gt;&lt;/v:shadow&gt;&lt;v:textbox style="mso-next-textbox: #_x0000_s1072"&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0"&gt;
&lt;DIV&gt;
&lt;P style="TEXT-ALIGN: center; MARGIN: 10pt 0cm" class=MsoNormal align=center&gt;&lt;SPAN style="LINE-HEIGHT: 115%; COLOR: white; FONT-SIZE: 18pt; mso-themecolor: background1; mso-bidi-font-size: 10.0pt"&gt;&lt;FONT face=Calibri&gt;Presenter&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/v:textbox&gt;&lt;/v:shape&gt;&lt;v:shape style="POSITION: absolute; WIDTH: 2133px; HEIGHT: 842px; TOP: 11901px; LEFT: 7317px" id=_x0000_s1073 type="#_x0000_t202" stroked="f" filled="f"&gt;&lt;v:shadow on="t" color="#d8d8d8 [2732]"&gt;&lt;/v:shadow&gt;&lt;v:textbox style="mso-next-textbox: #_x0000_s1073"&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0"&gt;
&lt;DIV&gt;
&lt;P style="TEXT-ALIGN: center; MARGIN: 10pt 0cm" class=MsoNormal align=center&gt;&lt;SPAN style="LINE-HEIGHT: 115%; COLOR: white; FONT-SIZE: 18pt; mso-themecolor: background1; mso-bidi-font-size: 10.0pt"&gt;&lt;FONT face=Calibri&gt;Model&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/v:textbox&gt;&lt;/v:shape&gt;&lt;v:shapetype id=_x0000_t32 coordsize="21600,21600" path="m,l21600,21600e" o:spt="32" filled="f" o:oned="t"&gt;&lt;v:path o:connecttype="none" arrowok="t" fillok="f"&gt;&lt;/v:path&gt;&lt;o:lock shapetype="t" v:ext="edit"&gt;&lt;/o:lock&gt;&lt;/v:shapetype&gt;&lt;v:shape style="POSITION: absolute; WIDTH: 1861px; HEIGHT: 0px; TOP: 9175px; LEFT: 4837px" id=_x0000_s1074 strokeweight="2.25pt" type="#_x0000_t32" o:connectortype="straight"&gt;&lt;v:stroke endarrow="block"&gt;&lt;FONT face=Calibri&gt;&lt;/FONT&gt;&lt;/v:stroke&gt;&lt;/v:shape&gt;&lt;v:shape style="POSITION: absolute; WIDTH: 1861px; HEIGHT: 0px; TOP: 9936px; LEFT: 4837px; flip: x" id=_x0000_s1075 strokeweight="2.25pt" type="#_x0000_t32" o:connectortype="straight"&gt;&lt;v:stroke endarrow="block"&gt;&lt;FONT face=Calibri&gt;&lt;/FONT&gt;&lt;/v:stroke&gt;&lt;/v:shape&gt;&lt;v:shape style="POSITION: absolute; WIDTH: 0px; HEIGHT: 1468px; TOP: 10615px; LEFT: 8300px" id=_x0000_s1076 strokeweight="2.25pt" type="#_x0000_t32" o:connectortype="straight"&gt;&lt;v:stroke endarrow="block"&gt;&lt;FONT face=Calibri&gt;&lt;/FONT&gt;&lt;/v:stroke&gt;&lt;/v:shape&gt;&lt;v:shape style="POSITION: absolute; WIDTH: 2622px; HEIGHT: 1073px; TOP: 9003px; LEFT: 1831px" id=_x0000_s1077 type="#_x0000_t202" stroked="f" filled="f"&gt;&lt;v:textbox style="mso-next-textbox: #_x0000_s1077" inset="0,0,0,0"&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0"&gt;
&lt;DIV&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="LINE-HEIGHT: 115%; COLOR: white; FONT-SIZE: 12pt; mso-themecolor: background1; mso-bidi-font-size: 10.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 115%; COLOR: white; FONT-SIZE: 20pt; mso-themecolor: background1; mso-bidi-font-size: 10.0pt"&gt;-&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 115%; COLOR: white; FONT-SIZE: 12pt; mso-themecolor: background1; mso-bidi-font-size: 10.0pt"&gt; Presenter&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/v:textbox&gt;&lt;/v:shape&gt;&lt;v:shape style="POSITION: absolute; WIDTH: 2622px; HEIGHT: 1467px; TOP: 9066px; LEFT: 6899px" id=_x0000_s1078 type="#_x0000_t202" stroked="f" filled="f"&gt;&lt;v:textbox style="mso-next-textbox: #_x0000_s1078" inset="0,0,0,0"&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0"&gt;
&lt;DIV&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="LINE-HEIGHT: 115%; COLOR: white; FONT-SIZE: 12pt; mso-themecolor: background1; mso-bidi-font-size: 10.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 115%; COLOR: white; FONT-SIZE: 20pt; mso-themecolor: background1; mso-bidi-font-size: 10.0pt"&gt;-&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="LINE-HEIGHT: 115%; COLOR: white; FONT-SIZE: 12pt; mso-themecolor: background1; mso-bidi-font-size: 10.0pt"&gt; IView&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 115%; COLOR: white; FONT-SIZE: 18pt; mso-themecolor: background1; mso-bidi-font-size: 10.0pt"&gt;-&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 115%; COLOR: white; FONT-SIZE: 12pt; mso-themecolor: background1; mso-bidi-font-size: 10.0pt"&gt; Model&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; COLOR: white; FONT-SIZE: 12pt; mso-themecolor: background1; mso-bidi-font-size: 10.0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; COLOR: white; FONT-SIZE: 12pt; mso-themecolor: background1; mso-bidi-font-size: 10.0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; COLOR: white; FONT-SIZE: 12pt; mso-themecolor: background1; mso-bidi-font-size: 10.0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/v:textbox&gt;&lt;/v:shape&gt;&lt;/v:group&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;IMG style="WIDTH: 499px; HEIGHT: 330px" align=middle src="http://zplzpa.bay.livefilestore.com/y1pnDJhz2317v8eHgMyMUTIFydjRbBY-VL1PmkwJf0Xqcpk5wqigl1wCMByTsGmoaPUizmdTcDCSStfsBCBTdokZg/5-1.png" width=499 height=330 mce_src="http://zplzpa.bay.livefilestore.com/y1pnDJhz2317v8eHgMyMUTIFydjRbBY-VL1PmkwJf0Xqcpk5wqigl1wCMByTsGmoaPUizmdTcDCSStfsBCBTdokZg/5-1.png"&gt;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;FONT face=Calibri&gt;The advantages of implementing the MVP pattern in a project with a presentation tier are:&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 10pt 0cm 0pt 36pt; mso-list: l1 level1 lfo6" class=MsoListParagraphCxSpFirst&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;§&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;Isolation of User Interface from Business tier&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l1 level1 lfo6" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;§&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;Easily interchangeable Views (user interfaces)&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 10pt 36pt; mso-list: l1 level1 lfo6" class=MsoListParagraphCxSpLast&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;§&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;Ability to test all code in the solution (excluding visual presentation and interaction)&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 10pt 36pt; mso-list: l1 level1 lfo6" class=MsoListParagraphCxSpLast&gt;&lt;FONT face=Calibri&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 10pt 36pt; mso-list: l1 level1 lfo6" class=MsoListParagraphCxSpLast mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV style="BORDER-BOTTOM: #dbe5f1 3pt solid; BORDER-LEFT: #dbe5f1 3pt solid; PADDING-BOTTOM: 0cm; PADDING-LEFT: 0cm; PADDING-RIGHT: 0cm; BACKGROUND: #dbe5f1; BORDER-TOP: #dbe5f1 3pt solid; BORDER-RIGHT: #dbe5f1 3pt solid; PADDING-TOP: 0cm; mso-element: para-border-div; mso-border-themecolor: accent1; mso-border-themetint: 51; mso-background-themecolor: accent1; mso-background-themetint: 51"&gt;
&lt;H2 style="MARGIN: 10pt 0cm 0pt"&gt;&lt;FONT size=3 face=Calibri&gt;Example&lt;/FONT&gt;&lt;/H2&gt;&lt;/DIV&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;Throughout this document, the explanation of the MVP design pattern, code extracts and testing strategies will all refer to an example Search application. This search application is extremely basic and used for purely illustrative purposes only.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;It consists of a single Use Case scenario; Search, which executes as follows:&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 10pt 0cm 0pt 36pt; mso-list: l3 level1 lfo5" class=MsoListParagraphCxSpFirst&gt;&lt;SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri&gt;1.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;User enters a search criteria (e.g. “test”)&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l3 level1 lfo5" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri&gt;2.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;The User initiates a search in the UI (e.g. Button click)&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l3 level1 lfo5" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri&gt;3.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;The View component handles the search event, and invokes the ‘Search()’ function on the Presenter&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l3 level1 lfo5" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri&gt;4.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;The Presenter extracts the search criteria string from the View’s ‘SearchCriteria’ property&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l3 level1 lfo5" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri&gt;5.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;The Presenter invokes the Business operation ‘Business Search’ on the Model, passing the search criteria as an argument&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l3 level1 lfo5" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri&gt;6.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;The Model returns all matching results for the given search criteria&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l3 level1 lfo5" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri&gt;7.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;The Presenter sets these results in the View component’s ‘Results’ property&lt;/FONT&gt;&lt;v:rect style="Z-INDEX: 23; POSITION: absolute; MARGIN-TOP: 12.35pt; WIDTH: 41.65pt; HEIGHT: 3.55pt; MARGIN-LEFT: 8.9pt" id=_x0000_s1133 fillcolor="#404040 [2429]" stroked="f"&gt;&lt;FONT face=Calibri&gt;&lt;/FONT&gt;&lt;/v:rect&gt;&lt;v:rect style="Z-INDEX: 22; POSITION: absolute; MARGIN-TOP: 5.55pt; WIDTH: 59.2pt; HEIGHT: 5.2pt; MARGIN-LEFT: 4.45pt" id=_x0000_s1132 stroked="f"&gt;&lt;FONT face=Calibri&gt;&lt;/FONT&gt;&lt;/v:rect&gt;&lt;v:shape style="Z-INDEX: 20; POSITION: absolute; MARGIN-TOP: 73.3pt; WIDTH: 157.75pt; HEIGHT: 1in; MARGIN-LEFT: 283.7pt" id=_x0000_s1130 type="#_x0000_t202" stroked="f" filled="f"&gt;&lt;v:textbox style="mso-next-textbox: #_x0000_s1130"&gt;&lt;FONT face=Calibri&gt;&lt;/FONT&gt;&lt;/v:textbox&gt;&lt;/v:shape&gt;&lt;v:shape style="Z-INDEX: 21; POSITION: absolute; MARGIN-TOP: 50pt; WIDTH: 157.75pt; HEIGHT: 1in; MARGIN-LEFT: 281.05pt" id=_x0000_s1131 type="#_x0000_t202" stroked="f" filled="f"&gt;&lt;v:textbox style="mso-next-textbox: #_x0000_s1131"&gt;&lt;FONT face=Calibri&gt;&lt;/FONT&gt;&lt;/v:textbox&gt;&lt;/v:shape&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-GB; mso-bidi-language: AR-SA"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l3 level1 lfo5" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-GB; mso-bidi-language: AR-SA"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l3 level1 lfo5" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-GB; mso-bidi-language: AR-SA"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l3 level1 lfo5" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-GB; mso-bidi-language: AR-SA"&gt;&amp;nbsp;&lt;/P&gt;&lt;/SPAN&gt;
&lt;DIV style="BORDER-BOTTOM: #dbe5f1 3pt solid; BORDER-LEFT: #dbe5f1 3pt solid; PADDING-BOTTOM: 0cm; PADDING-LEFT: 0cm; PADDING-RIGHT: 0cm; BACKGROUND: #dbe5f1; BORDER-TOP: #dbe5f1 3pt solid; BORDER-RIGHT: #dbe5f1 3pt solid; PADDING-TOP: 0cm; mso-element: para-border-div; mso-border-themecolor: accent1; mso-border-themetint: 51; mso-background-themecolor: accent1; mso-background-themetint: 51"&gt;
&lt;H2 style="MARGIN: 10pt 0cm 0pt"&gt;&lt;FONT size=3 face=Calibri&gt;Detailed Explanation&lt;/FONT&gt;&lt;/H2&gt;&lt;/DIV&gt;
&lt;DIV style="BORDER-BOTTOM: medium none; BORDER-LEFT: #4f81bd 1pt solid; PADDING-BOTTOM: 0cm; PADDING-LEFT: 2pt; PADDING-RIGHT: 0cm; BORDER-TOP: #4f81bd 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 2pt; mso-element: para-border-div; mso-border-top-alt: solid #4F81BD .75pt; mso-border-top-themecolor: accent1; mso-border-left-alt: solid #4F81BD .75pt; mso-border-left-themecolor: accent1"&gt;
&lt;H3 style="MARGIN: 15pt 0cm 0pt"&gt;&lt;FONT color=#243f60 size=3 face=Calibri&gt;Model&lt;/FONT&gt;&lt;/H3&gt;&lt;/DIV&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;The MVP pattern is chiefly concerned with isolating the user interface from the business logic and as such the Model component’s design is not specified in any detail.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;Since the Presentation component is responsible for orchestrating business use cases, the Presentation component contains a reference to both the View and Model components.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;However it is generally accepted as good practice to decouple the Model from the Presentation component. To do this, it is recommended to create an interface for the Model which defines all the business logic operations contained in the Model. Then use the ‘Factory method’ pattern (a creational pattern) to return a concrete implementation of the Model for use in the Presentation component. This allows the Model to be interchanged without any modification to the Presentation component.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Calibri','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-fareast; mso-bidi-theme-font: minor-bidi; mso-fareast-language: EN-US; mso-bidi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-ansi-language: EN-GB"&gt;&lt;BR style="PAGE-BREAK-BEFORE: always; mso-special-character: line-break" clear=all&gt;&lt;/SPAN&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; TEXT-TRANSFORM: uppercase; LETTER-SPACING: 0.75pt; COLOR: #243f60; FONT-SIZE: 11pt; mso-themecolor: accent1; mso-themeshade: 127"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV style="BORDER-BOTTOM: medium none; BORDER-LEFT: #4f81bd 1pt solid; PADDING-BOTTOM: 0cm; PADDING-LEFT: 2pt; PADDING-RIGHT: 0cm; BORDER-TOP: #4f81bd 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 2pt; mso-element: para-border-div; mso-border-top-alt: solid #4F81BD .75pt; mso-border-top-themecolor: accent1; mso-border-left-alt: solid #4F81BD .75pt; mso-border-left-themecolor: accent1"&gt;
&lt;H3 style="MARGIN: 15pt 0cm 0pt"&gt;&lt;FONT color=#243f60 size=3 face=Calibri&gt;View&lt;/FONT&gt;&lt;/H3&gt;&lt;/DIV&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;The View component represents the Presentation layer and can be implemented in a variety of UI technologies (Windows Forms, Web-Page, Web-Part, Silverlight etc) on a range of platforms (Client, Web, Mobile). &lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;The View’s responsibilities are limited to rendering itself, accepting user input and handling user events on controls (e.g. Button clicks).&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;The View does not perform any business logic, or directly interact with the Model. Instead it invokes methods on the Presenter. The Presenter in-turn calls business operations on the Model and then [in some cases] sets properties on the View to indicate the operation’s result.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;Because the View is designed to be fully interchangeable, the View component implements an interface which defines the methods and properties all concrete Views must implement.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&lt;IMG style="WIDTH: 464px; HEIGHT: 422px" src="http://zplzpa.bay.livefilestore.com/y1pQLE9xuGFqipZ6OPX7vRya_mU7c5_KhJncEF6VCDTG7xIndGP3iP_p0InZGAYAT-CYZJpxcuoa0P9J8wtFWON6g/5-7.png" width=464 height=422 mce_src="http://zplzpa.bay.livefilestore.com/y1pQLE9xuGFqipZ6OPX7vRya_mU7c5_KhJncEF6VCDTG7xIndGP3iP_p0InZGAYAT-CYZJpxcuoa0P9J8wtFWON6g/5-7.png"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;BR style="mso-ignore: vglayout" clear=all&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;The above diagram illustrates the architecture of the View component. To better understand how the View and Presenter components interact, these components’ will be discussed in the context of the example Search Web-Part application. &lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;In the preceding diagram, the View component’s interface ‘IView’ defines a property ‘SearchCriteria’ of type string with read permissions and a property ‘Results’ of type string collection with write permissions.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;For the purposes of the example Search application, it is necessary for any View to have an input which accepts the user’s search criteria (e.g. TextBox), and an output which displays the matching results (e.g. ListBox).&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;v:shape style="WIDTH: 442pt; HEIGHT: 96.35pt; mso-position-horizontal-relative: char; mso-position-vertical-relative: line" id=_x0000_s1066 fillcolor="#f2f2f2 [3052]" type="#_x0000_t202" wrapcoords="-37 -169 -37 21600 220 22781 21893 22781 21893 1350 21637 -169 -37 -169"&gt;&lt;v:shadow opacity=".5" on="t" offset="6pt,6pt"&gt;&lt;/v:shadow&gt;&lt;v:textbox style="mso-next-textbox: #_x0000_s1066" inset=",5.3mm,,5.3mm"&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0"&gt;
&lt;DIV&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;interface&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;IView&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; SearchCriteria { &lt;SPAN style="COLOR: blue"&gt;get&lt;/SPAN&gt;; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;List&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;string&amp;gt;&lt;/SPAN&gt; Results { &lt;SPAN style="COLOR: blue"&gt;set&lt;/SPAN&gt;; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 8pt; mso-bidi-font-size: 10.0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/v:textbox&gt;&lt;?xml:namespace prefix = w ns = "urn:schemas-microsoft-com:office:word" /&gt;&lt;w:wrap type="none"&gt;&lt;/w:wrap&gt;&lt;w:anchorlock&gt;&lt;/w:anchorlock&gt;&lt;/v:shape&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;FONT face=Calibri&gt;The Presenter component is never given a direct reference to the View component’s concrete implementation. Instead it references the View component through the View Interface ‘IView’. This allows the View implementation to be changed (e.g. from a Web Part control to a Windows Form client) without the Presenter being modified. Therefore when the View’s interface is developed, thought should be given as to how the Presenter will interact with the View’s data. For example, in the example Search application, the Presenter will need to retrieve (‘get’) the user’s search criteria string and once the search has been performed (by the Model) the resultant output must be displayed to the user (‘set’). &lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;It is also important to develop View interfaces using only Framework types or Business types (as defined in the Model), not presentation technology-specific types. E.g. it would be possible to define the ‘Results’ property to be of type System.Web.UI.WebControls.BulletedList, however this is specific to an ASP.NET Views and would be inefficient to implement on a Windows Form client View implementation.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;v:shape style="WIDTH: 442pt; HEIGHT: 613.05pt; mso-position-horizontal-relative: char; mso-position-vertical-relative: line" id=_x0000_s1065 fillcolor="#f2f2f2 [3052]" type="#_x0000_t202" wrapcoords="-37 -61 -37 21600 220 22028 21893 22028 21893 490 21637 -61 -37 -61"&gt;&lt;v:shadow opacity=".5" on="t" offset="6pt,6pt"&gt;&lt;/v:shadow&gt;&lt;v:textbox style="mso-next-textbox: #_x0000_s1065" inset=",5.3mm,,5.3mm"&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0"&gt;
&lt;DIV&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;ViewImpl&lt;/SPAN&gt; : &lt;SPAN style="COLOR: #2b91af"&gt;WebPart&lt;/SPAN&gt;, &lt;SPAN style="COLOR: #2b91af"&gt;IView&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Presenter&lt;/SPAN&gt; presenter;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Label&lt;/SPAN&gt; lblSearch = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Label&lt;/SPAN&gt;() { Text = &lt;SPAN style="COLOR: #a31515"&gt;"Enter bank to search for: "&lt;/SPAN&gt; };&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Button&lt;/SPAN&gt; btnSearch = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Button&lt;/SPAN&gt;() { Text = &lt;SPAN style="COLOR: #a31515"&gt;"Search"&lt;/SPAN&gt; };&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;BulletedList&lt;/SPAN&gt; resultsList = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;BulletedList&lt;/SPAN&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;TextBox&lt;/SPAN&gt; tbSearchCriteria = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;TextBox&lt;/SPAN&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;ViewImpl&lt;/SPAN&gt;()&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.presenter = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Presenter&lt;/SPAN&gt;(&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;protected&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;override&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; CreateChildControls()&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.Controls.Clear();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.btnSearch.Click += &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;EventHandler&lt;/SPAN&gt;(btnSearch_Click);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.Controls.Add(&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.lblSearch);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.Controls.Add(&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.tbSearchCriteria);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.Controls.Add(&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.btnSearch);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.Controls.Add(&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.resultsList);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.ChildControlsCreated = &lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; btnSearch_Click(&lt;SPAN style="COLOR: blue"&gt;object&lt;/SPAN&gt; sender, &lt;SPAN style="COLOR: #2b91af"&gt;EventArgs&lt;/SPAN&gt; e)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.presenter.Search();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;#region&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt; IView Members&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; SearchCriteria&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;get&lt;/SPAN&gt; { &lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.tbSearchCriteria.Text; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;List&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;&amp;gt; Results&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;set&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.resultsList.Items.Clear();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;List&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;&amp;gt; results = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;List&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;&amp;gt;(&lt;SPAN style="COLOR: blue"&gt;value&lt;/SPAN&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;foreach&lt;/SPAN&gt; (&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; r &lt;SPAN style="COLOR: blue"&gt;in&lt;/SPAN&gt; results)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.resultsList.Items.Add(r);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;#endregion&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/v:textbox&gt;&lt;w:wrap type="none"&gt;&lt;/w:wrap&gt;&lt;w:anchorlock&gt;&lt;/w:anchorlock&gt;&lt;/v:shape&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;The above code extract contains all the code required to implement a very basic search ASP.NET Web Part that also implements the IView interface.&lt;BR style="mso-special-character: line-break"&gt;&lt;BR style="mso-special-character: line-break"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;The following list dissects the structure and members of the example Search Web Part View implementation:&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 10pt 0cm 0pt 36pt; mso-list: l5 level1 lfo2" class=MsoListParagraphCxSpFirst&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;§&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;Firstly, the variables are declared, including a reference to the Presenter, also a number of UI controls. &lt;BR style="mso-special-character: line-break"&gt;&lt;BR style="mso-special-character: line-break"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l5 level1 lfo2" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;§&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;ViewImpl’s constructor, instantiates the Presenter, passing a reference to itself to the Presenter’s constructor. The Presenter’s constructor signature defines a parameter of type IView, and since ViewImpl implements IView, the self-reference can safely be passed. This allows the Presenter to invoke methods/properties on the IView instance and visa-versa allowing the View to invoke methods/properties on the Presenter instance.&lt;BR style="mso-special-character: line-break"&gt;&lt;BR style="mso-special-character: line-break"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l5 level1 lfo2" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;§&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;ViewImpl overrides the Web Part method ‘CreateChildControls()’ so as to perform custom rendering of itself and its children. The ‘Search’ Button control also registers a new Event Handler to handle button clicks.&lt;BR style="mso-special-character: line-break"&gt;&lt;BR style="mso-special-character: line-break"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l5 level1 lfo2" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;§&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;The Button click event handler, does not perform any logic or call any Business Operations, instead it simply invokes a ‘Search()’ method on the Presenter (note that the method does not take any parameters).&lt;BR style="mso-special-character: line-break"&gt;&lt;BR style="mso-special-character: line-break"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 10pt 36pt; mso-list: l5 level1 lfo2" class=MsoListParagraphCxSpLast&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;§&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;Next, the IView implementations. The ‘SearchCriteria’ property returns the Text property of the TextBox input control which contains the user’s search criteria. The Results property populates the List control with the data passed into it.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Calibri','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-fareast; mso-bidi-theme-font: minor-bidi; mso-fareast-language: EN-US; mso-bidi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-ansi-language: EN-GB"&gt;&lt;BR style="PAGE-BREAK-BEFORE: always; mso-special-character: line-break" clear=all&gt;&lt;/SPAN&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; TEXT-TRANSFORM: uppercase; LETTER-SPACING: 0.75pt; COLOR: #243f60; FONT-SIZE: 11pt; mso-themecolor: accent1; mso-themeshade: 127"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV style="BORDER-BOTTOM: medium none; BORDER-LEFT: #4f81bd 1pt dotted; PADDING-BOTTOM: 0cm; PADDING-LEFT: 2pt; PADDING-RIGHT: 0cm; BORDER-TOP: #4f81bd 1pt dotted; BORDER-RIGHT: medium none; PADDING-TOP: 2pt; mso-element: para-border-div; mso-border-top-alt: dotted #4F81BD .75pt; mso-border-top-themecolor: accent1; mso-border-left-alt: dotted #4F81BD .75pt; mso-border-left-themecolor: accent1"&gt;
&lt;H4 style="MARGIN: 15pt 0cm 0pt"&gt;&lt;FONT color=#365f91 face=Calibri&gt;Separation of Concerns&lt;/FONT&gt;&lt;/H4&gt;&lt;/DIV&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;Although the MVP pattern prescribes the implementation of only a very basic View with little or no logic, it is often desirable or necessary to include validation, error handling, initialization, localization and general house-keeping code. These operations are specific to be presentation-technology being employed and as such are not something that can be handled by the Presenter; however they are also not strictly related to the rendering of the View.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;Therefore in the development of this simple Search example MVP application, it was decided to experiment with a separation of View concerns, whereby the View would be split into a Logic tier and a Presentational tier.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;&lt;IMG style="WIDTH: 415px; HEIGHT: 402px" src="http://zplzpa.bay.livefilestore.com/y1pfXcX-Pv2SwGL2FOyHCCUQ8gmXg7iuD3z-8Kqp9dK-uCuB8p6dGTZChdU1VA5Z-s-76u-jYXgLgPT7U0Dg17Cbg/5-8.png" width=415 height=402 mce_src="http://zplzpa.bay.livefilestore.com/y1pfXcX-Pv2SwGL2FOyHCCUQ8gmXg7iuD3z-8Kqp9dK-uCuB8p6dGTZChdU1VA5Z-s-76u-jYXgLgPT7U0Dg17Cbg/5-8.png"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;FONT face=Calibri&gt;It is important to note that implementing the View as two separate classes can lead to more complex code and requires greater design consideration, as it may be prudent to declare certain IView members as abstract in the Logic tier as they require no presentational logic and should therefore be implemented in the Presentational tier only. This is just one example of a design consideration that must be taken when employing this pattern.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;Therefore, this pattern is only really suited to complex Views where implementation-specific logic is essential.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Calibri','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-fareast; mso-bidi-theme-font: minor-bidi; mso-fareast-language: EN-US; mso-bidi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-ansi-language: EN-GB"&gt;&lt;IMG style="WIDTH: 533px; HEIGHT: 521px" src="http://zplzpa.bay.livefilestore.com/y1pVcxMOlgnUi8vynSk0lEcRbwY4sK2qZHHBlMzTcEr0E3fweTZ_jqgCJbTERWUsfdIiumwSwjQ28O-ljYfkvi0Vw/5-5.png" width=533 height=521 mce_src="http://zplzpa.bay.livefilestore.com/y1pVcxMOlgnUi8vynSk0lEcRbwY4sK2qZHHBlMzTcEr0E3fweTZ_jqgCJbTERWUsfdIiumwSwjQ28O-ljYfkvi0Vw/5-5.png"&gt;&lt;BR style="PAGE-BREAK-BEFORE: always; mso-special-character: line-break" clear=all&gt;&lt;/SPAN&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;BR style="mso-ignore: vglayout" clear=all&gt;
&lt;DIV style="BORDER-BOTTOM: #4f81bd 1pt solid; BORDER-LEFT: medium none; PADDING-BOTTOM: 1pt; PADDING-LEFT: 0cm; PADDING-RIGHT: 0cm; BORDER-TOP: medium none; BORDER-RIGHT: medium none; PADDING-TOP: 0cm; mso-element: para-border-div; mso-border-bottom-alt: solid #4F81BD .75pt; mso-border-bottom-themecolor: accent1"&gt;
&lt;H5 style="MARGIN: 15pt 0cm 0pt"&gt;&lt;FONT color=#365f91 size=3 face=Calibri&gt;Logic Tier&lt;/FONT&gt;&lt;/H5&gt;&lt;/DIV&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;In the context of the Search web part example, the logic tier of the View component is responsible for:&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 10pt 0cm 0pt 36pt; mso-list: l0 level1 lfo3" class=MsoListParagraphCxSpFirst&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;§&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;Implementation of the IView interface – The body of these properties includes validation, error handling logic etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l0 level1 lfo3" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;§&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;Inheriting from WebPart&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l0 level1 lfo3" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;§&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;Initialisation – Instantiating the Presenter, setting up resources specific to the implemented technology (e.g. Retrieving parameters from the HTTP request object)&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l0 level1 lfo3" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;§&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;Validation – E.g. Ensuring the results assigned to the Results string collection are valid&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 10pt 36pt; mso-list: l0 level1 lfo3" class=MsoListParagraphCxSpLast&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;§&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;Error handling – E.g. Handling / throwing exceptions generated during the aforementioned operations&lt;BR style="mso-special-character: line-break"&gt;&lt;BR style="mso-special-character: line-break"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;It is worth noting that although the Logic tier inherits from System.Web.UI.WebControls.WebParts.WebPart, it is marked as an abstract class to prevent instantiation. This is because it is only responsible for implementation-specific logic, not rendering of itself and child controls.&lt;/FONT&gt;&lt;/P&gt;
&lt;DIV style="BORDER-BOTTOM: #4f81bd 1pt solid; BORDER-LEFT: medium none; PADDING-BOTTOM: 1pt; PADDING-LEFT: 0cm; PADDING-RIGHT: 0cm; BORDER-TOP: medium none; BORDER-RIGHT: medium none; PADDING-TOP: 0cm; mso-element: para-border-div; mso-border-bottom-alt: solid #4F81BD .75pt; mso-border-bottom-themecolor: accent1"&gt;
&lt;H5 style="MARGIN: 15pt 0cm 0pt"&gt;&lt;FONT color=#365f91 size=3 face=Calibri&gt;Presentational Tier&lt;/FONT&gt;&lt;/H5&gt;&lt;/DIV&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;The Presentation tier then inherits from the Logic tier, and is solely responsible for all User Interface and Interaction matters. In the context of this Search example, these responsibilities are:&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 10pt 0cm 0pt 36pt; mso-list: l4 level1 lfo4" class=MsoListParagraphCxSpFirst&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;§&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;UI Initialisation – E.g. Webpart title, Size, Positioning etc&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l4 level1 lfo4" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;§&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;Creation of all constituent controls (Buttons, TextBoxes, Labels, Lists etc)&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l4 level1 lfo4" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;§&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;Rendering of these controls – E.g. CreateChildControls()&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l4 level1 lfo4" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;§&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;Event Handlers registered to constituent Controls&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 10pt 36pt; mso-list: l4 level1 lfo4" class=MsoListParagraphCxSpLast&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;§&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;Overridden IView member implementations – The overridden IView members call the Logic tier’s IView members to perform validation etc, and then render the results to the respective UI controls.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Calibri','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-fareast; mso-bidi-theme-font: minor-bidi; mso-fareast-language: EN-US; mso-bidi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-ansi-language: EN-GB"&gt;&lt;BR style="PAGE-BREAK-BEFORE: always; mso-special-character: line-break" clear=all&gt;&lt;/SPAN&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;DIV style="BORDER-BOTTOM: medium none; BORDER-LEFT: #4f81bd 1pt solid; PADDING-BOTTOM: 0cm; PADDING-LEFT: 2pt; PADDING-RIGHT: 0cm; BORDER-TOP: #4f81bd 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 2pt; mso-element: para-border-div; mso-border-top-alt: solid #4F81BD .75pt; mso-border-top-themecolor: accent1; mso-border-left-alt: solid #4F81BD .75pt; mso-border-left-themecolor: accent1"&gt;
&lt;H3 style="MARGIN: 15pt 0cm 0pt"&gt;&lt;FONT color=#243f60 size=3 face=Calibri&gt;Presenter&lt;/FONT&gt;&lt;/H3&gt;&lt;/DIV&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;As illustrated in the View implementation C# code extract, the View (like many applications) is the entry-point for the application, and is responsible for creating the Presenter which in-turn creates the Model. The only difference between this example MVP search web part and a non-MVP web part is that the MVP View contains no business logic, apart from one call to invoke the Search operation on the Presenter instance. Apart from this, it is solely dedicated to the rendering of its constituent UI Controls and the getting and setting of the data therein.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;v:shape style="WIDTH: 454.05pt; HEIGHT: 184.45pt; mso-position-horizontal-relative: char; mso-position-vertical-relative: line" id=_x0000_s1064 fillcolor="#f2f2f2 [3052]" type="#_x0000_t202" wrapcoords="-37 -127 -37 21600 220 22235 220 22489 21893 22489 21893 1016 21637 -127 -37 -127"&gt;&lt;v:shadow opacity=".5" on="t" offset="6pt,6pt"&gt;&lt;/v:shadow&gt;&lt;v:textbox style="mso-next-textbox: #_x0000_s1064" inset=",5.3mm,0,5.3mm"&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0"&gt;
&lt;DIV&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Presenter&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;readonly&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;IView&lt;/SPAN&gt; view;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; Presenter(&lt;SPAN style="COLOR: #2b91af"&gt;IView&lt;/SPAN&gt; viewImpl)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.view = viewImpl;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; Search()&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.view.Results = &lt;SPAN style="COLOR: #2b91af"&gt;Model&lt;/SPAN&gt;.Search(&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.view.SearchCriteria);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 9pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/v:textbox&gt;&lt;w:wrap type="none"&gt;&lt;/w:wrap&gt;&lt;w:anchorlock&gt;&lt;/w:anchorlock&gt;&lt;/v:shape&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;FONT face=Calibri&gt;The Presenter in the example Search application (see above code extract) is very simple and contains a reference to a View (through the IView contract), a constructor which takes an IView reference as its single parameter and a single method ‘Search()’.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;The ‘Search()’ method in this example, illustrates how the Presenter interacts with the View. As shown in the code extract, the method does not take any arguments (such as the user’s ‘search criteria’). Instead it directly obtains the search criteria string from the View implementation because the Presenter knows that any View implementation must contain the read-only property ‘SearchCriteria’ of type string. Similarly, instead of returning the results of the Search through a return type (the ‘Search()’ method signature defines a return type of void), it directly sets the results to the write-only property ‘Results’ of type string collection.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;Notice also, that the ‘Search()’ method does not perform the Search operation itself, instead it invokes the Model to perform this task since its primary responsibility is to execute business operations.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;This example Presenter clearly illustrates the Presenter’s relationship with both the View and the Model. It does not know what View it is retrieving and setting data to, it is only aware of the IView interface which acts as a contract between the two components. Similarly, the Presenter does not need to know which Model it is invoking on behalf of the View. If the Presenter’s interaction with the Model is also performed using an interface (e.g. IModel) then it becomes decoupled from both of its sibling components.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;Unfortunately, the Presenter illustrated above in the example Search application does not perform much intermediary business logic such as validation, event handling, logging and other middle-tier actions. However, it should be clear that these middle-tier actions are ideally suited to the Presenter and can be implemented and tested relatively easily.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Calibri&gt;&lt;/FONT&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;BR style="PAGE-BREAK-BEFORE: always; mso-special-character: line-break" clear=all&gt;&lt;/P&gt;&lt;SPAN style="LINE-HEIGHT: 115%; TEXT-TRANSFORM: uppercase; LETTER-SPACING: 0.75pt; FONT-SIZE: 11pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;
&lt;DIV style="BORDER-BOTTOM: #dbe5f1 3pt solid; BORDER-LEFT: #dbe5f1 3pt solid; PADDING-BOTTOM: 0cm; PADDING-LEFT: 0cm; PADDING-RIGHT: 0cm; BACKGROUND: #dbe5f1; BORDER-TOP: #dbe5f1 3pt solid; BORDER-RIGHT: #dbe5f1 3pt solid; PADDING-TOP: 0cm; mso-element: para-border-div; mso-border-themecolor: accent1; mso-border-themetint: 51; mso-background-themecolor: accent1; mso-background-themetint: 51"&gt;
&lt;H2 style="MARGIN: 10pt 0cm 0pt"&gt;&lt;FONT size=3 face=Calibri&gt;Testing MVP Applications&lt;/FONT&gt;&lt;/H2&gt;&lt;/DIV&gt;
&lt;DIV style="BORDER-BOTTOM: medium none; BORDER-LEFT: #4f81bd 1pt solid; PADDING-BOTTOM: 0cm; PADDING-LEFT: 2pt; PADDING-RIGHT: 0cm; BORDER-TOP: #4f81bd 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 2pt; mso-element: para-border-div; mso-border-top-alt: solid #4F81BD .75pt; mso-border-top-themecolor: accent1; mso-border-left-alt: solid #4F81BD .75pt; mso-border-left-themecolor: accent1"&gt;
&lt;H3 style="MARGIN: 15pt 0cm 0pt"&gt;&lt;FONT color=#243f60 size=3 face=Calibri&gt;The Problem&lt;/FONT&gt;&lt;/H3&gt;&lt;/DIV&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;In traditional applications, the user interface presentational tier is tightly coupled to the business logic tier. This is because Win and Web applications contain ‘code-behind’ which performs operations both during the User Interface’s lifecycle (e.g. Page Load) and when the user interacts with the UI (event handler attached to a control’s event e.g. button click).&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;This code-behind becomes (particularly in large or complex applications) responsible for both rendering and business logic invocation. Therefore the code-behind is tightly coupled to both the Presentation tier and the Business tier. Furthermore, it is frequently necessary for the code-behind to invoke business operations and then transform the results, handle exceptions and perform complex flow-control based on the result of an operation etc. The resultant design can become unstructured and difficult to maintain.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;A further, often neglected effect of bloated code-behind is an un-testable presentation tier. Although the appearance and interaction of a User Interface can only really be tested by either manual or scripted automation tests, the overuse of code-behind means there is a great deal of logic that happens in the event handlers in the code-behind, before execution ever passes to the well unit-tested Business tier.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;DIV style="BORDER-BOTTOM: medium none; BORDER-LEFT: #4f81bd 1pt solid; PADDING-BOTTOM: 0cm; PADDING-LEFT: 2pt; PADDING-RIGHT: 0cm; BORDER-TOP: #4f81bd 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 2pt; mso-element: para-border-div; mso-border-top-alt: solid #4F81BD .75pt; mso-border-top-themecolor: accent1; mso-border-left-alt: solid #4F81BD .75pt; mso-border-left-themecolor: accent1"&gt;
&lt;H3 style="MARGIN: 15pt 0cm 0pt"&gt;&lt;FONT color=#243f60 size=3 face=Calibri&gt;The MVP Solution&lt;/FONT&gt;&lt;/H3&gt;&lt;/DIV&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;Implementing the MVP design pattern greatly increases the ability to test the presentation tier, since the View component consists almost entirely of visual logic (UI controls and basic event handlers), and all the logic surrounding the calls to the data tiers (Model) is orchestrated by the Presenter. &lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;This means that if the tests can invoke Presenter functions and inspect the state of the View, the tests will cover almost all logic code. The only part of the application left un-tested is the visual state of the user interface controls. Determining this is extremely difficult to perform programmatically and as such is normally left to manual or scripted automation tests.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;The best way of testing an MVP solution is to use a ‘Mock Object’ in place of the actual View. The mock View implements the IView interface, and is also customised to allow the tests access to View members which are inaccessible in the actual View.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;This technique of mocking the View was used to test the example Search application, as the following code extract illustrates.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;v:shape style="WIDTH: 454.05pt; HEIGHT: 226.95pt; mso-position-horizontal-relative: char; mso-position-vertical-relative: line" id=_x0000_s1063 fillcolor="#f2f2f2 [3052]" type="#_x0000_t202" wrapcoords="-37 -127 -37 21600 220 22235 220 22489 21893 22489 21893 1016 21637 -127 -37 -127"&gt;&lt;v:shadow opacity=".5" on="t" offset="6pt,6pt"&gt;&lt;/v:shadow&gt;&lt;v:textbox style="mso-next-textbox: #_x0000_s1063" inset=",5.3mm,0,5.3mm"&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0"&gt;
&lt;DIV&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;ViewMock&lt;/SPAN&gt; : &lt;SPAN style="COLOR: #2b91af"&gt;IView&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;SearchPresenter&lt;/SPAN&gt; Presenter { &lt;SPAN style="COLOR: blue"&gt;get&lt;/SPAN&gt;; &lt;SPAN style="COLOR: blue"&gt;set&lt;/SPAN&gt;; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; ViewMock()&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.Presenter = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Presenter&lt;/SPAN&gt;(&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;#region&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt; ISearchView Members&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;List&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;&amp;gt; Results { &lt;SPAN style="COLOR: blue"&gt;get&lt;/SPAN&gt;; &lt;SPAN style="COLOR: blue"&gt;set&lt;/SPAN&gt;; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; SearchCriteria { &lt;SPAN style="COLOR: blue"&gt;get&lt;/SPAN&gt;; &lt;SPAN style="COLOR: blue"&gt;set&lt;/SPAN&gt;; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;#endregion&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 9pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/v:textbox&gt;&lt;w:wrap type="none"&gt;&lt;/w:wrap&gt;&lt;w:anchorlock&gt;&lt;/w:anchorlock&gt;&lt;/v:shape&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;The above code extract illustrates the Mock View implementation created to test the example Search application. It is worth noting however that although the mock View implements the IView interface as the real web part View does, it has an extra property ‘Presenter’ and both set and get permissions on all implemented IView properties (‘Results’ and ‘SearchCriteria’). &lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;This extra ‘Presenter’ property allows the Unit Test to obtain the Presenter instance without resorting to reflection (it is necessary to obtain the View’s Presenter instance, since it is the Presenter’s functions which will be tested).&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;Furthermore, the get and set assessors on the IView implemented properties allow the Unit Test to inspect the mock View’s property values before and after a Presenter’s method has been invoked (so as to assert method pre and post conditions).&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;Without testing the mock View and instead testing the actual View, it would not be possible (without using complex and unreliable reflection) to obtain the Presenter to invoke business operations on, set-up test scenarios and inspect the View’s state during tests.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;One concern when testing a mocked View is that the extra properties and increased access to the View members is that the View being tested no longer resembles the actual View in respect of design and structure. This concern is easily remedied since the unit tests holds references to both the mock View instance directly, and also via an IView reference (see code extract below).&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;v:shape style="WIDTH: 480.7pt; HEIGHT: 338.65pt; mso-position-horizontal-relative: char; mso-position-vertical-relative: line" id=_x0000_s1062 fillcolor="#f2f2f2 [3052]" type="#_x0000_t202" wrapcoords="-37 -127 -37 21600 220 22235 220 22489 21893 22489 21893 1016 21637 -127 -37 -127"&gt;&lt;v:shadow opacity=".5" on="t" offset="6pt,6pt"&gt;&lt;/v:shadow&gt;&lt;v:textbox style="mso-next-textbox: #_x0000_s1062" inset=",5.3mm,0,5.3mm"&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0"&gt;
&lt;DIV&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;&amp;lt;summary&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;/// &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;Search test. Results expected.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;/// &amp;lt;/summary&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;[&lt;SPAN style="COLOR: #2b91af"&gt;TestMethod&lt;/SPAN&gt;()]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; SearchTest_ResultsExpected()&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;// Setup test pre-reqs and components&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;ViewMock&lt;/SPAN&gt; mockView = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;ViewMock&lt;/SPAN&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Presenter&lt;/SPAN&gt; presenter = mockView.Presenter;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;mockView.SearchCriteria = &lt;SPAN style="COLOR: #a31515"&gt;"test"&lt;/SPAN&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;ISearchView&lt;/SPAN&gt; testView = mockView;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Assert&lt;/SPAN&gt;.IsTrue(testView.SearchCriteria.Equals(mockView.SearchCriteria));&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;// Search&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;presenter.Search();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;// Assert results were found&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;// (min # results returned from search is 1 - error detail ietm)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Assert&lt;/SPAN&gt;.IsTrue(mockView.ResultsSet.Count &amp;gt; 0);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;// Assert results were valid, given the search criteria&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;foreach&lt;/SPAN&gt; (&lt;SPAN style="COLOR: #2b91af"&gt;SearchResult&lt;/SPAN&gt; r &lt;SPAN style="COLOR: blue"&gt;in&lt;/SPAN&gt; mockView.ResultsSet)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Assert&lt;/SPAN&gt;.IsNotNull(r);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Assert&lt;/SPAN&gt;.IsTrue(r.Name.IndexOf(testView.SearchCriteria) &amp;gt;= 0);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 9pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/v:textbox&gt;&lt;w:wrap type="none"&gt;&lt;/w:wrap&gt;&lt;w:anchorlock&gt;&lt;/w:anchorlock&gt;&lt;/v:shape&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;DIV style="BORDER-BOTTOM: medium none; BORDER-LEFT: #4f81bd 1pt solid; PADDING-BOTTOM: 0cm; PADDING-LEFT: 2pt; PADDING-RIGHT: 0cm; BORDER-TOP: #4f81bd 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 2pt; mso-element: para-border-div; mso-border-top-alt: solid #4F81BD .75pt; mso-border-top-themecolor: accent1; mso-border-left-alt: solid #4F81BD .75pt; mso-border-left-themecolor: accent1"&gt;
&lt;H3 style="MARGIN: 15pt 0cm 0pt"&gt;&lt;FONT color=#243f60 size=3 face=Calibri&gt;A Further Mocking Example&lt;/FONT&gt;&lt;/H3&gt;&lt;/DIV&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;The mocking solution illustrated above meets the requirements of most simplistic Views that will be developed using the MVP pattern. However as discussed in the section ‘View – Separation of Concerns’ sometimes it is necessary to implement a small amount of presentation technology-specific logic to perform validation, conversion of user input to Business types and visa versa, error handling etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;The mock View illustrated previously does not implement any of this logic and would require extra development time to re-implement the View logic inside the mock View. A workaround for this is to split the View into two tiers; a Logic tier and a Presentation tier and then create the mock View as a subclass of the abstract View Logic tier (see diagram below).&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal mce_keep="true"&gt;&lt;IMG style="WIDTH: 399px; HEIGHT: 477px" src="http://zplzpa.bay.livefilestore.com/y1psN9iuCyyLkjcD4NRkIclFmESSGeg1NVH3aYn4tJ0ZX9Yf0tQ3WaMd6VSREkVbDeAmcp5YW3BEm9Put4omuo4fQ/5-3.png" width=399 height=477 mce_src="http://zplzpa.bay.livefilestore.com/y1psN9iuCyyLkjcD4NRkIclFmESSGeg1NVH3aYn4tJ0ZX9Yf0tQ3WaMd6VSREkVbDeAmcp5YW3BEm9Put4omuo4fQ/5-3.png"&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;This allows the mock view access to the Presenter instance, the ability to expose new properties and modify assessors to allow easy inspection of View state during tests and most importantly the ability to invoke all presentation technology-specific logic held in the View Logic tier through invocation of the mock View’s base class.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;Therefore, when a unit test is run which invokes a method on the Presenter, which sets a property in the mock View, the overridden mock View’s property can invoke its base class’ property which in turn executes any validation etc against the input (see code flow diagram below).&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;v:shape style="Z-INDEX: 17; POSITION: absolute; MARGIN-TOP: 134.3pt; WIDTH: 0px; HEIGHT: 18.15pt; MARGIN-LEFT: 229.15pt" id=_x0000_s1127 strokeweight="4.5pt" type="#_x0000_t32" o:connectortype="straight"&gt;&lt;v:stroke endarrow="block"&gt;&lt;FONT face=Calibri&gt;&lt;/FONT&gt;&lt;/v:stroke&gt;&lt;/v:shape&gt;&lt;v:shape style="WIDTH: 454.05pt; HEIGHT: 133.8pt; mso-position-horizontal-relative: char; mso-position-vertical-relative: line" id=_x0000_s1031 fillcolor="#f2f2f2 [3052]" type="#_x0000_t202" wrapcoords="-37 -127 -37 21600 220 22235 220 22489 21893 22489 21893 1016 21637 -127 -37 -127"&gt;&lt;v:shadow opacity=".5" on="t" offset="6pt,6pt"&gt;&lt;/v:shadow&gt;&lt;v:textbox style="mso-next-textbox: #_x0000_s1031" inset=",5.3mm,0,5.3mm"&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0"&gt;
&lt;DIV&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;[&lt;SPAN style="COLOR: #2b91af"&gt;TestMethod&lt;/SPAN&gt;()]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; SearchTest_ResultsExpected()&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;// Mock View setup (hidden)...&lt;/SPAN&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;presenter.Search();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;// Assertions (hidden)...&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 9pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/v:textbox&gt;&lt;w:wrap type="none"&gt;&lt;/w:wrap&gt;&lt;w:anchorlock&gt;&lt;/w:anchorlock&gt;&lt;/v:shape&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;v:shape style="Z-INDEX: 18; POSITION: absolute; MARGIN-TOP: 118.45pt; WIDTH: 0px; HEIGHT: 18.15pt; MARGIN-LEFT: 229.15pt" id=_x0000_s1128 strokeweight="4.5pt" type="#_x0000_t32" o:connectortype="straight"&gt;&lt;v:stroke endarrow="block"&gt;&lt;FONT face=Calibri&gt;&lt;/FONT&gt;&lt;/v:stroke&gt;&lt;/v:shape&gt;&lt;v:shape style="WIDTH: 454.05pt; HEIGHT: 117.4pt; mso-position-horizontal-relative: char; mso-position-vertical-relative: line" id=_x0000_s1030 fillcolor="#f2f2f2 [3052]" type="#_x0000_t202" wrapcoords="-37 -127 -37 21600 220 22235 220 22489 21893 22489 21893 1016 21637 -127 -37 -127"&gt;&lt;v:shadow opacity=".5" on="t" offset="6pt,6pt"&gt;&lt;/v:shadow&gt;&lt;v:textbox style="mso-next-textbox: #_x0000_s1030" inset=",5.3mm,0,5.3mm"&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0"&gt;
&lt;DIV&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;public&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Presenter&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; TEXT-INDENT: 36pt; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;public&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; Search()&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.view.Results = &lt;SPAN style="COLOR: #2b91af"&gt;Model&lt;/SPAN&gt;.Search(&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.view.SearchCriteria);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;// Rest of Presenter class hidden...&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; mso-bidi-font-size: 9.0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/v:textbox&gt;&lt;w:wrap type="none"&gt;&lt;/w:wrap&gt;&lt;w:anchorlock&gt;&lt;/w:anchorlock&gt;&lt;/v:shape&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;v:shape style="Z-INDEX: 19; POSITION: absolute; MARGIN-TOP: 152.3pt; WIDTH: 0px; HEIGHT: 18.15pt; MARGIN-LEFT: 229.15pt" id=_x0000_s1129 strokeweight="4.5pt" type="#_x0000_t32" o:connectortype="straight"&gt;&lt;v:stroke endarrow="block"&gt;&lt;FONT face=Calibri&gt;&lt;/FONT&gt;&lt;/v:stroke&gt;&lt;/v:shape&gt;&lt;v:shape style="WIDTH: 454.05pt; HEIGHT: 151.1pt; mso-position-horizontal-relative: char; mso-position-vertical-relative: line" id=_x0000_s1029 fillcolor="#f2f2f2 [3052]" type="#_x0000_t202" wrapcoords="-37 -127 -37 21600 220 22235 220 22489 21893 22489 21893 1016 21637 -127 -37 -127"&gt;&lt;v:shadow opacity=".5" on="t" offset="6pt,6pt"&gt;&lt;/v:shadow&gt;&lt;v:textbox style="mso-next-textbox: #_x0000_s1029" inset=",5.3mm,0,5.3mm"&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0"&gt;
&lt;DIV&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;MockViewLogic&lt;/SPAN&gt; : &lt;SPAN style="COLOR: #2b91af"&gt;ViewLogic&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;override&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;List&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;&amp;gt; Results&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;set&lt;/SPAN&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;base&lt;/SPAN&gt;.Results = &lt;SPAN style="COLOR: blue"&gt;value&lt;/SPAN&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;// Rest of mock view hidden...&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/v:textbox&gt;&lt;w:wrap type="none"&gt;&lt;/w:wrap&gt;&lt;w:anchorlock&gt;&lt;/w:anchorlock&gt;&lt;/v:shape&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;v:shape style="WIDTH: 454.05pt; HEIGHT: 185.8pt; mso-position-horizontal-relative: char; mso-position-vertical-relative: line" id=_x0000_s1028 fillcolor="#f2f2f2 [3052]" type="#_x0000_t202" wrapcoords="-37 -127 -37 21600 220 22235 220 22489 21893 22489 21893 1016 21637 -127 -37 -127"&gt;&lt;v:shadow opacity=".5" on="t" offset="6pt,6pt"&gt;&lt;/v:shadow&gt;&lt;v:textbox style="mso-next-textbox: #_x0000_s1028" inset=",5.3mm,0,5.3mm"&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0"&gt;
&lt;DIV&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;public&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;ViewLogic&lt;/SPAN&gt;: &lt;SPAN style="COLOR: #2b91af"&gt;WebPart, IView&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; TEXT-INDENT: 36pt; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;public&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt; &lt;SPAN style="COLOR: blue"&gt;virtual&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;List&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;&amp;gt; Results&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;set&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;// Validation&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;// Error handling&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;// Localisation&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;// etc...&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;// Rest of view logic abstract class hidden...&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 9pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/v:textbox&gt;&lt;w:wrap type="none"&gt;&lt;/w:wrap&gt;&lt;w:anchorlock&gt;&lt;/w:anchorlock&gt;&lt;/v:shape&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;This form of mocking the MVP View allows for more pervasive and complete testing of the View component.&lt;/FONT&gt;&lt;/P&gt;
&lt;DIV style="BORDER-BOTTOM: #dbe5f1 3pt solid; BORDER-LEFT: #dbe5f1 3pt solid; PADDING-BOTTOM: 0cm; PADDING-LEFT: 0cm; PADDING-RIGHT: 0cm; BACKGROUND: #dbe5f1; BORDER-TOP: #dbe5f1 3pt solid; BORDER-RIGHT: #dbe5f1 3pt solid; PADDING-TOP: 0cm; mso-element: para-border-div; mso-border-themecolor: accent1; mso-border-themetint: 51; mso-background-themecolor: accent1; mso-background-themetint: 51"&gt;
&lt;H2 style="MARGIN: 10pt 0cm 0pt"&gt;&lt;FONT size=3 face=Calibri&gt;Presentational Interoperability&lt;/FONT&gt;&lt;/H2&gt;&lt;/DIV&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;The following code extracts are given so as to illustrate how to implement a View for the example Search application, given its simple IView interface. One View is implemented as an ASP.NET web part, the other as a client side WPF application.&lt;/FONT&gt;&lt;/P&gt;
&lt;DIV style="BORDER-BOTTOM: medium none; BORDER-LEFT: #4f81bd 1pt solid; PADDING-BOTTOM: 0cm; PADDING-LEFT: 2pt; PADDING-RIGHT: 0cm; BORDER-TOP: #4f81bd 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 2pt; mso-element: para-border-div; mso-border-top-alt: solid #4F81BD .75pt; mso-border-top-themecolor: accent1; mso-border-left-alt: solid #4F81BD .75pt; mso-border-left-themecolor: accent1"&gt;
&lt;H3 style="MARGIN: 15pt 0cm 0pt"&gt;&lt;FONT color=#243f60 size=3 face=Calibri&gt;ASP.NET Web Part Implementation&lt;/FONT&gt;&lt;/H3&gt;&lt;/DIV&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&amp;nbsp;&lt;IMG style="WIDTH: 413px; HEIGHT: 309px" src="http://zplzpa.bay.livefilestore.com/y1pHEjb-BEzOjcAwRYf1Glg_NTPpJ_N8AcCOlx7mJkotdjvvVaclNOlu-Yqbu3HL8H1j47ThzXV_DBcnQBANiMBtQ/5-6.png" width=413 height=309 mce_src="http://zplzpa.bay.livefilestore.com/y1pHEjb-BEzOjcAwRYf1Glg_NTPpJ_N8AcCOlx7mJkotdjvvVaclNOlu-Yqbu3HL8H1j47ThzXV_DBcnQBANiMBtQ/5-6.png"&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;v:shape style="WIDTH: 442pt; HEIGHT: 574pt; mso-position-horizontal-relative: char; mso-position-vertical-relative: line" id=_x0000_s1027 fillcolor="#f2f2f2 [3052]" type="#_x0000_t202" wrapcoords="-37 -61 -37 21600 220 22028 21893 22028 21893 490 21637 -61 -37 -61"&gt;&lt;v:shadow opacity=".5" on="t" offset="6pt,6pt"&gt;&lt;/v:shadow&gt;&lt;v:textbox style="mso-next-textbox: #_x0000_s1027" inset=",5.3mm,,5.3mm"&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0"&gt;
&lt;DIV&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;ViewImpl&lt;/SPAN&gt; : &lt;SPAN style="COLOR: #2b91af"&gt;WebPart&lt;/SPAN&gt;, &lt;SPAN style="COLOR: #2b91af"&gt;IView&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Presenter&lt;/SPAN&gt; presenter;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Label&lt;/SPAN&gt; lblSearch = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Label&lt;/SPAN&gt;() { Text = &lt;SPAN style="COLOR: #a31515"&gt;"Enter bank to search for: "&lt;/SPAN&gt; };&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Button&lt;/SPAN&gt; btnSearch = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Button&lt;/SPAN&gt;() { Text = &lt;SPAN style="COLOR: #a31515"&gt;"Search"&lt;/SPAN&gt; };&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;BulletedList&lt;/SPAN&gt; resultsList = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;BulletedList&lt;/SPAN&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;TextBox&lt;/SPAN&gt; tbSearchCriteria = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;TextBox&lt;/SPAN&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;ViewImpl&lt;/SPAN&gt;()&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.presenter = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Presenter&lt;/SPAN&gt;(&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;protected&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;override&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; CreateChildControls()&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.Controls.Clear();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.btnSearch.Click += &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;EventHandler&lt;/SPAN&gt;(btnSearch_Click);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.Controls.Add(&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.lblSearch);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.Controls.Add(&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.tbSearchCriteria);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.Controls.Add(&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.btnSearch);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.Controls.Add(&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.resultsList);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.ChildControlsCreated = &lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; btnSearch_Click(&lt;SPAN style="COLOR: blue"&gt;object&lt;/SPAN&gt; sender, &lt;SPAN style="COLOR: #2b91af"&gt;EventArgs&lt;/SPAN&gt; e)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.presenter.Search();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;#region&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt; IView Members&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; SearchCriteria&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;get&lt;/SPAN&gt; { &lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.tbSearchCriteria.Text; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;List&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;&amp;gt; Results&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;set&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.resultsList.Items.Clear();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;List&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;&amp;gt; results = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;List&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;&amp;gt;(&lt;SPAN style="COLOR: blue"&gt;value&lt;/SPAN&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;foreach&lt;/SPAN&gt; (&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; r &lt;SPAN style="COLOR: blue"&gt;in&lt;/SPAN&gt; results)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.resultsList.Items.Add(r);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;#endregion&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/v:textbox&gt;&lt;w:wrap type="none"&gt;&lt;/w:wrap&gt;&lt;w:anchorlock&gt;&lt;/w:anchorlock&gt;&lt;/v:shape&gt;&lt;/P&gt;
&lt;DIV style="BORDER-BOTTOM: medium none; BORDER-LEFT: #4f81bd 1pt solid; PADDING-BOTTOM: 0cm; PADDING-LEFT: 2pt; PADDING-RIGHT: 0cm; BORDER-TOP: #4f81bd 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 2pt; mso-element: para-border-div; mso-border-top-alt: solid #4F81BD .75pt; mso-border-top-themecolor: accent1; mso-border-left-alt: solid #4F81BD .75pt; mso-border-left-themecolor: accent1"&gt;
&lt;H3 style="MARGIN: 15pt 0cm 0pt"&gt;&lt;FONT color=#243f60 size=3 face=Calibri&gt;WPF Implementation&lt;/FONT&gt;&lt;/H3&gt;&lt;/DIV&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&amp;nbsp;&lt;IMG style="WIDTH: 383px; HEIGHT: 265px" src="http://zplzpa.bay.livefilestore.com/y1pd_vcqzLHWK0KoY30YehJUo-2OlwnlFgt34xQxd54JfWRnI861jUHICZEY8u9eZoFLImd7fe_g-Dp30llQv8cPw/5-4.png" width=383 height=265 mce_src="http://zplzpa.bay.livefilestore.com/y1pd_vcqzLHWK0KoY30YehJUo-2OlwnlFgt34xQxd54JfWRnI861jUHICZEY8u9eZoFLImd7fe_g-Dp30llQv8cPw/5-4.png"&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;v:shape style="WIDTH: 442pt; HEIGHT: 427pt; mso-position-horizontal-relative: char; mso-position-vertical-relative: line" id=_x0000_s1026 fillcolor="#f2f2f2 [3052]" type="#_x0000_t202" wrapcoords="-37 -61 -37 21600 220 22028 21893 22028 21893 490 21637 -61 -37 -61"&gt;&lt;v:shadow opacity=".5" on="t" offset="6pt,6pt"&gt;&lt;/v:shadow&gt;&lt;v:textbox style="mso-next-textbox: #_x0000_s1026" inset=",5.3mm,,5.3mm"&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0"&gt;
&lt;DIV&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;partial&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Client&lt;/SPAN&gt; : &lt;SPAN style="COLOR: #2b91af"&gt;Window&lt;/SPAN&gt;, &lt;SPAN style="COLOR: #2b91af"&gt;IView&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;SearchPresenter&lt;/SPAN&gt; presenter;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; Client()&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.presenter = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;SearchPresenter&lt;/SPAN&gt;(&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;InitializeComponent();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; button1_Click(&lt;SPAN style="COLOR: blue"&gt;object&lt;/SPAN&gt; sender, &lt;SPAN style="COLOR: #2b91af"&gt;RoutedEventArgs&lt;/SPAN&gt; e)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.presenter.Search();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;#region&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt; ISearchView Members&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;List&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;&amp;gt; Results&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;set&lt;/SPAN&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.listBox1.Items.Clear();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;foreach&lt;/SPAN&gt; (&lt;SPAN style="COLOR: #2b91af"&gt;SearchResult&lt;/SPAN&gt; r &lt;SPAN style="COLOR: blue"&gt;in&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;value&lt;/SPAN&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.listBox1.Items.Add(r.ToString());&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; SearchCriteria&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;get&lt;/SPAN&gt; { &lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.tbSearchCriteria.Text; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;#endregion&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes; mso-bidi-language: AR-SA"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 9pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/v:textbox&gt;&lt;w:wrap type="none"&gt;&lt;/w:wrap&gt;&lt;w:anchorlock&gt;&lt;/w:anchorlock&gt;&lt;/v:shape&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Calibri','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-fareast; mso-bidi-theme-font: minor-bidi; mso-fareast-language: EN-US; mso-bidi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-ansi-language: EN-GB"&gt;&lt;BR style="PAGE-BREAK-BEFORE: always; mso-special-character: line-break" clear=all&gt;&lt;/SPAN&gt;
&lt;P style="MARGIN: 10pt 0cm" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; TEXT-TRANSFORM: uppercase; LETTER-SPACING: 0.75pt; FONT-SIZE: 11pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV style="BORDER-BOTTOM: #dbe5f1 3pt solid; BORDER-LEFT: #dbe5f1 3pt solid; PADDING-BOTTOM: 0cm; PADDING-LEFT: 0cm; PADDING-RIGHT: 0cm; BACKGROUND: #dbe5f1; BORDER-TOP: #dbe5f1 3pt solid; BORDER-RIGHT: #dbe5f1 3pt solid; PADDING-TOP: 0cm; mso-element: para-border-div; mso-border-themecolor: accent1; mso-border-themetint: 51; mso-background-themecolor: accent1; mso-background-themetint: 51"&gt;
&lt;H2 style="MARGIN: 10pt 0cm 0pt"&gt;&lt;FONT size=3 face=Calibri&gt;Links&lt;/FONT&gt;&lt;/H2&gt;&lt;/DIV&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 10pt 0cm 0pt 36pt; mso-list: l6 level1 lfo7" class=MsoListParagraphCxSpFirst&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;§&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;A href="http://blog.vuscode.com/malovicn/archive/2007/11/04/model-view-presenter-mvp-design-pattern-close-look-part-2-passive-view.aspx"&gt;&lt;FONT color=#0000ff face=Calibri&gt;http://blog.vuscode.com/malovicn/archive/2007/11/04/model-view-presenter-mvp-design-pattern-close-look-part-2-passive-view.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;BR style="mso-special-character: line-break"&gt;&lt;BR style="mso-special-character: line-break"&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l6 level1 lfo7" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;§&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;A href="http://weblogs.asp.net/bsimser/archive/2006/07/18/Model_2D00_View_2D00_Presenter-Pattern-with-SharePoint-Web-Parts.aspx"&gt;&lt;FONT color=#0000ff face=Calibri&gt;http://weblogs.asp.net/bsimser/archive/2006/07/18/Model_2D00_View_2D00_Presenter-Pattern-with-SharePoint-Web-Parts.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;BR style="mso-special-character: line-break"&gt;&lt;BR style="mso-special-character: line-break"&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l6 level1 lfo7" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;§&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;A href="http://geekswithblogs.net/Podwysocki/archive/2007/12/20/117881.aspx"&gt;&lt;FONT color=#0000ff face=Calibri&gt;http://geekswithblogs.net/Podwysocki/archive/2007/12/20/117881.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;BR style="mso-special-character: line-break"&gt;&lt;BR style="mso-special-character: line-break"&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l6 level1 lfo7" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;§&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;A href="http://en.wikipedia.org/wiki/Model_View_Presenter"&gt;&lt;FONT color=#0000ff face=Calibri&gt;http://en.wikipedia.org/wiki/Model_View_Presenter&lt;/FONT&gt;&lt;/A&gt;&lt;BR style="mso-special-character: line-break"&gt;&lt;BR style="mso-special-character: line-break"&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l6 level1 lfo7" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;§&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;A href="http://en.wikipedia.org/wiki/Mock_object"&gt;&lt;FONT color=#0000ff face=Calibri&gt;http://en.wikipedia.org/wiki/Mock_object&lt;/FONT&gt;&lt;/A&gt;&lt;BR style="mso-special-character: line-break"&gt;&lt;BR style="mso-special-character: line-break"&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l6 level1 lfo7" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;§&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;A href="http://msdn.microsoft.com/en-us/magazine/cc188690.aspx"&gt;&lt;FONT color=#0000ff face=Calibri&gt;http://msdn.microsoft.com/en-us/magazine/cc188690.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;BR style="mso-special-character: line-break"&gt;&lt;BR style="mso-special-character: line-break"&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 10pt 36pt; mso-list: l6 level1 lfo7" class=MsoListParagraphCxSpLast&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;§&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT color=#0000ff face=Calibri&gt;&lt;A href="http://www.martinfowler.com/eaaDev/ModelViewPresenter.html"&gt;http://www.martinfowler.com/eaaDev/ModelViewPresenter.html&lt;/A&gt;&lt;/FONT&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Calibri','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-fareast; mso-bidi-theme-font: minor-bidi; mso-fareast-language: EN-US; mso-bidi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-ansi-language: EN-GB"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 10pt 36pt; mso-list: l6 level1 lfo7" class=MsoListParagraphCxSpLast&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Calibri','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-fareast; mso-bidi-theme-font: minor-bidi; mso-fareast-language: EN-US; mso-bidi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-ansi-language: EN-GB"&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;§&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;A href="http://en.wikipedia.org/wiki/Factory_method"&gt;&lt;FONT color=#0000ff&gt;http://en.wikipedia.org/wiki/Factory_method&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8936610" width="1" height="1"&gt;</content><author><name>jowardel</name><uri>http://blogs.msdn.com/members/jowardel.aspx</uri></author></entry><entry><title>Windows Mobile dev - Emulator network connection</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/jowardel/archive/2008/08/14/windows-mobile-dev-emulator-network-connection.aspx" /><id>http://blogs.msdn.com/jowardel/archive/2008/08/14/windows-mobile-dev-emulator-network-connection.aspx</id><published>2008-08-14T10:54:00Z</published><updated>2008-08-14T10:54:00Z</updated><content type="html">&lt;P&gt;Recently I've had to do a spot of Windows Mobile dev, part of which requires the mobile app to call a webservice, simple enough you may think. Well it is once you can figure out how to get the emulator to use the host&amp;nbsp;network connection.&lt;/P&gt;
&lt;P&gt;So here's how I got the emulator to use the host's network:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Firstly, deploy your smart device project to the emulator as normal&lt;/LI&gt;
&lt;LI&gt;Once deployed, open the Device Emulator Manager in VS (Tools &amp;gt; Device Emulator Manager)&lt;IMG style="WIDTH: 474px; HEIGHT: 335px" align=middle src="http://zplzpa.bay.livefilestore.com/y1puVZT0pB95cB4hvTWRg-xoQRN7CSBWmo57ta-GeBUuUytAKdTeBEn-4rNV1to08orR6YkzYmgm4VDvHtkd2wSSA/4-1.png" width=474 height=335 mce_src="http://zplzpa.bay.livefilestore.com/y1puVZT0pB95cB4hvTWRg-xoQRN7CSBWmo57ta-GeBUuUytAKdTeBEn-4rNV1to08orR6YkzYmgm4VDvHtkd2wSSA/4-1.png"&gt;&lt;/LI&gt;
&lt;LI&gt;You should see next to one of the types of emulator you can run, a little green arrow indicating this is the emulator currently running&lt;/LI&gt;
&lt;LI&gt;Right click on that emulator, and select 'Cradle'&lt;/LI&gt;
&lt;LI&gt;A bunch of ActiveSync (by the way you need ActiveSync) messages will pop up, just dismiss them. A guest partnership is all you need.&lt;/LI&gt;
&lt;LI&gt;ActiveSync will now treat the emulator as a real physical mobile device and give it access to the host's network access via a DMA channel.&lt;/LI&gt;
&lt;LI&gt;The Emulator should pop up with a notification to indicate it has network access&lt;/LI&gt;
&lt;LI&gt;Ensure if you're using a proxy, to set that information in the emulator's network settings&lt;/LI&gt;
&lt;LI&gt;You're done!&lt;/LI&gt;&lt;/OL&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8865579" width="1" height="1"&gt;</content><author><name>jowardel</name><uri>http://blogs.msdn.com/members/jowardel.aspx</uri></author><category term="emulator network connection" scheme="http://blogs.msdn.com/jowardel/archive/tags/emulator+network+connection/default.aspx" /><category term="windows mobile" scheme="http://blogs.msdn.com/jowardel/archive/tags/windows+mobile/default.aspx" /><category term="web service" scheme="http://blogs.msdn.com/jowardel/archive/tags/web+service/default.aspx" /></entry><entry><title>Installing SmartPart for Sharepoint (with a dash of WCF) 2 of 2</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/jowardel/archive/2008/08/08/installing-smartpart-for-sharepoint-with-a-dash-of-wcf-2-of-2.aspx" /><id>http://blogs.msdn.com/jowardel/archive/2008/08/08/installing-smartpart-for-sharepoint-with-a-dash-of-wcf-2-of-2.aspx</id><published>2008-08-08T18:57:00Z</published><updated>2008-08-08T18:57:00Z</updated><content type="html">&lt;P&gt;In my last post I explained (as countless other blogs have) how to install SmartPart on SharePoint and get a user control to display inside it. Now I'm going to try and give you a few pointers on some of the pitfalls involved in trying to get your WebPart to call a WCF service (short and sweet really).&lt;/P&gt;
&lt;P&gt;First and rather obviously, move the system.serviceModel element under the configuration root element in your website's web.config. This means your webpart will have access to the binding and endpoint information when you make the service call.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;lt;system.serviceModel&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;bindings&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;basicHttpBinding&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;binding name="BasicHttpBinding_IRegistrationService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;security mode="None"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;transport clientCredentialType="None" proxyCredentialType="None" realm=""/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;message clientCredentialType="UserName" algorithmSuite="Default"/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/security&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/binding&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/basicHttpBinding&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/bindings&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;client&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;endpoint address="http://localhost:8732/Design_Time_Addresses/POC/RegistrationService/" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IRegistrationService" contract="RegistrationService.IRegistrationService" name="BasicHttpBinding_IRegistrationService"/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/client&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;/system.serviceModel&amp;gt;&lt;BR&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I tried calling the service from inside&amp;nbsp;my user control (wrapped up inside the SmartPart)&amp;nbsp;I got a wierd&amp;nbsp;exception telling me 'Request for the permission of type 'System.Net.WebPermission' failed', something to do with permissions my keen developer instinct told me.&lt;/P&gt;
&lt;P&gt;It turns out that your SharePoint's default web.config stipulates only minimal trust for all user assemblies executing within its context (this is controlled by the CLR's CAS security block). To fix it, i set my website's trust level to 'Full'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;trust level="Full" originUrl="" /&amp;gt;&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;This is obviously not reccommended for blatantly obvious security reasons but for my test purposes on my personal little sharepoint box it did the job! Now I can call WCF services in glorious technicolour.&lt;/P&gt;
&lt;P&gt;Hope that helps.&lt;BR&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8843779" width="1" height="1"&gt;</content><author><name>jowardel</name><uri>http://blogs.msdn.com/members/jowardel.aspx</uri></author><category term="wcf" scheme="http://blogs.msdn.com/jowardel/archive/tags/wcf/default.aspx" /><category term="web.config" scheme="http://blogs.msdn.com/jowardel/archive/tags/web_2E00_config/default.aspx" /><category term="webpart" scheme="http://blogs.msdn.com/jowardel/archive/tags/webpart/default.aspx" /><category term="sharepoint" scheme="http://blogs.msdn.com/jowardel/archive/tags/sharepoint/default.aspx" /><category term="System.Net.WebPermission" scheme="http://blogs.msdn.com/jowardel/archive/tags/System.Net.WebPermission/default.aspx" /></entry><entry><title>Installing SmartPart for Sharepoint (with a dash of WCF) 1 of 2</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/jowardel/archive/2008/08/08/installing-smartpart-for-sharepoint-with-a-dash-of-wcf-1-of-2.aspx" /><id>http://blogs.msdn.com/jowardel/archive/2008/08/08/installing-smartpart-for-sharepoint-with-a-dash-of-wcf-1-of-2.aspx</id><published>2008-08-08T18:18:00Z</published><updated>2008-08-08T18:18:00Z</updated><content type="html">&lt;P&gt;It's a friday afternoon and I've just spent the better part of the day banging my head against SharePoint, so in a break from tradition I've decided to blog about how I got it working.&lt;/P&gt;
&lt;P&gt;For those who don't know, SmartPart is a funky little Web Part for SharePoint. It allows lazy people (such as myself) to develop ASP.NET user controls with Visual Studio's WYSIWYG editor and then wrap them up as though they were a true orthodox WebPart. As I'm sure you're all aware, web parts are in actuality custom controls which require the developer to write code to output the presentational HTML, so SmartPart can save you a gret deal of time and effort.&lt;/P&gt;
&lt;P&gt;1) So firstly, download SmartPart from codeplex.com/smartpart&lt;/P&gt;
&lt;P&gt;2) Run the installer which checks you have WSS and all that jazz&lt;/P&gt;
&lt;P&gt;3) Stick the SmartPart assembly in the GAC (c:\windows\assembly)&lt;/P&gt;
&lt;P&gt;4) Activate the feature to your chosen site collection&lt;/P&gt;
&lt;P&gt;5) Edit&amp;nbsp;a test page and add a web part&lt;/P&gt;
&lt;P&gt;6) Select Smart Part from the web part gallery dialogue you're presented with&lt;/P&gt;
&lt;P&gt;Now you may be luckier than I, but at this point for the me SharePoint fell over and complained that the SmartPart webpart was not trusted. So you have to go into the web.config for your website and add the SmartPart.dll as a SafeControl.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;SafeControl Assembly="ReturnOfSmartPart, Version=1.3.0.0, Culture=neutral, PublicKeyToken=9f4da00116c38ec5" Namespace="SmartPart" TypeName="*" Safe="True" AllowRemoteDesigner="True" /&amp;gt;&lt;BR&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;7) Try to add the SmartPart webpart again and this time it should work.&lt;/P&gt;
&lt;P&gt;8) Next add two dirctories to your website; UserControls and Bin. The former is where your ASCX user controls (and their code-behind) will reside, and the latter is where the corresponding user control assembly will sit (if you have any classes/interfaces which are not control code files, for example WCF proxies).&lt;/P&gt;
&lt;P&gt;9) Now you should be in a state where you can put user control ASCXs etc on your website and SmartPart can find them.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;IMG style="WIDTH: 566px; HEIGHT: 426px" align=left src="http://zplzpa.bay.livefilestore.com/y1p9M22eGCsTFBoWNJ7yxBckSrWI2zYQ4Z5ETtnKFYHF6XVEeQBMsb5UgZ9gorttIwQphFpFIxe2p_fGFfndeXnog/2-1.png" width=566 height=426 mce_src="http://zplzpa.bay.livefilestore.com/y1p9M22eGCsTFBoWNJ7yxBckSrWI2zYQ4Z5ETtnKFYHF6XVEeQBMsb5UgZ9gorttIwQphFpFIxe2p_fGFfndeXnog/2-1.png"&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In my next blog I will explain some of subtlteties involved in calling a WCF service from within the SmartPart webpart. Hope this was of use to someone.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8843711" width="1" height="1"&gt;</content><author><name>jowardel</name><uri>http://blogs.msdn.com/members/jowardel.aspx</uri></author><category term="SmartPart" scheme="http://blogs.msdn.com/jowardel/archive/tags/SmartPart/default.aspx" /><category term="wcf" scheme="http://blogs.msdn.com/jowardel/archive/tags/wcf/default.aspx" /><category term="web.config" scheme="http://blogs.msdn.com/jowardel/archive/tags/web_2E00_config/default.aspx" /><category term="webpart" scheme="http://blogs.msdn.com/jowardel/archive/tags/webpart/default.aspx" /><category term="asp.net" scheme="http://blogs.msdn.com/jowardel/archive/tags/asp.net/default.aspx" /><category term="sharepoint" scheme="http://blogs.msdn.com/jowardel/archive/tags/sharepoint/default.aspx" /></entry><entry><title>Shiny new blog</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/jowardel/archive/2008/04/16/shiny-new-blog.aspx" /><id>http://blogs.msdn.com/jowardel/archive/2008/04/16/shiny-new-blog.aspx</id><published>2008-04-16T18:41:00Z</published><updated>2008-04-16T18:41:00Z</updated><content type="html">This is my new MSDN blog. Work/Life balance permitting (lol) I'll update this with dev hints, tips and tricks which will hopefully elucidate a few people.&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8399123" width="1" height="1"&gt;</content><author><name>jowardel</name><uri>http://blogs.msdn.com/members/jowardel.aspx</uri></author></entry></feed>