<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Matt Dotson's Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/mattdotson/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/mattdotson/feed.xml</link>
    <description>The posts on this weblog are provided &amp;quot;AS IS&amp;quot; with no warranties, and confer no rights. The opinions expressed herein are my own personal opinions and do not represent my employer&amp;#039;s view in any way.</description>
    <lastBuildDate>Tue, 16 Apr 2019 05:17:24 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Windows Azure Developer Community Event in Santa Monica</title>
      <link>https://docs.microsoft.com/archive/blogs/mattdotson/windows-azure-developer-community-event-in-santa-monica</link>
      <pubDate>Mon, 29 Aug 2011 14:39:57 GMT</pubDate>
      <dc:creator><![CDATA[Matt Dotson]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mattdotson/2011/08/29/windows-azure-developer-community-event-in-santa-monica/</guid>
      <description><![CDATA[We're starting a new local community for Windows Azure Developers in Los Angeles!&nbsp; If you're an...]]></description>
      <content:encoded><![CDATA[<p>We're starting a new local community for Windows Azure Developers in Los Angeles!&nbsp; If you're an active Windows Azure developer or just someone that's interested in learning more about Windows Azure, join our new group.&nbsp; We're hosting our first <a href="https://www.meetup.com/windowsazure/events/29506461/">Azure Devs meetup in Santa Monica on Sept 1st</a>.&nbsp; If you're interested in attending, register at <a href="https://meetup.com/windowsazure">https://meetup.com/windowsazure</a>.&nbsp; Even if you can't attend this particular event, join the group, so we can tell you about upcoming events.&nbsp; If you want to learn more about the group, we're starting a community blog at <a href="https://www.azuredevs.org/">https://www.azuredevs.org/</a> .&nbsp; For&nbsp;events with a presenter, we'll try to post video of their presentation.&nbsp;Thanks, and we look forward to seeing everyone.</p>]]></content:encoded>
    </item>
    <item>
      <title>Making “Microsoft.VSTS.CMMI.Estimate” Field Reportable in TFS</title>
      <link>https://docs.microsoft.com/archive/blogs/mattdotson/making-microsoft-vsts-cmmi-estimate-field-reportable-in-tfs</link>
      <pubDate>Thu, 25 Feb 2010 18:29:00 GMT</pubDate>
      <dc:creator><![CDATA[Matt Dotson]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mattdotson/2010/02/25/making-microsoft-vsts-cmmi-estimate-field-reportable-in-tfs/</guid>
      <description><![CDATA[If you'd like to make a report in TFS that compares the&nbsp;estimated time to complete a&nbsp;task...]]></description>
      <content:encoded><![CDATA[<P>If you'd like to make a report in TFS that compares the&nbsp;estimated time to complete a&nbsp;task with the actual time, you've probably come across the problem of Microsoft.VSTS.CMMI.Estimate not being reportable.&nbsp; This is a real pain and very surprising that this wasn't done correctly in the first place considering that&nbsp;Work Remaining and Work Completed are both in the right place. Today I ...</P>
<P>Read the rest at <A href="https://mattdotson.com/making-microsoft-vsts-cmmi-estimate-field-reportable-in-tfs/">https://mattdotson.com/making-microsoft-vsts-cmmi-estimate-field-reportable-in-tfs/</A></P>]]></content:encoded>
    </item>
    <item>
      <title>Good WPF Book</title>
      <link>https://docs.microsoft.com/archive/blogs/mattdotson/good-wpf-book</link>
      <pubDate>Wed, 13 May 2009 02:42:00 GMT</pubDate>
      <dc:creator><![CDATA[Matt Dotson]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mattdotson/2009/05/13/good-wpf-book/</guid>
      <description><![CDATA[I get lots of questions about books I recommend for learning WPF. &nbsp;Adam Nathan's Windows...]]></description>
      <content:encoded><![CDATA[<SPAN class=Apple-style-span style="WORD-SPACING: 0px; FONT: 16px 'Times New Roman'; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0">
<DIV style="PADDING-RIGHT: 8px; PADDING-LEFT: 8px; FONT-SIZE: 10pt; PADDING-BOTTOM: 8px; PADDING-TOP: 8px; FONT-FAMILY: Arial, Helvetica, sans-serif; BACKGROUND-COLOR: rgb(255,255,255)">I get lots of questions about books I recommend for learning WPF. &nbsp;<A href="https://www.amazon.com/gp/product/0672328917?ie=UTF8&amp;tag=msdnblog-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0672328917" mce_href="https://www.amazon.com/gp/product/0672328917?ie=UTF8&amp;tag=msdnblog-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0672328917">Adam Nathan's Windows Presentation Foundation Unleashed (WPF)</A><IMG style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; MARGIN: 0px; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none" height=1 alt="" src="https://www.assoc-amazon.com/e/ir?t=msdnblog-20&amp;l=as2&amp;o=1&amp;a=0672328917" width=1 border=0 mce_src="https://www.assoc-amazon.com/e/ir?t=msdnblog-20&amp;l=as2&amp;o=1&amp;a=0672328917"> has been around for a while, but I still think it's the best WPF book available.&nbsp; I have my copy on my <A href="https://www.amazon.com/gp/product/B00154JDAI?ie=UTF8&amp;tag=msdnblog-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B00154JDAI" mce_href="https://www.amazon.com/gp/product/B00154JDAI?ie=UTF8&amp;tag=msdnblog-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B00154JDAI">Kindle</A><IMG style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; MARGIN: 0px; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none" height=1 alt="" src="https://www.assoc-amazon.com/e/ir?t=msdnblog-20&amp;l=as2&amp;o=1&amp;a=B00154JDAI" width=1 border=0 mce_src="https://www.assoc-amazon.com/e/ir?t=msdnblog-20&amp;l=as2&amp;o=1&amp;a=B00154JDAI"> </DIV></SPAN>]]></content:encoded>
    </item>
    <item>
      <title>Managing Cultures in a Global Application</title>
      <link>https://docs.microsoft.com/archive/blogs/mattdotson/managing-cultures-in-a-global-application</link>
      <pubDate>Mon, 30 Mar 2009 19:34:00 GMT</pubDate>
      <dc:creator><![CDATA[Matt Dotson]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mattdotson/2009/03/30/managing-cultures-in-a-global-application/</guid>
      <description><![CDATA[I have been doing a lot of work on globalized applications lately and I have learned a lot. I...]]></description>
      <content:encoded><![CDATA[<span class="Apple-style-span" style="font-family: 'Times New Roman'; font-size: 16px; "><div style="background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: rgb(255, 255, 255); font: normal normal normal 13px/19px Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; padding-top: 0.6em; padding-right: 0.6em; padding-bottom: 0.6em; padding-left: 0.6em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-position: initial initial; "><p>I have been doing a lot of work on globalized applications lately and I have learned a lot. I thought I'd try to share some of what I've learned with everyone. One of the first issues we ran into was managing formatting of data for different scenarios. Educating developers on which culture to use when is challenging and you end up not having a unified formatting. Also, if this formatting ever changes, you would need to then go find all the places which need to be changed. &nbsp;This could be daunting because you don't know the original intent of the developer. &nbsp;Did the original developer choose "en-US" because she wanted to format it for a developer, or because that was the culture of the database? &nbsp;It's hard to tell, so we want to avoid getting ourselves into this situation.</p><p>We'll start with a simple pattern and word towards a more advanced one. &nbsp;They all should work, you just end up with some tradeoffs between simplicity and maintainability. In the simple example, we create a class with properties which map to an intent.</p><p>public static class Cultures<br>{<br>public static CultureInfo UserFormatCulture { get { return Thread.CurrentThread.CurrentCulture; } }<br>public static CultureInfo UserLanguageCulture { get { return Thread.CurrentThread.CurrentUICulture; } }<br>public static CultureInfo DatabaseCulture { get { return CultureInfo.InvariantCulture; }}<br>public static CultureInfo DirectoryCulture { get { return CultureInfo.GetCulture("en-US"); }}<br>public static CultureInfo DeveloperCulture { get { return CultureInfo.GetCulture("en-US"); }}<br>}</p><p>The UserFormatCulture is the culture used to format numbers, dates, etcetera for display to the user, or to parse information entered by the user. The UserLanguageCulture is used to look up resources in resource files. These two properties simply map to the built-in properties on the current thread used for the same purpose. The DatabaseCulture and DirectoryCulture provide the culture used to read and store data in external systems. This may be en-US or InvariantCulture depending on the system you are using. This was one of the biggest areas our developers made mistakes before we started using this pattern. We had data stored in many cultures and when we read data out of the directory server we'd get parse errors when dates weren't stored in dd/mm/yyyy format of the user's culture. Using this pattern makes it easy for even junior developers to use the right culture, and if you ever need to change, you have a centralized place to make the change.</p><p>A more robust implementation could store this information into a config file rather than hard code it in each property. While this still leaves the properties themselves hardcoded, it's a little more flexible because the values can be changed. &nbsp;Still, you might have to make a change to a core component if you decide that you need&nbsp;</p><p>The next step would be to get rid of the class all together and use something more akin to a service locator.&nbsp;</p><p>var devCulture = ServiceLocator.Resolve&lt;CultureInfo&gt;("DeveloperCulture");&nbsp;</p><p>A Culture is kind of a service, right? &nbsp;It provides services for formatting, so I think we're in the clear calling it a service. &nbsp;It would be nice if it implemented some interface that we could use, but it works. &nbsp;The service locator model gives us a little more flexibility and allows us to add new intents without changing our core framework. &nbsp;We can also build some rules into the service locator about fallback cultures, if a requested intent is not configured.</p><p>I tend to lean towards Unity as my container, factory, service locator of choice, but you could use whatever you wanted. &nbsp;In Unity, I could register some well known types like the DeveloperCulture at startup, but we'd need a static factory extension to support getting the UserFormatCulture and UserLanguageCulture. That's because we want to get what the CultureInfo.CurrentUICulture is right now, not what it was during application startup.</p><p>Right now I've only implemented the simple solution in the toolkit, but I'll be moving towards the more dynamic solution when I get more time.</p></div></span>]]></content:encoded>
    </item>
    <item>
      <title>Global Toolkit is now in CodePlex</title>
      <link>https://docs.microsoft.com/archive/blogs/mattdotson/global-toolkit-is-now-in-codeplex</link>
      <pubDate>Mon, 30 Mar 2009 19:27:00 GMT</pubDate>
      <dc:creator><![CDATA[Matt Dotson]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mattdotson/2009/03/30/global-toolkit-is-now-in-codeplex/</guid>
      <description><![CDATA[I've been doing a lot of globalization work lately, so to capture some of my best practices around...]]></description>
      <content:encoded><![CDATA[<span class="Apple-style-span" style="font-family: 'Times New Roman'; font-size: 16px; "><div style="background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: rgb(255, 255, 255); font: normal normal normal 13px/19px Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; padding-top: 0.6em; padding-right: 0.6em; padding-bottom: 0.6em; padding-left: 0.6em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-position: initial initial; "><p>I've been doing a lot of globalization work lately, so to capture some of my best practices around globalization, I've created a CodePlex project. Matt Dotson's Global Toolkit (<a mce_href="https://www.codeplex.com/GlobalToolkit" href="https://www.codeplex.com/GlobalToolkit">https://www.codeplex.com/GlobalToolkit</a>) is where I'll be posting code which can be reused in your global applications.</p><p>&nbsp;I've started to implement some stuff, but it is far from done, so take a look and tell me what you think. &nbsp;I've focused on a currency class so far that supports currency conversion, and currency enumeration. &nbsp;I've tried to make the toolkit extensible so that you can plug it into your own architecture.&nbsp;</p></div></span>]]></content:encoded>
    </item>
    <item>
      <title>Presentation Model Pattern in WPF (Part 2)</title>
      <link>https://docs.microsoft.com/archive/blogs/mattdotson/presentation-model-pattern-in-wpf-part-2</link>
      <pubDate>Thu, 10 Jul 2008 02:32:00 GMT</pubDate>
      <dc:creator><![CDATA[Matt Dotson]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mattdotson/2008/07/10/presentation-model-pattern-in-wpf-part-2/</guid>
      <description><![CDATA[In part one we looked at the concept of a presentation model. In this post we are going to going to...]]></description>
      <content:encoded><![CDATA[<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT size=3><FONT face=Calibri>In part one we looked at the concept of a presentation model. In this post we are going to going to start putting together some crude code to scaffold out our presentation model base classes.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>This article should give you the basic idea how things are related, and what purpose they serve.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>There are really 3 core classes I use to provide the foundation for my implementation of a Presentation Model Pattern: (1) PresentationModel, (2) ObservableModelCollection, and (3) ObservableModel. <SPAN style="mso-spacerun: yes">&nbsp;</SPAN>If you think about the data on your screen, you are probably going to have a root data object (your presentation model), but you are also going to have to represent items in a data grid, charting data, etc.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>All these items require that you have a collection (actually an ObservableModelCollection) of “sub-models” (ObservableModel).<SPAN style="mso-spacerun: yes">&nbsp; </SPAN></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT size=3><FONT face=Calibri>We’ll tackle ObservableModel first since it’s the root of our implementation.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>ObservableModel provides a base class which actual models can inherit to automatically get notification of changes to the data in the model.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>ObservableModel does this by supporting the INotifyPropertyChanged interface which WPF knows to listen to for the PropertyChanged event.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT size=3><FONT face=Calibri>This is the same interface that DependencyObject implements, so some might ask “Why don’t we build ObservableModel on DependencyObject?”<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Well, it turns out I thought about this.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>My first attempt at a PM implementation was based off of DependencyObject (DO from now on), but I quickly found out that some of the more advanced services I wanted to offer were difficult to implement because DO abstracted so much away from me.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>One of the best examples of this was Undo/Redo.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>To implement this, I really wanted to control how property values were stored, but DO hides this from inheritors. I didn’t want to completely hijack DO, so I eventually resolved to create my own set of classes.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>Implementing INotifyPropertyChanged requires that we raise an event whenever a property changes on an object inherited from OM, but how do we know when a property changes?<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>We don’t really want our inheritors having to raise the event explicitly in every property setter, so we’ll do the same thing DO does, we’ll implement GetValue and SetValue methods.</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>That’s about all we need right now. While there are a lot of interfaces we will eventually add to our ObservableModel class, we’ll just implement INotifyPropertyChanged for now.</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT size=3><FONT face=Calibri>Now that we have the basics down, let’s create PresentationModel.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Our PresentationModel class needs the same features as ObservableModel, fortunately we thought about this ahead of time, and we are just going to inherit PresentationModel from ObservableModel.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>We need to add a few more things to PresentationModel though.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>First off, we want to be able to initialize our PM with data.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>We could do that in the constructor, but there is a better option: ISupportsInitialize.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>While there are two methods to control initialization on this interface, we are going to abstract those from our inheritors, and create an abstract method called Initialize().<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>This is where our inheritors are going to begin getting data for their screen.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>We also need one more thing: CommandBindings.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>In order for our PM to accept commands from the View, we need to have some way for the View to figure out which commands we support and send us those commands.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>To do this, we’ll create a CommandBindings property which will be filled up by our inheritors.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>The View will add this to the Page’s CommandBindings property so commands are automatically forwarded to us from WPF.</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>Now we have the basics setup.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>For good measure we are also going to create ObservableModelCollection.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Why can’t we just use ObservableCollection?<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Well for one, there are a bunch of UI Controls (Infragistics in particular) which don’t do a good job of listening to events on sub-models, so we want our ObservableModelCollection to listen to those events and forward some of them up.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Secondly, we are going to need this when we eventually implement Undo/Redo.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>ObservableCollection is a good start though, so we’ll use this as our base class and add the event forwarding.</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>That’s all for now, in part 3 we’ll create a model/view pair which uses these base classes.</FONT></P>]]></content:encoded>
    </item>
    <item>
      <title>My Toolbox</title>
      <link>https://docs.microsoft.com/archive/blogs/mattdotson/my-toolbox</link>
      <pubDate>Sat, 28 Jun 2008 02:59:00 GMT</pubDate>
      <dc:creator><![CDATA[Matt Dotson]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mattdotson/2008/06/28/my-toolbox/</guid>
      <description><![CDATA[One thing I always find myself doing is showing people the little indisposable tools in my...]]></description>
      <content:encoded><![CDATA[<P>One thing I always find myself doing is showing people the little indisposable tools in my toolbox.&nbsp; Here's a list of some I couldn't live without.</P>
<OL>
<LI>Reflector (<A href="https://www.aisto.com/roeder/dotnet/">https://www.aisto.com/roeder/dotnet/</A>) - If you only get one tool, this is the one to choose.&nbsp; Decompile any .NET code.&nbsp; I can't even count the number of times I've been able to figure out why I'm getting some random exception back from a system function with this tool.&nbsp; It also faster to use than the .NET documentation, so I use it to lookup API's.&nbsp; Do I need to call Dispose and then Close, or does Dispose call Close, now I know.<BR><IMG style="WIDTH: 160px; HEIGHT: 160px" height=160 src="https://www.aisto.com/roeder/dotnet/Reflector.png" width=160 mce_src="https://www.aisto.com/roeder/dotnet/Reflector.png"><BR></LI>
<LI>Rhino mocks (<A href="https://ayende.com/projects/rhino-mocks.aspx">https://ayende.com/projects/rhino-mocks.aspx</A>) - I can't imagine unit testing without rhino.<BR><IMG style="WIDTH: 120px; HEIGHT: 90px" height=90 src="https://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/NewRhinoMocksLogo_ECFE/rhinomocks-120x90.png" width=120 mce_src="https://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/NewRhinoMocksLogo_ECFE/rhinomocks-120x90.png"><BR></LI>
<LI>Snoop (<A href="https://www.blois.us/Snoop/">https://www.blois.us/Snoop/</A>) - Do you develop WPF apps. This visual tree&nbsp;tool will help you figure out how to restyle almost anything.</LI>
<LI>Wireshark (<A href="https://www.wireshark.org/">https://www.wireshark.org/</A>) - Nothing beats this network sniffer</LI>
<LI>TFS Sidekick (<A href="https://attrice.info/cm/tfs/">https://attrice.info/cm/tfs/</A>) - All those things you wish TFS did, sidekick does.</LI>
<LI>Stylus Studio (<A href="https://www.stylusstudio.com/">https://www.stylusstudio.com/</A>) - hands down the best XML tool on the planet.</LI>
<LI>The Regulator (<A href="https://tools.osherove.com/CoolTools/Regulator/tabid/185/Default.aspx">https://tools.osherove.com/CoolTools/Regulator/tabid/185/Default.aspx</A>) I love regular expressions, but they can a nightmare to debug.&nbsp; This tool makes it regex trial and error fast and easy.</LI>
<LI>Ghost Doc (<A href="https://www.roland-weigelt.de/ghostdoc/">https://www.roland-weigelt.de/ghostdoc/</A>) - I like writing code, I don't like writing comments. I like ghost doc.</LI>
<LI>Sandcastle (<A href="https://blogs.msdn.com/sandcastle/">https://blogs.msdn.com/sandcastle/</A>) - Again, I like writing code, I don't like writing docs.&nbsp; Make professional looking documentation from your code.</LI>
<LI>Process Monitor (<A href="https://technet.microsoft.com/en-us/sysinternals/bb896645.aspx">https://technet.microsoft.com/en-us/sysinternals/bb896645.aspx</A>) What the heck is locking that file? ProcMon knows.</LI></OL>
<P>Of course it goes without saying that Visual Studio is the tool that I use most.&nbsp; But there are a bunch of things in Visual Studio that take beginners some time to figure out. If you don't know what these are, go figure them out now!!</P>
<OL>
<LI>The immediate window - I wish it was more robust, but what it is now is pretty powerful.</LI>
<LI>Auto format/ auto indent</LI>
<LI>Refactoring</LI>
<LI>Code snippets</LI>
<LI>Automatic "using" statements</LI>
<LI>Conditional breakpoints</LI>
<LI>Profiler</LI>
<LI>Code analysis</LI>
<LI>Move to last position (CTRL -)</LI>
<LI>Incremental Search</LI>
<LI>Find and Replace with Regex</LI>
<LI>Flagging threads in the thread window</LI></OL>
<P>These are just a few things I use to get my job done.&nbsp; If you don't know what any of these tools or VS features are, I encourage you to try them out.</P>]]></content:encoded>
    </item>
    <item>
      <title>Presentation Model Pattern in WPF</title>
      <link>https://docs.microsoft.com/archive/blogs/mattdotson/presentation-model-pattern-in-wpf</link>
      <pubDate>Sat, 21 Jun 2008 06:42:00 GMT</pubDate>
      <dc:creator><![CDATA[Matt Dotson]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mattdotson/2008/06/21/presentation-model-pattern-in-wpf/</guid>
      <description><![CDATA[Choosing a design pattern for the user interface of your application involves weighing trade-offs...]]></description>
      <content:encoded><![CDATA[<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>Choosing a design pattern for the user interface of your application involves weighing trade-offs between testability, complexity, developer tool support, and capabilities.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>There are two very prominent camps in user interface patterns:<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Forms &amp; Controls and Model-View-Something (Controller, Presenter, ViewModel, etc.).<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Martin Fowlers’ article <I style="mso-bidi-font-style: normal">GUI Architectures</I> (</FONT><A href="https://www.martinfowler.com/eaaDev/uiArchs.html" mce_href="https://www.martinfowler.com/eaaDev/uiArchs.html"><FONT face=Calibri color=#0000ff size=3>https://www.martinfowler.com/eaaDev/uiArchs.html</FONT></A><FONT size=3><FONT face=Calibri> ) provides a detailed history and comparison of some of these approaches.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>Many applications use Forms &amp; Controls pattern for their user interface.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>This is partially because it is the default pattern Visual Studio uses to create an application and more likely because it is a very simple pattern with a low barrier of entry for developers.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Though Forms &amp; Controls approach may be simpler to implement for small applications which can get away with limited or no unit testing, larger and more complex applications are increasingly difficult to maintain using this approach.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>This inherent lack of testability of a Forms &amp; Controls pattern make is a poor choice for implementing larger applications.</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>To solve this problem of testability, software architects have turned to more advanced user interface patterns such as Model-View-Controller, Model-View-Presenter (a.k.a. </FONT><A href="https://www.martinfowler.com/eaaDev/SupervisingPresenter.html" mce_href="https://www.martinfowler.com/eaaDev/SupervisingPresenter.html"><FONT face=Calibri color=#0000ff size=3>Supervising Controller</FONT></A><FONT face=Calibri size=3> and </FONT><A href="https://www.martinfowler.com/eaaDev/PassiveScreen.html" mce_href="https://www.martinfowler.com/eaaDev/PassiveScreen.html"><FONT face=Calibri color=#0000ff size=3>Passive View</FONT></A><FONT face=Calibri size=3>), </FONT><A href="https://martinfowler.com/eaaDev/PresentationModel.html" mce_href="https://martinfowler.com/eaaDev/PresentationModel.html"><FONT face=Calibri color=#0000ff size=3>Presentation Model</FONT></A><FONT size=3><FONT face=Calibri>, and other variants of these patterns.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>The goal of these patterns is creating user interface classes which can be easily tested, and minimizing the amount of code which resides in the view (a notoriously difficult part of the application to test in an automated fashion).<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Though these patterns are technology independent, the underlying GUI framework lends itself to certain patterns.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Windows Forms technology meshed particularly well with the Model-View-Presenter pattern, while implementing a Presentation Model pattern in Windows Forms required masses of synchronization code.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Windows Presentation Foundation, on the other hand, fits very well with the Presentation Model because of its advanced data binding technology which eliminates the need to write masses of synchronization code between the view and presentation model.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT size=3><FONT face=Calibri>Each screen is implemented as a View and Presentation Model pair.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Each class has distinct responsibilities.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>The view is responsible for how data is presented on the screen, and the presentation model is responsible for what gets presented on the screen and the actions which can be performed on that data.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT size=3><FONT face=Calibri>The view consists of both the XAML and the code-behind, and displays the data it gets from the presentation model.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Most views will be implemented mostly in XAML with a little supporting C#.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Layout and user interaction are the primary responsibilities of the view.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>The view interprets user actions and forwards them to the presentation model as commands.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>Commands are used to invoke behavior. <SPAN style="mso-spacerun: yes">&nbsp;</SPAN>The command pattern decouples the presentation model from the actual input event which invoked some functionality.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Commands capture the intent of the user, not necessarily the actual mechanics of how they indicated that intent.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>For example, the presentation model doesn’t need to know if the user clicked the save button, pressed CTRL+S, or selected save from a menu option.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>All the presentation model needs to concern itself with is that the data should be saved.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>The command object also provides a good mechanism for the presentation model to indicate if an action is enabled through the CanExecute callback of the command.</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>While the PresentationModel receives communication from the View via Commands, if it needs to notify the View of something, it should use events.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Events allow us to define the means of communication on the presentation model itself.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>While some events should be built into the presentation model base class (notifying when properties changed), others are screen specific and should be in the screen’s presentation model.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>There is no separate interface implemented by the View as in MVP.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Having the presentation model provide events simplifies unit test code, because you don’t need to create dummy views.</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>We’ll cover more in part 2.</FONT></P>]]></content:encoded>
    </item>
    <item>
      <title>Real World GridView is now on CodePlex</title>
      <link>https://docs.microsoft.com/archive/blogs/mattdotson/real-world-gridview-is-now-on-codeplex</link>
      <pubDate>Tue, 23 Jan 2007 03:30:00 GMT</pubDate>
      <dc:creator><![CDATA[Matt Dotson]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mattdotson/2007/01/23/real-world-gridview-is-now-on-codeplex/</guid>
      <description><![CDATA[Yup.&nbsp; I heard you (eventually).&nbsp; You wanted easier access to the source code of Real World...]]></description>
      <content:encoded><![CDATA[<P>Yup.&nbsp; I heard you (eventually).&nbsp; You wanted easier access to the source code of Real World GridView.&nbsp; Well, now you have it.&nbsp; CodePlex is Microsoft's new shared source development platform, and it should be much easier to use.&nbsp; Give it a try, here's the link: <A href="https://www.codeplex.com/ASPNetRealWorldContr" mce_href="https://www.codeplex.com/ASPNetRealWorldContr">https://www.codeplex.com/ASPNetRealWorldContr</A>.&nbsp; I even checked-in some bug fixes you've been asking for to entice you to try the new site!</P>]]></content:encoded>
    </item>
    <item>
      <title>Multi-Process Synchronization with Named Events</title>
      <link>https://docs.microsoft.com/archive/blogs/mattdotson/multi-process-synchronization-with-named-events</link>
      <pubDate>Fri, 03 Mar 2006 14:30:00 GMT</pubDate>
      <dc:creator><![CDATA[Matt Dotson]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mattdotson/2006/03/03/multi-process-synchronization-with-named-events/</guid>
      <description><![CDATA[Since I am in between real projects right now, I have had some time to work on some side...]]></description>
      <content:encoded><![CDATA[<P>Since I am in between real projects right now, I have had some time to work on some side projects.&nbsp; As I was working on some threading in one of these projects, I noticed that there was a new class in the System.Threading namespace that had not been there in .NET 1.1 ...&nbsp; EventWaitHandle.&nbsp; I was curious to see what this new class was.</P>
<P><STRONG><U>Background Info:</U></STRONG></P>
<P>Windows exposes several types of synchronization primitives (Mutexes, Events, etc.), but in .NET 1.1 we were limited in our use of them.&nbsp; Sure, we had AutoResetEvent and ManualResetEvent, but the framework did not expose the "named" version of these.&nbsp; In case you were wondering, the "named" version allows us to share an event between two (or more) processes.&nbsp; The name makes it easy for multiple processes to say "give me 'EventA' "!!&nbsp; So before 2.0, we had pretty good support for synchronization within a process, but not&nbsp;very good support across processes.&nbsp; Yes, in .NET 1.1, we could get to this functionality using PInvoke, but&nbsp;it could get complicated&nbsp;quickly because you can attach security descriptors to an event.&nbsp; And anyone who has tried to PInvoke to set some ACLs can tell you that&nbsp;security&nbsp;descriptor is a beast that you don't&nbsp;want to be playing with in C#.&nbsp;&nbsp;Fortunately this has been remedied in the 2.0 framework, and the&nbsp;Access Control Lists are now 1st class .NET objects.&nbsp; I am going to go out on a limb and speculate that this is why named events were not included in the first version of the framework.</P>
<P><STRONG><U>Back on Track:</U></STRONG></P>
<P>"Great!" you say, but what the heck does this have to do with EventWaitHandle?&nbsp; Well, EventWaitHandle is .NET 2.0's implementation of events -- both named and unnamed.&nbsp; You can see that ManualResetEvent and AutoResetEvent now inherit from EventWaitHandle.</P>
<P>So, let's get started and see what we can create with this.&nbsp; In this example, WorkerA does some work, which notifies WorkerB who begins some work, which notifies WorkerC to finish up some work.&nbsp; You can see that we are creating a simple&nbsp;pipeline.&nbsp; (A real pipeline would keep working, but ours just exits after one iteration).</P>
<P>Let's start by providing some tools for these events to get access to the events.</P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; COLOR: blue; FONT-FAMILY: Consolas; mso-no-proof: yes">public</SPAN><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"> <SPAN style="COLOR: blue">static</SPAN> <SPAN style="COLOR: blue">class</SPAN> <SPAN style="COLOR: teal">NamedEvents<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes">{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">public</SPAN> <SPAN style="COLOR: blue">static</SPAN> <SPAN style="COLOR: teal">EventWaitHandle</SPAN> OpenOrCreate(<SPAN style="COLOR: blue">string</SPAN> name, <SPAN style="COLOR: blue">bool</SPAN> initialState, <SPAN style="COLOR: teal">EventResetMode</SPAN> mode)<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: teal">EventWaitHandle</SPAN> ewh = <SPAN style="COLOR: blue">null</SPAN>;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">try<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ewh = <SPAN style="COLOR: teal">EventWaitHandle</SPAN>.OpenExisting(name);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">catch</SPAN> (<SPAN style="COLOR: teal">WaitHandleCannotBeOpenedException</SPAN>)<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">//Handle does not exist, create it.<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ewh = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: teal">EventWaitHandle</SPAN>(initialState, mode, name);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">return</SPAN> ewh;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">public</SPAN> <SPAN style="COLOR: blue">static</SPAN> <SPAN style="COLOR: teal">EventWaitHandle</SPAN> OpenOrWait(<SPAN style="COLOR: blue">string</SPAN> name)<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: teal">EventWaitHandle</SPAN> ewh = <SPAN style="COLOR: blue">null</SPAN>;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">while</SPAN> (<SPAN style="COLOR: blue">null</SPAN> == ewh)<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">try<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ewh = <SPAN style="COLOR: teal">EventWaitHandle</SPAN>.OpenExisting(name);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">catch</SPAN> (<SPAN style="COLOR: teal">WaitHandleCannotBeOpenedException</SPAN>)<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: teal">Thread</SPAN>.Sleep(50);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">return</SPAN> ewh;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes">}</SPAN></P>
<P>We've provided the tools to create an event if it doesn't already exist or open it if it does, and to open an existing event or wait for it to be created.&nbsp; Unfortunately there is not a good way to "test" if an event exists, so we just have to catch <SPAN style="COLOR: teal"><FONT face=Consolas>WaitHandleCannotBeOpenedException</FONT></SPAN>.&nbsp; Here is our code for&nbsp;WorkerB, though the other workers are almost identical except that they set and wait on different events.</P><SPAN style="FONT-SIZE: 11pt; COLOR: blue; FONT-FAMILY: Consolas; mso-no-proof: yes">
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; COLOR: blue; FONT-FAMILY: Consolas; mso-no-proof: yes">static</SPAN><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><FONT color=#000000> </FONT><SPAN style="COLOR: blue">void</SPAN><FONT color=#000000> <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /><st1:place w:st="on">Main</st1:place>(</FONT><SPAN style="COLOR: blue">string</SPAN><FONT color=#000000>[] args)<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><FONT color=#000000>{<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes"><FONT color=#000000>&nbsp;&nbsp;&nbsp; </FONT></SPAN><SPAN style="COLOR: teal">EventWaitHandle</SPAN><FONT color=#000000> completedA = </FONT><SPAN style="COLOR: teal">NamedEvents</SPAN><FONT color=#000000>.OpenOrWait(</FONT><SPAN style="COLOR: maroon">"CompletedA"</SPAN><FONT color=#000000>);<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes"><FONT color=#000000>&nbsp;&nbsp;&nbsp; </FONT></SPAN><SPAN style="COLOR: teal">EventWaitHandle</SPAN><FONT color=#000000> completedB = </FONT><SPAN style="COLOR: teal">NamedEvents</SPAN><FONT color=#000000>.OpenOrCreate(</FONT><SPAN style="COLOR: maroon">"CompletedB"</SPAN><FONT color=#000000>, </FONT><SPAN style="COLOR: blue">false</SPAN><FONT color=#000000>, </FONT><SPAN style="COLOR: teal">EventResetMode</SPAN><FONT color=#000000>.ManualReset);<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes"><FONT color=#000000>&nbsp;&nbsp;&nbsp; </FONT></SPAN><SPAN style="COLOR: teal">EventWaitHandle</SPAN><FONT color=#000000> pipelineDone = </FONT><SPAN style="COLOR: teal">NamedEvents</SPAN><FONT color=#000000>.OpenOrWait(</FONT><SPAN style="COLOR: maroon">"PipelineDone"</SPAN><FONT color=#000000>);<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><o:p><FONT color=#000000>&nbsp;</FONT></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes"><FONT color=#000000>&nbsp;&nbsp;&nbsp; </FONT></SPAN><SPAN style="COLOR: teal">Console</SPAN><FONT color=#000000>.WriteLine(</FONT><SPAN style="COLOR: maroon">"{0} Initialized"</SPAN><FONT color=#000000>, </FONT><SPAN style="COLOR: teal">Process</SPAN><FONT color=#000000>.GetCurrentProcess().ProcessName);<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><o:p><FONT color=#000000>&nbsp;</FONT></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><FONT color=#000000><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>completedA.WaitOne();<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><o:p><FONT color=#000000>&nbsp;</FONT></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes"><FONT color=#000000>&nbsp;&nbsp;&nbsp; </FONT></SPAN><SPAN style="COLOR: blue">for</SPAN><FONT color=#000000> (</FONT><SPAN style="COLOR: blue">int</SPAN><FONT color=#000000> i = 0; i &lt; 10; i++)<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><FONT color=#000000><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes"><FONT color=#000000>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></SPAN><SPAN style="COLOR: teal">Thread</SPAN><FONT color=#000000>.Sleep(250);<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes"><FONT color=#000000>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></SPAN><SPAN style="COLOR: teal">Console</SPAN><FONT color=#000000>.WriteLine(</FONT><SPAN style="COLOR: maroon">"{0} Working: {1:hh-mm-ss.ffff}"</SPAN><FONT color=#000000>, </FONT><SPAN style="COLOR: teal">Process</SPAN><FONT color=#000000>.GetCurrentProcess().ProcessName, </FONT><SPAN style="COLOR: teal">DateTime</SPAN><FONT color=#000000>.UtcNow);<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><FONT color=#000000><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><o:p><FONT color=#000000>&nbsp;</FONT></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes"><FONT color=#000000>&nbsp;&nbsp;&nbsp; </FONT></SPAN><SPAN style="COLOR: teal">Console</SPAN><FONT color=#000000>.WriteLine(</FONT><SPAN style="COLOR: maroon">"{0} Done"</SPAN><FONT color=#000000>, </FONT><SPAN style="COLOR: teal">Process</SPAN><FONT color=#000000>.GetCurrentProcess().ProcessName);<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><o:p><FONT color=#000000>&nbsp;</FONT></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><FONT color=#000000><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>completedB.Set();<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><o:p><FONT color=#000000>&nbsp;</FONT></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes"><FONT color=#000000>&nbsp;&nbsp;&nbsp; </FONT></SPAN><SPAN style="COLOR: green">//wait until the whole pipeline is done.<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><FONT color=#000000><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>pipelineDone.WaitOne();<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><o:p><FONT color=#000000>&nbsp;</FONT></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><FONT color=#000000><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>completedB.Close();<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><o:p><FONT color=#000000>&nbsp;</FONT></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><SPAN style="mso-spacerun: yes"><FONT color=#000000>&nbsp;&nbsp;&nbsp; </FONT></SPAN><SPAN style="COLOR: teal">Console</SPAN><FONT color=#000000>.WriteLine(</FONT><SPAN style="COLOR: maroon">"{0} Exiting"</SPAN><FONT color=#000000>, </FONT><SPAN style="COLOR: teal">Process</SPAN><FONT color=#000000>.GetCurrentProcess().ProcessName);<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><o:p><FONT color=#000000>&nbsp;</FONT></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Consolas; mso-no-proof: yes"><FONT color=#000000>}</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"></SPAN>
<P></P>
<P>In the output, we can see that B waits for A to finish, and C waits for B to finish.</P>
<P><IMG src="https://static.flickr.com/47/107314288_3ba8e6b2fa_o.jpg"></P>
<P>Now, you know how to use named events!!</P>
<P></P>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/00/54/31/43/BlogThreads.zip" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-00-54-31-43/BlogThreads.zip">BlogThreads.zip</a></p>]]></content:encoded>
    </item>
  </channel>
</rss>