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

<channel>
	<title>Association Thoughts &#187; .NET Programming</title>
	<atom:link href="http://associationthoughts.com/blog/archives/category/net-programming/feed" rel="self" type="application/rss+xml" />
	<link>http://associationthoughts.com/blog</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Mon, 19 Sep 2011 16:55:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>jQueryMobile</title>
		<link>http://associationthoughts.com/blog/archives/204</link>
		<comments>http://associationthoughts.com/blog/archives/204#comments</comments>
		<pubDate>Mon, 19 Sep 2011 16:55:19 +0000</pubDate>
		<dc:creator>grantmcinnes</dc:creator>
				<category><![CDATA[.NET Programming]]></category>

		<guid isPermaLink="false">http://associationthoughts.com/blog/archives/204</guid>
		<description><![CDATA[  Implementing jQueryMobile in .NET Framework v2.0 Create a new MVC 2.0 project Modify the Views\Shared\Site.master file to include the following header includes:   &#60;link rel=&#8221;stylesheet&#8221; href=&#8221;http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.css&#8221; /&#62; &#60;script type=&#8221;text/javascript&#8221; src=&#8221;http://code.jquery.com/jquery-1.6.1.min.js&#8221;&#62;&#60;/script&#62; &#60;script type=&#8221;text/javascript&#8221; src=&#8221;http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.js&#8221;&#62;&#60;/script&#62;   Modify the div footer with the following markup: &#60;div data-role=&#8221;footer&#8221; id=&#8221;footer&#8221; data-theme=&#8221;a&#8221;&#62; &#60;h4&#62;Page Footer&#60;/h4&#62; &#60;/div&#62;]]></description>
			<content:encoded><![CDATA[<p>
 </p>
<p>Implementing jQueryMobile in .NET Framework v2.0
</p>
<p>Create a new MVC 2.0 project
</p>
<p>Modify the Views\Shared\Site.master file to include the following header includes:
</p>
<p>
 </p>
<p><span style="color:blue; font-family:Consolas; font-size:9pt">&lt;<span style="color:maroon">link</span><br />
			<span style="color:red">rel<span style="color:blue">=&#8221;stylesheet&#8221;</span> href<span style="color:blue">=&#8221;http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.css&#8221;</span><br />
				<span style="color:blue">/&gt;</span><br />
			</span></span></p>
<p><span style="color:blue; font-family:Consolas; font-size:9pt">&lt;<span style="color:maroon">script</span><br />
			<span style="color:red">type<span style="color:blue">=&#8221;text/javascript&#8221;</span> src<span style="color:blue">=&#8221;http://code.jquery.com/jquery-1.6.1.min.js&#8221;&gt;&lt;/<span style="color:maroon">script<span style="color:blue">&gt;</span><br />
					</span></span></span></span></p>
<p><span style="color:blue; font-family:Consolas; font-size:9pt">&lt;<span style="color:maroon">script</span><br />
			<span style="color:red">type<span style="color:blue">=&#8221;text/javascript&#8221;</span> src<span style="color:blue">=&#8221;http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.js&#8221;&gt;&lt;/<span style="color:maroon">script<span style="color:blue">&gt;</span><br />
					</span></span></span></span></p>
<p>
 </p>
<p>Modify the div footer with the following markup:
</p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
			<span style="color:blue">&lt;<span style="color:maroon">div</span><br />
				<span style="color:red">data-role<span style="color:blue">=&#8221;footer&#8221;</span> id<span style="color:blue">=&#8221;footer&#8221;</span>  data-theme<span style="color:blue">=&#8221;a&#8221;&gt;</span><br />
				</span></span></span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
			<span style="color:blue">&lt;<span style="color:maroon">h4<span style="color:blue">&gt;</span>Page Footer<span style="color:blue">&lt;/<span style="color:maroon">h4<span style="color:blue">&gt;</span><br />
						</span></span></span></span></span></p>
<p><span style="font-family:Consolas; font-size:9pt"><br />
			<span style="color:blue">&lt;/<span style="color:maroon">div<span style="color:blue">&gt;<br />
</span></span></span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://associationthoughts.com/blog/archives/204/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MVC steps to create a new Model, View and Controller</title>
		<link>http://associationthoughts.com/blog/archives/198</link>
		<comments>http://associationthoughts.com/blog/archives/198#comments</comments>
		<pubDate>Tue, 29 Mar 2011 18:44:34 +0000</pubDate>
		<dc:creator>grantmcinnes</dc:creator>
				<category><![CDATA[.NET Programming]]></category>

		<guid isPermaLink="false">http://associationthoughts.com/blog/archives/198</guid>
		<description><![CDATA[In the MVC project, select the Models folder and create a new class, Customer. The Customer class has the following properties: public class Customer { &#160;&#160;&#160; public string Id { get; set; } &#160;&#160;&#160; public string FullName { get; set; } } Build the solution so that the Customer class will be available when we [...]]]></description>
			<content:encoded><![CDATA[<p>In the MVC project, select the Models folder and create a new class, Customer.</p>
<p>The Customer class has the following properties:</p>
<p>public class Customer   <br />{    <br />&#160;&#160;&#160; public string Id { get; set; }    <br />&#160;&#160;&#160; public string FullName { get; set; }    <br />}</p>
<p>Build the solution so that the Customer class will be available when we build the View later on.</p>
<p>In the Controllers folder, create a new Controller, CustomerController and leave the checkbox checked which reads “Add action methods for Create, Update, Delete and Details scenarios”.</p>
<p>In this example, I am going to delete everything but the Index and Details methods.</p>
<p>Now let’s create the view. Right click inside the Index method and choose Add View. Leave the view name Index and in the View data class list, choose Customer so that a strongly typed view will be created based on the Customer class we created above. Choose List from the View content list and click the Add button to generate the Index view.</p>
<p>The Index view will be created in a new Customer folder named Index.aspx and will have all the properties of the Customer class displayed on the page. The generated code looks like this:</p>
<p>&lt;h2&gt;Index&lt;/h2&gt;</p>
<p>&lt;table&gt;   <br />&#160;&#160;&#160; &lt;tr&gt;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;th&gt;&lt;/th&gt;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;th&gt;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Id    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/th&gt;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;th&gt;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; FullName    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/th&gt;    <br />&#160;&#160;&#160; &lt;/tr&gt;</p>
<p>&lt;% foreach (var item in Model) { %&gt;</p>
<p>&#160;&#160;&#160; &lt;tr&gt;   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;td&gt;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;%: Html.ActionLink(&quot;Details&quot;, &quot;Details&quot;, new { id=item.Id })%&gt; |    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/td&gt;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;td&gt;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;%: item.Id %&gt;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/td&gt;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;td&gt;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;%: item.FullName %&gt;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/td&gt;    <br />&#160;&#160;&#160; &lt;/tr&gt;</p>
<p>&lt;% } %&gt;</p>
<p>&lt;/table&gt;   </p>
<p>&#160;</p>
<p>One property we need to change is the key which is passed to the Details page. Look for the following line in the generated code:</p>
<p>&lt;%: Html.ActionLink(&quot;Details&quot;, &quot;Details&quot;, new { /* id=item.PrimaryKey */ })%&gt;</p>
<p>We need to change PrimaryKey to be the property of our unique value that will be passed to retrieve a Customer. In this case, the value is Customer.Id so change the line to read:</p>
<p>&lt;%: Html.ActionLink(&quot;Details&quot;, &quot;Details&quot;, new { /* id=item.Id */ })%&gt;    <br />where item is the single instance of a Customer in the Model.</p>
<p>&#160;</p>
<p>The code behind for our controller looks like this:</p>
<p>public List&lt;Customer&gt; CustomerList;</p>
<p>public CustomerController()   <br />{    <br />&#160;&#160;&#160; CustomerList = new List&lt;Customer&gt;();    <br />&#160;&#160;&#160; var c1 = new Customer() { Id = &quot;1&quot;, FullName = &quot;Peyton Manning&quot; };    <br />&#160;&#160;&#160; var c2 = new Customer { Id = &quot;2&quot;, FullName = &quot;Drew Brees&quot; };    <br />&#160;&#160;&#160; CustomerList.Add(c1);    <br />&#160;&#160;&#160; CustomerList.Add(c2);    <br />}</p>
<p>//   <br />// GET: /Customer/</p>
<p>public ActionResult Index()   <br />{</p>
<p>&#160;&#160;&#160; // In this case, View is a list of Customers   <br />&#160;&#160;&#160; return View(CustomerList.ToList());</p>
<p>}   </p>
<p>&#160;</p>
<p>Next we will add code to the Details method to lookup the Customer based on the link clicked on in the List on the Index view. This will pass the Customer.Id into the Details method and it’s code looks like this:</p>
<p>public ActionResult Details(string id)   <br />{</p>
<p>&#160;&#160;&#160; var FindCustomer = CustomerList.Find(result =&gt; result.Id == id);   <br />&#160;&#160;&#160; return View(FindCustomer);    <br />}</p>
<p>Next we need to create the Details view by right clicking inside the Details method and choosing Add View. Leave the view name Details and in the View data class list, choose Customer so that a strongly typed view will be created based on the Customer class. Choose Details from the View content list and click the Add button to generate the Index view.</p>
<p>A file named Details.aspx will be created in the Customers folder. The generated html looks like this:</p>
<p>&lt;h2&gt;Details&lt;/h2&gt;</p>
<p>&lt;fieldset&gt;   <br />&#160;&#160;&#160; &lt;legend&gt;Fields&lt;/legend&gt;    <br />&#160;&#160;&#160; <br />&#160;&#160;&#160; &lt;div class=&quot;display-label&quot;&gt;Id&lt;/div&gt;    <br />&#160;&#160;&#160; &lt;div class=&quot;display-field&quot;&gt;&lt;%: Model.Id %&gt;&lt;/div&gt;    <br />&#160;&#160;&#160; <br />&#160;&#160;&#160; &lt;div class=&quot;display-label&quot;&gt;FullName&lt;/div&gt;    <br />&#160;&#160;&#160; &lt;div class=&quot;display-field&quot;&gt;&lt;%: Model.FullName %&gt;&lt;/div&gt;    <br />&#160;&#160;&#160; <br />&#160;&#160;&#160; <br />&lt;/fieldset&gt;</p>
<p>&lt;p&gt;   <br />&#160;&#160;&#160; &lt;%: Html.ActionLink(&quot;Back to List&quot;, &quot;Index&quot;) %&gt;    <br />&lt;/p&gt;    </p>
]]></content:encoded>
			<wfw:commentRss>http://associationthoughts.com/blog/archives/198/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQueryMobile Notes</title>
		<link>http://associationthoughts.com/blog/archives/194</link>
		<comments>http://associationthoughts.com/blog/archives/194#comments</comments>
		<pubDate>Tue, 08 Mar 2011 20:29:35 +0000</pubDate>
		<dc:creator>grantmcinnes</dc:creator>
				<category><![CDATA[.NET Programming]]></category>

		<guid isPermaLink="false">http://associationthoughts.com/blog/archives/194</guid>
		<description><![CDATA[&#160; Create a new MVC application Add the following to the site.master to include the jQuery Mobile css and js libraries: &#60;head id=&#34;Head1&#34; runat=&#34;server&#34;&#62; &#160;&#160;&#160; &#60;title&#62;&#60;asp:ContentPlaceHolder ID=&#34;TitleContent&#34; runat=&#34;server&#34; /&#62;&#60;/title&#62; &#160;&#160;&#160; &#60;link rel=&#34;stylesheet&#34; href=&#34;http://code.jquery.com/mobile/1.0a1/jquery.mobile-1.0a1.min.css&#34; /&#62; &#160;&#160;&#160; &#60;script type=&#34;text/javascript&#34; src=&#34;http://code.jquery.com/jquery-1.4.3.min.js&#34;&#62;&#60;/script&#62; &#160;&#160;&#160; &#60;script type=&#34;text/javascript&#34; src=&#34;http://code.jquery.com/mobile/1.0a1/jquery.mobile-1.0a1.min.js&#34;&#62;&#60;/script&#62; &#60;/head&#62; &#160; http://jquerymobile.com/demos/1.0a3/#docs/about/../../docs/lists/../../docs/content/../../docs/api/../pages/../api/../pages/../../ http://weblogs.asp.net/gunnarpeipman/archive/2010/10/27/building-mobile-web-site-with-asp-net-mvc-and-jquery-mobile.aspx http://www.htmlgoodies.com/tutorials/forms/article.php/3911771/The-Mobile-Web-with-jQuery-Mobile.htm]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>Create a new MVC application   <br />Add the following to the site.master to include the jQuery Mobile css and js libraries:</p>
<p>&lt;head id=&quot;Head1&quot; runat=&quot;server&quot;&gt;   <br />&#160;&#160;&#160; &lt;title&gt;&lt;asp:ContentPlaceHolder ID=&quot;TitleContent&quot; runat=&quot;server&quot; /&gt;&lt;/title&gt;    <br />&#160;&#160;&#160; &lt;link rel=&quot;stylesheet&quot; href=&quot;<a href="http://code.jquery.com/mobile/1.0a1/jquery.mobile-1.0a1.min.css&quot;">http://code.jquery.com/mobile/1.0a1/jquery.mobile-1.0a1.min.css&quot;</a> /&gt;    <br />&#160;&#160;&#160; &lt;script type=&quot;text/javascript&quot; src=&quot;<a href="http://code.jquery.com/jquery-1.4.3.min.js&quot;">http://code.jquery.com/jquery-1.4.3.min.js&quot;</a>&gt;&lt;/script&gt;    <br />&#160;&#160;&#160; &lt;script type=&quot;text/javascript&quot; src=&quot;<a href="http://code.jquery.com/mobile/1.0a1/jquery.mobile-1.0a1.min.js&quot;">http://code.jquery.com/mobile/1.0a1/jquery.mobile-1.0a1.min.js&quot;</a>&gt;&lt;/script&gt;    <br />&lt;/head&gt;</p>
<p>&#160;</p>
<p><a title="http://jquerymobile.com/demos/1.0a3/#docs/about/../../docs/lists/../../docs/content/../../docs/api/../pages/../api/../pages/../../" href="http://jquerymobile.com/demos/1.0a3/#docs/about/../../docs/lists/../../docs/content/../../docs/api/../pages/../api/../pages/../../">http://jquerymobile.com/demos/1.0a3/#docs/about/../../docs/lists/../../docs/content/../../docs/api/../pages/../api/../pages/../../</a></p>
<p><a title="http://weblogs.asp.net/gunnarpeipman/archive/2010/10/27/building-mobile-web-site-with-asp-net-mvc-and-jquery-mobile.aspx" href="http://weblogs.asp.net/gunnarpeipman/archive/2010/10/27/building-mobile-web-site-with-asp-net-mvc-and-jquery-mobile.aspx">http://weblogs.asp.net/gunnarpeipman/archive/2010/10/27/building-mobile-web-site-with-asp-net-mvc-and-jquery-mobile.aspx</a></p>
<p><a title="http://www.htmlgoodies.com/tutorials/forms/article.php/3911771/The-Mobile-Web-with-jQuery-Mobile.htm" href="http://www.htmlgoodies.com/tutorials/forms/article.php/3911771/The-Mobile-Web-with-jQuery-Mobile.htm">http://www.htmlgoodies.com/tutorials/forms/article.php/3911771/The-Mobile-Web-with-jQuery-Mobile.htm</a></p>
]]></content:encoded>
			<wfw:commentRss>http://associationthoughts.com/blog/archives/194/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Camp Notes</title>
		<link>http://associationthoughts.com/blog/archives/185</link>
		<comments>http://associationthoughts.com/blog/archives/185#comments</comments>
		<pubDate>Mon, 07 Mar 2011 16:26:34 +0000</pubDate>
		<dc:creator>grantmcinnes</dc:creator>
				<category><![CDATA[.NET Programming]]></category>

		<guid isPermaLink="false">http://associationthoughts.com/blog/archives/185</guid>
		<description><![CDATA[&#160; Takeaways: Look at Web Platform Installer MVC: There&#8217;s an MVC handler in the System.Web.Mvc.dll There will be an IIS express. Convention over configuration In the Controller, created a new function Poo with ActionResult. Run it and type /Home/Poo No View. Right click, in solution, in function, Add View Now run again Model: Controller &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p><strong>Takeaways:      <br /></strong>Look at Web Platform Installer</p>
<p> <strong>MVC:    <br /></strong>
<p>There&#8217;s an MVC handler in the System.Web.Mvc.dll    <br />There will be an IIS express.     <br />Convention over configuration</p>
<p>In the Controller, created a new function Poo with ActionResult.    <br />Run it and type /Home/Poo     <br />No View.     <br />Right click, in solution, in function, Add View     <br />Now run again</p>
<p>Model:    <br />Controller &#8211; retrieves Model, does stuff     <br />View &#8211; visual represent the model</p>
<p>Razor:    <br />Just out an @ sign in front of your code, and variables (making the parser starter)</p>
<p>Dynamic expressions in C# 4    <br />(Dynamic view data dictionary &#8211; the operation will be resolved at runtime)     <br />ViewBag.Whatever = PeopleList     <br />The compiler is the first unit test, just a spell checker.</p>
<p>Scaffolding, Nuget, </p>
<p>Nuget – Add Elmah</p>
<p>&#160;</p>
<p>Dependency Injection (DI)</p>
<p>Create class</p>
<p>Create interface from Class</p>
<p>Every time you NEW up something, think about DI.</p>
<p>From the Package Manager Console, PM&gt; Install-Package Ninject.MVC3</p>
<p>&#160;</p>
<p>Look at MVCScaffolding</p>
]]></content:encoded>
			<wfw:commentRss>http://associationthoughts.com/blog/archives/185/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Camps</title>
		<link>http://associationthoughts.com/blog/archives/177</link>
		<comments>http://associationthoughts.com/blog/archives/177#comments</comments>
		<pubDate>Mon, 07 Mar 2011 15:32:20 +0000</pubDate>
		<dc:creator>grantmcinnes</dc:creator>
				<category><![CDATA[.NET Programming]]></category>

		<guid isPermaLink="false">http://associationthoughts.com/blog/?p=177</guid>
		<description><![CDATA[Takeaways: Look at Web Platform Installer MVC: There&#8217;s an MVC handler in the System.Web.Mvc.dll There will be an IIS express. Convention over configuration In the Controller, created a new function Poo with ActionResult. Run it and type /Home/Poo No View. Right click, in solution, in function, Add View Now run again Model: Controller &#8211; retrieves [...]]]></description>
			<content:encoded><![CDATA[<p>Takeaways:<br />
Look at Web Platform Installer</p>
<p>MVC:<br />
There&#8217;s an MVC handler in the System.Web.Mvc.dll<br />
There will be an IIS express.<br />
Convention over configuration</p>
<p>In the Controller, created a new function Poo with ActionResult.<br />
Run it and type /Home/Poo<br />
No View.<br />
Right click, in solution, in function, Add View<br />
Now run again</p>
<p>Model:<br />
Controller &#8211; retrieves Model, does stuff<br />
View &#8211; visual represent the model</p>
<p>Razor:<br />
Just out an @ sign in front of your code, and variables (making the parser starter)</p>
<p>Dynamic expressions in C# 4<br />
(Dynamic view data dictionary &#8211; the operation will be resolved at runtime)<br />
ViewBag.Whatever = PeopleList<br />
The compiler is the first unit test, just a spell checker.</p>
]]></content:encoded>
			<wfw:commentRss>http://associationthoughts.com/blog/archives/177/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What’s new in MVVM Light V3</title>
		<link>http://associationthoughts.com/blog/archives/174</link>
		<comments>http://associationthoughts.com/blog/archives/174#comments</comments>
		<pubDate>Wed, 16 Feb 2011 19:53:39 +0000</pubDate>
		<dc:creator>grantmcinnes</dc:creator>
				<category><![CDATA[.NET Programming]]></category>

		<guid isPermaLink="false">http://associationthoughts.com/blog/archives/174</guid>
		<description><![CDATA[What’s new in MVVM Light V3 Sending messages with callback Certain classes have been added to the GalaSoft.MvvmLight.Messaging namespace, allowing sending a message and getting a callback from the recipient. These classes are: * NotificationMessageWithCallback: Base class for messages with callback. * NotificationMessageAction: A class with string notification, and a parameterless callback. * NotificationMessageAction: A [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.galasoft.ch/archive/2010/03/16/whatrsquos-new-in-mvvm-light-v3.aspx">What’s new in MVVM Light V3</a><br />
<blockquote>Sending messages with callback</p>
<p>Certain classes have been added to the GalaSoft.MvvmLight.Messaging namespace, allowing sending a message and getting a callback from the recipient. These classes are:</p>
<p>    * NotificationMessageWithCallback: Base class for messages with callback.<br />    * NotificationMessageAction: A class with string notification, and a parameterless callback.<br />    * NotificationMessageAction<t>: A class with string notification, and a callback with a parameter of type T.</p>
<p>To send a message with callback, use the following code:<br />view source<br />print?<br />01.var message = new NotificationMessageAction<bool>(<br />02.    &#8220;Hello world&#8221;,<br />03.    callbackMessage =&gt;<br />04.    {<br />05.        // This is the callback code<br />06.        if (callbackMessage)<br />07.        {<br />08.            // &#8230;<br />09.        }<br />10.    });<br />11. <br />12.Messenger.Default.Send(message);</p>
<p>To register and receive a message with callback, use the following code:<br />view source<br />print?<br />01.Messenger.Default.Register<notificationmessageaction><bool>&gt;(<br />02.    this,<br />03.    message =&gt;<br />04.    {<br />05.        // Do something<br />06.         <br />07.        // Execute the callback<br />08.        message.Execute(true);<br />09.    });<br />Messenger.Default can be overriden</p>
<p>The Messenger.Default property can also be replaced, for example for unit testing purposes, by using the Messenger.OverrideDefault method. All the public methods of the Messenger class have been made virtual, and can be overridden in the test messenger class.<br />Sending messages to interfaces</p>
<p>In V2, it was possible to deliver messages targeted to instances of a given class. in V3 it is still possible, but in addition you can deliver a message to instances that implement a certain interface. The message will not be delivered to other recipients.</p>
<p>Use the overload Messenger.Default.Send<tmessage , ttarget="">(TMessage message) where TTarget is, in fact, an interface (for example IDisposable). Of course the recipient must register to receive the type of message TMessage.<br />Sending messages with a token</p>
<p>Messages can now be sent through the Messenger with a token.</p>
<p>    * To send a message with token, use the method overload Send</tmessage><tmessage>(TMessage message, object token).<br />    * To receive a message with token, use the methods Register</tmessage><tmessage>(object recipient, object token, Action</tmessage><tmessage> action) or Register</tmessage><tmessage>(object recipient, object token, bool receiveDerivedMessagesToo, Action</tmessage><tmessage> action)</p>
<p>The token can be a simple value (int, string, etc…) or an instance of a class. The message is not delivered to recipients who registered with a different token, or with no token at all.</p>
<p>http://blog.galasoft.ch/archive/2010/03/16/whatrsquos-new-in-mvvm-light-v3.aspx</p>
<p></tmessage></bool></notificationmessageaction></bool></t></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://associationthoughts.com/blog/archives/174/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting CC.Net working on our Test/Dev/Staging box</title>
		<link>http://associationthoughts.com/blog/archives/122</link>
		<comments>http://associationthoughts.com/blog/archives/122#comments</comments>
		<pubDate>Tue, 13 Apr 2010 16:08:55 +0000</pubDate>
		<dc:creator>grantmcinnes</dc:creator>
				<category><![CDATA[.NET Programming]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://associationthoughts.com/blog/?p=122</guid>
		<description><![CDATA[I used Jeff Atwoods article on Setting up Subversion on Windows to get started. Once Subversion was up and running, I installed TortoiseSVN to create a repository, VisualSVN to connect to a repository and begun the CI installation. Install Cruise Control on the Server and install as service Configure the ccnet.config with a Project proj1 [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-family: tahoma;"><small>I used Jeff Atwoods <a href="http://www.codinghorror.com/blog/2008/04/setting-up-subversion-on-windows.html" target="_blank">article </a>on Setting up Subversion on Windows to get started. </small></span></p>
<p><span style="font-family: tahoma;"><small>Once Subversion was up and running, I installed TortoiseSVN to create a repository, VisualSVN to connect to a repository and begun the CI installation.</small></span></p>
<p><span style="font-family: tahoma;"><small>Install</small><small> Cruise Control on the Server and install as service<br />
Configure the ccnet.config with a Project proj1<br />
Create a working directory<br />
In the working directory\bin directory, install nant, nantcontrib, visualsvn<br />
Create a project directory in the working directory</small> <small>proj1<br />
In the proj1 directory, create a nant build script<br />
Start the Cruise Control service</small></span></p>
<p><span style="font-family: tahoma;"><small>Key is to get the config file correct. There&#8217;s lots of posts on getting CI working so this is just some brief notes.</small></span></p>
<p><span style="font-family: tahoma;"><small></small></span></p>
]]></content:encoded>
			<wfw:commentRss>http://associationthoughts.com/blog/archives/122/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>log4net example</title>
		<link>http://associationthoughts.com/blog/archives/92</link>
		<comments>http://associationthoughts.com/blog/archives/92#comments</comments>
		<pubDate>Thu, 25 Jun 2009 21:45:46 +0000</pubDate>
		<dc:creator>grantmcinnes</dc:creator>
				<category><![CDATA[.NET Programming]]></category>

		<guid isPermaLink="false">http://associationthoughts.com/blog/archives/92</guid>
		<description><![CDATA[&#160; In a recent project, I needed to implement logging and decided to use the log4net.dll which I have seen referenced in a number of different open source projects. Here are the steps I had to taken in order to use log4net in my project: &#160; 1. Download the log4net.dll from http://sourceforge.net/projects/log4net/ 2. Add a [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>In a recent project, I needed to implement logging and decided to use the log4net.dll which I have seen referenced in a number of different open source projects. Here are the steps I had to taken in order to use log4net in my project:</p>
<p>&#160;</p>
<p>1. Download the log4net.dll from <a href="http://sourceforge.net/projects/log4net/">http://sourceforge.net/projects/log4net/</a></p>
<p>2. Add a reference to your project that includes the downloaded log4net.dll </p>
<p>3. Add a log4net section to your web.config/app.config file:</p>
<p>&lt;configuration&gt;   <br />&#160;&#160;&#160; &lt;configSections&gt;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;section name=&quot;log4net&quot; type=&quot;System.Configuration.IgnoreSectionHandler&quot; /&gt;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/sectionGroup&gt;    <br />&#160;&#160;&#160; &lt;/configSections&gt;    <br />&lt;/configuration&gt;    </p>
<p>4. Add a log4net.config file to your project with the following configuration:</p>
<p>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;   <br />&lt;log4net debug=&quot;true&quot;&gt;    <br />&#160; &lt;appender name=&quot;LogFileAppender&quot; type=&quot;log4net.Appender.FileAppender&quot;&gt;    <br />&#160;&#160;&#160; &lt;param name=&quot;File&quot; value=&quot;log4netoutput.log&quot; /&gt;    <br />&#160;&#160;&#160; &lt;param name=&quot;AppendToFile&quot; value=&quot;true&quot; /&gt;    <br />&#160;&#160;&#160; &lt;layout type=&quot;log4net.Layout.PatternLayout&quot;&gt;    <br />&#160;&#160;&#160;&#160;&#160; &lt;param name=&quot;ConversionPattern&quot; value=&quot;%d [%t] %-5p [%c] %m%n&quot; /&gt;    <br />&#160;&#160;&#160; &lt;/layout&gt;    <br />&#160; &lt;/appender&gt;    <br />&#160; &lt;root&gt;    <br />&#160;&#160;&#160; &lt;level value=&quot;DEBUG&quot; /&gt;    <br />&#160;&#160;&#160; &lt;appender-ref ref=&quot;LogFileAppender&quot; /&gt;    <br />&#160; &lt;/root&gt;    <br />&lt;/log4net&gt;</p>
<p>There are various Appenders you can create but this example uses a text file to log the results into the bin directory of the application. There are also different values that can be used as part of the ConversionPattern to get different output.</p>
<p>5. Be sure to change the properties of the log4net.config file in your project for the Copy to Output Directory attribute to <strong>Copy Always.</strong> I spent hours debugging my code because the config file was not being copied into the bin directory and log4net did not throw any exceptions. Since I had not used log4net before, I was making the assumption the problem was with my code and/or config file settings.</p>
<p>6. Here’s my code from a test method to make sure log4net is working correctly:</p>
<p>[Test]   <br />public void TestLog4NetOnItsOwn()    <br />{    <br />&#160;&#160;&#160; ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);    <br />&#160;&#160;&#160; XmlConfigurator.Configure(new FileInfo(Settings.Default.log4net_config_file));&#160; <br />&#160;&#160;&#160; logger.Debug(&quot;Here is a debug log.&quot;);    <br />}</p>
</p>
<p>To log results to the console, include the following line of code:</p>
<p>BasicConfigurator.Configure();</p>
<p>&#160;</p>
<p>I’ve seen other posts that reference the log4net.config file in the Assembly.cs file rather than in code:</p>
<p>[assembly: log4net.Config.XmlConfigurator(ConfigFile=&quot;log4net.config&quot;, Watch = true)]</p>
<p>&#160;</p>
<p>Other Posts and Resources:</p>
<p><a href="http://it.toolbox.com/blogs/daniel-at-work/using-log4net-in-cnet-26794">http://it.toolbox.com/blogs/daniel-at-work/using-log4net-in-cnet-26794</a></p>
<p><a href="http://geekswithblogs.net/bsherwin/archive/2008/02/15/119657.aspx">http://geekswithblogs.net/bsherwin/archive/2008/02/15/119657.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://associationthoughts.com/blog/archives/92/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Open an MVC project in Visual Studio 2010</title>
		<link>http://associationthoughts.com/blog/archives/91</link>
		<comments>http://associationthoughts.com/blog/archives/91#comments</comments>
		<pubDate>Tue, 09 Jun 2009 18:25:11 +0000</pubDate>
		<dc:creator>grantmcinnes</dc:creator>
				<category><![CDATA[.NET Programming]]></category>

		<guid isPermaLink="false">http://associationthoughts.com/blog/archives/91</guid>
		<description><![CDATA[&#160; http://weblogs.asp.net/leftslipper/archive/2009/01/20/opening-an-asp-net-mvc-project-without-having-asp-net-mvc-installed-the-project-type-is-not-supported-by-this-installation.aspx]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p><a href="http://weblogs.asp.net/leftslipper/archive/2009/01/20/opening-an-asp-net-mvc-project-without-having-asp-net-mvc-installed-the-project-type-is-not-supported-by-this-installation.aspx">http://weblogs.asp.net/leftslipper/archive/2009/01/20/opening-an-asp-net-mvc-project-without-having-asp-net-mvc-installed-the-project-type-is-not-supported-by-this-installation.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://associationthoughts.com/blog/archives/91/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Regular Expressions Cheat Sheet (V2)</title>
		<link>http://associationthoughts.com/blog/archives/87</link>
		<comments>http://associationthoughts.com/blog/archives/87#comments</comments>
		<pubDate>Wed, 20 May 2009 22:55:48 +0000</pubDate>
		<dc:creator>grantmcinnes</dc:creator>
				<category><![CDATA[.NET Programming]]></category>

		<guid isPermaLink="false">http://associationthoughts.com/blog/archives/87</guid>
		<description><![CDATA[&#160; Pingback to http://www.addedbytes.com/cheat-sheets/regular-expressions-cheat-sheet/]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>Pingback to <a title="http://www.addedbytes.com/cheat-sheets/regular-expressions-cheat-sheet/" href="http://www.addedbytes.com/cheat-sheets/regular-expressions-cheat-sheet/">http://www.addedbytes.com/cheat-sheets/regular-expressions-cheat-sheet/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://associationthoughts.com/blog/archives/87/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

