<?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>SeenDaBean's Software Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/seendabean/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/seendabean/feed.xml</link>
    <description>From architecture, to cloud, to bits and bytes, and back again</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:25:13 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>CloudMutex - Synchronize threads across machines using Azure</title>
      <link>https://docs.microsoft.com/archive/blogs/seendabean/cloudmutex-synchronize-threads-across-machines-using-azure</link>
      <pubDate>Mon, 02 Jul 2012 23:59:00 GMT</pubDate>
      <dc:creator><![CDATA[SeanIanHale]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/seendabean/2012/07/02/cloudmutex-synchronize-threads-across-machines-using-azure/</guid>
      <description><![CDATA[Problem
I wanted to be able to read and write a particular set of resources, in my sample case this...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: large;"><strong>Problem</strong></span></p>
<p>I wanted to be able to read and write a particular set of resources, in my sample case this was an Azure blob as well as some associated SQL Database records, from one or more applications, machines, or devices such that only one consumer thread would be allowed to modify these resource at any one time.&nbsp; For the sake of this article, think of those resources as an atomic unit that should only ever be modified together and not individually, nor by more than one thread at a time.&nbsp; If I were solving this problem within a single app domain, I could use a simple critical section using the Monitor class, or the lock keyword.&nbsp; If I were solving this problem within a single machine (OS instance), I could then upgrade to the Mutex class while agreeing upon a shared mutex name for synchronization.&nbsp; One of the beautiful aspects of these synchronization mechanisms is that they provide near instant notification once the mutual exclusion or lock becomes available for another thread to acquire; this facilitates low latency, event-based collaboration between threads.&nbsp; They also implement a queued access model whereby access to the shared resource is granted on a first-come, first-serve basis.</p>
<p><span style="font-family: arial,helvetica,sans-serif;">These</span> OS-level techniques break down once I introduce the requirement to synchronize in the same way across devices.&nbsp; While I recognize that there are many ways to use other technologies as surrogates for these locking techniques when dealing with multiple devices, I sought to find one that looked and smelled as similar to .NET's Mutex class as possible.&nbsp; After some hours of searching, I found nothing I quite liked, so I've invented one that leverages Windows Azure Service Bus on the backend.&nbsp; The remainder of this article details a very early version of a class I call CloudMutex that implements the WaitOne and ReleaseMutex methods familiar to consumers of .NET's System.Threading.Mutex class.&nbsp; Please note that this is a very preliminary attempt and I'm hoping for great feedback from my peers before investing too much.&nbsp; If a ready-made solution already exists, I'd love to see that as well.</p>
<p>This article assumes that you have a basic understanding of Windows Azure Service Bus Queues along with solid C# fundamentals including thread synchronization mechanisms.&nbsp; For lack of that, please do some preparatory learning before going much further.&nbsp; Also note that hereafter, I'll just use the word "device" to refer to any OS instances, whether physical or virtual, on any operating system, anywhere with access to the Internet.&nbsp; Further, for those so inclined to want a more detailed definition of a mutex, think of it as a binary semaphore with thread affinity; that is, only one thread can own it at a time.</p>
<p><span style="font-size: large;"><strong>Starting from the end</strong></span></p>
<p>The first most&nbsp;salient unit test that I wrote sought to show that thread synchronization within a single process worked the same way as it would with the out-of-the-box Mutex class.&nbsp;&nbsp; As such, I drafted the following test case:</p>
<p style="margin-top: 0in; margin-right: 0in; margin-bottom: .0001pt; margin-left: .5in; text-indent: .5in; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">[</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">TestMethod</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">]</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">void</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> CanAcquireAndReleaseMutex()</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> mutexName = </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">Guid</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.NewGuid().ToString();</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">var</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> mutex = </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">new</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">CloudMutex</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">(</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">false</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">, mutexName);</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">var</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> acquiredByWorker = </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">new</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">ManualResetEvent</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">(</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">false</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">);</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> workerMessage = </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">null</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">ThreadPool</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.QueueUserWorkItem(</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">new</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">WaitCallback</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">(o =&gt;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">var</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> workerMutex = </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">new</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">CloudMutex</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">(</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">false</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">, mutexName);</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">Console</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.WriteLine(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white;">"Worker thread \"{0}\" has started."</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">, </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">Thread</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.CurrentThread.ManagedThreadId);</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; workerMutex.WaitOne();</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">Console</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.WriteLine(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white;">"Worker thread \"{0}\" has acquired the cloud workerMutex and will wait 2 seconds."</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">, </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">Thread</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.CurrentThread.ManagedThreadId);</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; acquiredByWorker.Set();</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">Thread</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.Sleep(2 * 1000);</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; workerMessage = </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">Guid</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.NewGuid().ToString();</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">Console</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.WriteLine(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white;">"Worker thread \"{0}\" has waited 2 seconds, set the worker message to \"{1}\" and will release the workerMutex."</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">, </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">Thread</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.CurrentThread.ManagedThreadId, workerMessage);</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; workerMutex.ReleaseMutex();</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">Console</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.WriteLine(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white;">"Worker thread \"{0}\" has released the workerMutex."</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">, </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">Thread</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.CurrentThread.ManagedThreadId);</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }));</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; acquiredByWorker.WaitOne();</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">Console</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.WriteLine(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white;">"Base thread \"{0}\" notified that the worker thread has acquired the cloud mutex."</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">, </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">Thread</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.CurrentThread.Name);</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mutex.WaitOne();</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Console</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.WriteLine(</span><span style="background: white; color: #a31515; font-family: Consolas; font-size: 9.5pt;">"Base thread \"{0}\" has acquired the cloud mutex."</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">, </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Thread</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.CurrentThread.Name);</span></span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mutex.Delete();</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">Assert</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.IsFalse(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">String</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.IsNullOrWhiteSpace(workerMessage));</span></p>
<p class="MsoNormal"><span style="font-size: 9.5pt; line-height: 115%; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p class="MsoNormal"><span style="background: white; color: black; line-height: 115%; font-family: arial,helvetica,sans-serif; font-size: 9.5pt;"></span>&nbsp;</p>
<p class="MsoNormal"><span style="background: white; color: black; line-height: 115%; font-family: arial,helvetica,sans-serif; font-size: 9.5pt;">In words, the main test thread is taking the following steps:</span></p>
<div class="WordSection1">
<ul>
<li>
<div class="MsoNormal"><span style="background: white; color: black; line-height: 115%; font-family: arial,helvetica,sans-serif; font-size: 9.5pt;">Creating a mutex with a Guid-based, random name that is does not initially have ownership of</span></div>
</li>
<li>
<div class="MsoNormal"><span style="background: white; color: black; line-height: 115%; font-family: arial,helvetica,sans-serif; font-size: 9.5pt;">Spinning up a worker thread from the thread pool whose job is to acquire that mutex and wait two seconds before releasing it</span></div>
</li>
<li>
<div class="MsoNormal"><span style="background: white; color: black; line-height: 115%; font-family: arial,helvetica,sans-serif; font-size: 9.5pt;">Waiting for the worker thread to release the mutex and immediately acquire it</span></div>
</li>
<li>
<div class="MsoNormal"><span style="background: white; color: black; line-height: 115%; font-family: arial,helvetica,sans-serif; font-size: 9.5pt;">Finally, deleting the mutex as a matter of good housekeeping</span></div>
</li>
</ul>
</div>
<p class="MsoNormal"><span style="background: white; color: black; line-height: 115%; font-family: arial,helvetica,sans-serif; font-size: 9.5pt;">The worker thread is taking the following steps:</span></p>
<ul>
<li>
<div class="MsoNormal"><span style="background: white; color: black; line-height: 115%; font-family: arial,helvetica,sans-serif; font-size: 9.5pt;">Acquiring the mutex</span></div>
</li>
<li>
<div class="MsoNormal"><span style="background: white; color: black; line-height: 115%; font-family: arial,helvetica,sans-serif; font-size: 9.5pt;">Signaling to the main test thread that it has acquired the mutex</span></div>
</li>
<li>
<div class="MsoNormal"><span style="background: white; color: black; line-height: 115%; font-family: arial,helvetica,sans-serif; font-size: 9.5pt;">Waiting two seconds</span></div>
</li>
<li>
<div class="MsoNormal"><span style="background: white; color: black; line-height: 115%; font-family: arial,helvetica,sans-serif; font-size: 9.5pt;">Releasing the mutex</span></div>
</li>
</ul>
<p class="MsoNormal"><span style="background: white; color: black; line-height: 115%; font-family: arial,helvetica,sans-serif; font-size: 9.5pt;">The above design ensures that the worker thread will always acquire the mutex before the main test thread attempts to do so.&nbsp; The output from the test will look approximately as follows:</span></p>
<p class="MsoNormal"></p>
<p class="MsoNormal"><span style="color: #800000;"><em><span style="background: white; line-height: 115%; font-family: arial,helvetica,sans-serif; font-size: 9.5pt;">(T+0 sec) - Worker thread "5" has started.</span></em></span></p>
<p class="MsoNormal"><span style="color: #800000;"><em><span style="background: white; line-height: 115%; font-family: arial,helvetica,sans-serif; font-size: 9.5pt;"><span style="color: #800000;"><em><span style="background: white; line-height: 115%; font-family: arial,helvetica,sans-serif; font-size: 9.5pt;">(T+0&nbsp;sec) - </span></em></span>Worker thread "5" has acquired the cloud workerMutex and will wait 2 seconds.</span></em></span></p>
<p class="MsoNormal"><span style="color: #800000;"><em><span style="background: white; line-height: 115%; font-family: arial,helvetica,sans-serif; font-size: 9.5pt;"><span style="color: #800000;"><em><span style="background: white; line-height: 115%; font-family: arial,helvetica,sans-serif; font-size: 9.5pt;">(T+0&nbsp;sec) - </span></em></span>Base thread "9" notified that the worker thread has acquired the cloud mutex.</span></em></span></p>
<p class="MsoNormal"><span style="color: #800000;"><em><span style="background: white; line-height: 115%; font-family: arial,helvetica,sans-serif; font-size: 9.5pt;"><span style="color: #800000;"><em><span style="background: white; line-height: 115%; font-family: arial,helvetica,sans-serif; font-size: 9.5pt;">(T+2&nbsp;sec) - </span></em></span>Worker thread "5" has waited 2 seconds, set the worker message to&nbsp;"{76B921AA-AF9D-482F-97A9-496B9701A5C7}" and will release the workerMutex.</span></em></span></p>
<p class="MsoNormal"><span style="color: #800000;"><em><span style="background: white; line-height: 115%; font-family: arial,helvetica,sans-serif; font-size: 9.5pt;"><span style="color: #800000;"><em><span style="background: white; line-height: 115%; font-family: arial,helvetica,sans-serif; font-size: 9.5pt;">(T+2&nbsp;sec) - </span></em></span>Base thread "9" has acquired the cloud mutex.</span></em></span></p>
<p class="MsoNormal"><span style="background: white; color: black; line-height: 115%; font-family: arial,helvetica,sans-serif; font-size: 9.5pt;"></span>&nbsp;</p>
<p class="MsoNormal"><span style="background: white; color: black; line-height: 115%; font-family: arial,helvetica,sans-serif; font-size: 9.5pt;">Summarily, for this very simple case, the CloudMutex works just as a regular mutex would but uses the cloud as the backing mechanism as opposed to resources on a single machine.&nbsp; I'm currently working on much more sophisticated cross machine test cases but, for now, trust me that this works whether the participants are in the same process or across the world from one another, so long as they both have internet access. and can someone agree on a mutex name (along with other Azure Service Bus details).</span></p>
<div class="MsoNormal">&nbsp;</div>
<div class="MsoNormal">
<p><span style="font-size: large;"><strong>How it works</strong></span></p>
<p>The hardest working class is, not suprisingly, the CloudMutex class itself.&nbsp; The first method to pay attention to is the constructor, which orchestrates the setup and initialization of the CloudMutex and eventually calls the EnsureMetaLockQueue() method that&nbsp;sets up a singleton queue within service bus that acts as a global, namespace-level mutex.&nbsp;It then goes on to intialize other important instance properties followed finally by a call to&nbsp;EnsureMutexQueue(), which makes sure that the Service Bus queue that backs the actual mutex is ready to go.&nbsp; Without further ado, I'll post the entire contents of the CloudMutex class followed by additional sections and code that explain other pieces of this puzzle as I've implemented it thus far.</p>
<p></p>
</div>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">using</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> System;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">using</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> System.Collections.Generic;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">using</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> System.Linq;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">using</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> System.Text;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">using</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> System.Threading;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">using</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> System.Diagnostics;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">using</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> Microsoft.ServiceBus;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">using</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> Microsoft.ServiceBus.Messaging;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">using</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> Yeast.WindowsAzure.ServiceBus;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">namespace</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> Yeast.WindowsAzure.Threading</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">{</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">class</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">CloudMutex</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">WaitHandle</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #region</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> Constants</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">const</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">string</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> MetaLockQueueName = </span><span style="background: white; color: #a31515; font-family: Consolas; font-size: 9.5pt;">"cloudmutex_metalock"</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">const</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">string</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> MessageIDProperty = </span><span style="background: white; color: #a31515; font-family: Consolas; font-size: 9.5pt;">"ID"</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">static</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">readonly</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Guid</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> MetaLockMessageID = </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Guid</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.Parse(</span><span style="background: white; color: #a31515; font-family: Consolas; font-size: 9.5pt;">"65A19C9A-40F3-4018-B16F-1923D3EA0457"</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">);</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #region</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> Fields</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;"><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>[ThreadStatic]</span></span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">private</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">static</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Dictionary</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&lt;</span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Uri</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">, </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">CloudMutex</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&gt; _threadOwnedMutexes = </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">new</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Dictionary</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&lt;</span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Uri</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">, </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">CloudMutex</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&gt;();</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #region</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> Constructors &amp; Initialization</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">private</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> CloudMutex()</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> CloudMutex(</span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">bool</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> initiallyOwned, </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">string</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> name)</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">this</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">(initiallyOwned, name, </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">ServiceBusSettings</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.FromConfiguration())</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> CloudMutex(</span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">bool</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> initiallyOwned, </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">string</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> name, </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">ServiceBusSettings</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> settings)</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">this</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">(initiallyOwned, name, settings, </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">CloudMutexConstructionMode</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.Full)</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">protected</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> CloudMutex(</span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">bool</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> initiallyOwned, </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">string</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> name, </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">ServiceBusSettings</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> settings, </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">CloudMutexConstructionMode</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> mode)</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">try</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Settings = settings;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MetaLockQueueClient = Settings.Factory.CreateQueueClient(MetaLockQueueName, </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">ReceiveMode</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.PeekLock);</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EnsureMetaLockQueue();</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">if</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> (mode == </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">CloudMutexConstructionMode</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.Full)</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InstanceID = </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Guid</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.NewGuid();</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InitiallyOwned = initiallyOwned;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Name = name;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">var</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> builder = </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">new</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">UriBuilder</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">(Settings.ServiceUri);</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; builder.Path = Name;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MutexQueueUri = builder.Uri;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NextList = </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">new</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Dictionary</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&lt;</span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Guid</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">, </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">CloudMutex</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&gt;();</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MutexQueueClient = Settings.Factory.CreateQueueClient(Name, </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">ReceiveMode</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.ReceiveAndDelete);</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EnsureMutexQueue();</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">catch</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> (</span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Exception</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> exception)</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">throw</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">new</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Exception</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">(</span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">String</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.Format(</span><span style="background: white; color: #a31515; font-family: Consolas; font-size: 9.5pt;">"Failed to create an instance of {0} on the Service Bus endpoint at {1}."</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">, GetType().Name, Settings.ServiceUri), exception);</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">private</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">void</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> SeedMetaLockMessage()</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">var</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> singletonMessage = </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">new</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">BrokeredMessage</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">();</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; singletonMessage.Properties[MessageIDProperty] = MetaLockMessageID;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MetaLockQueueClient.Send(singletonMessage);</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">protected</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">void</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> EnsureMetaLockQueue()</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">try</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">if</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> (!Settings.NamespaceClient.QueueExists(MetaLockQueueName))</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MetaLockQueueDescription = Settings.NamespaceClient.CreateQueue(MetaLockQueueName);</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SeedMetaLockMessage();</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CreatedMetaLockQueue = </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">true</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">else</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MetaLockQueueDescription = Settings.NamespaceClient.GetQueue(MetaLockQueueName);</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">if</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> (MetaLockQueueDescription.MessageCount == 0)</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SeedMetaLockMessage();</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">catch</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> (</span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Exception</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> exception)</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">throw</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">new</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Exception</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">(</span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">String</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.Format(</span><span style="background: white; color: #a31515; font-family: Consolas; font-size: 9.5pt;">"Failed to ensure the existence of, or to gain access to the meta lock queue with name {0}."</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">, MetaLockQueueName), exception);</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">protected</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">void</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> EnsureMutexQueue()</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">try</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">if</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> (!Settings.NamespaceClient.QueueExists(Name))</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">using</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> (</span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">var</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> scope = </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">new</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">MetaLockScope</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">(MetaLockQueueClient))</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OwnsMetaLock = </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">true</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">if</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> (!Settings.NamespaceClient.QueueExists(Name))</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Trace</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.WriteLine(</span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">String</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.Format(</span><span style="background: white; color: #a31515; font-family: Consolas; font-size: 9.5pt;">"{0} - Queue '{1}' does not exist at {2} and will be created."</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">, </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">DateTime</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.Now, Name, Settings.ServiceUri), GetType().Name);</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MutexQueueDescription = Settings.NamespaceClient.CreateQueue(Name);</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Trace</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.WriteLine(</span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">String</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.Format(</span><span style="background: white; color: #a31515; font-family: Consolas; font-size: 9.5pt;">"{0} - Successfully created queue '{1}' at {2}."</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">, </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">DateTime</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.Now, Name, Settings.ServiceUri), GetType().Name);</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">if</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> (!InitiallyOwned)</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">var</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> mutexMessage = </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">new</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">BrokeredMessage</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">();</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MutexQueueClient.Send(mutexMessage);</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">else</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MutexQueueDescription = Settings.NamespaceClient.GetQueue(Name);</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">if</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> (InitiallyOwned)</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WaitOne();</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OwnsMetaLock = </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">false</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">else</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MutexQueueDescription = Settings.NamespaceClient.GetQueue(Name);</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">catch</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> (</span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Exception</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> exception)</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">throw</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">new</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Exception</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">(</span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">String</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.Format(</span><span style="background: white; color: #a31515; font-family: Consolas; font-size: 9.5pt;">"Failed to ensure the existence of, or to gain access to the mutex queue with name {0}."</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">, Name), exception);</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #region</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> Properties</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Guid</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> InstanceID</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">get</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">private</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">set</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">protected</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">BrokeredMessage</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> AcquisitionMessage</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">get</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">private</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">set</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">CloudMutex</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> Previous</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">get</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">private</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">set</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Dictionary</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&lt;</span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Guid</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">, </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">CloudMutex</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&gt; NextList</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">get</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">private</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">set</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Uri</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> MutexQueueUri</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">get</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">private</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">set</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">bool</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> OwnsMutex</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">get</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">private</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">set</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">bool</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> OwnsMetaLock</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">get</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">private</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">set</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">bool</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> CreatedMetaLockQueue</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">get</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">private</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">set</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">bool</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> InitiallyOwned</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">get</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">private</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">set</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">string</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> Name</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">get</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">private</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">set</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">ServiceBusSettings</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> Settings</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">get</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">private</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">set</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">MessagingFactory</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> Factory</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">get</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">private</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">set</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">protected</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">QueueClient</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> MetaLockQueueClient</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">get</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">private</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">set</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">protected</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">QueueDescription</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> MetaLockQueueDescription</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">get</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">private</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">set</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">protected</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">QueueClient</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> MutexQueueClient</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">get</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">private</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">set</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">protected</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">QueueDescription</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> MutexQueueDescription</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">get</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">private</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">set</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #region</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> Object Overrides</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">override</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">int</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> GetHashCode()</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">return</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> MutexQueueUri.GetHashCode();</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">override</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">string</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> ToString()</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">return</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> MutexQueueUri.ToString();</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">override</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">bool</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> Equals(</span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">object</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> obj)</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">bool</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> areEqual = </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">false</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">if</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> (obj </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">is</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">CloudMutex</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">)</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">var</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> operand = obj </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">as</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">CloudMutex</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; areEqual = MutexQueueUri == operand.MutexQueueUri;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">return</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> areEqual;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #region</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> Methods</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">static</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">void</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> ReinitializeMetaLock()</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ReinitializeMetaLock(</span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">ServiceBusSettings</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.FromConfiguration());</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">static</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">void</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> ReinitializeMetaLock(</span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">ServiceBusSettings</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> settings)</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; settings.NamespaceClient.DeleteQueue(MetaLockQueueName);</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">var</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> mutex = </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">new</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">CloudMutex</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">(</span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">false</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">, </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">null</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">, settings, </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">CloudMutexConstructionMode</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.MetaLockOnly);</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">override</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">bool</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> WaitOne(</span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">TimeSpan</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> timeout)</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">return</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> WaitOne(timeout, </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">false</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">);</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">override</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">bool</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> WaitOne(</span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">TimeSpan</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> timeout, </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">bool</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> exitContext)</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">return</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> WaitOne((</span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">int</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">)timeout.TotalMilliseconds, exitContext);</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">override</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">bool</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> WaitOne()</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">return</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> WaitOne(1000 * 60 * 5);</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">override</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">bool</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> WaitOne(</span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">int</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> millisecondsTimeout, </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">bool</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> exitContext)</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">if</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> (OwnsMutex)</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">throw</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">new</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">InvalidOperationException</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">(</span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">String</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.Format(</span><span style="background: white; color: #a31515; font-family: Consolas; font-size: 9.5pt;">"Cannot acquire the mutex backed by queue {0} on the Service Bus endpoint at {1} because it is currently owned by this instance of {2}."</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">, Name, Settings.ServiceUri, GetType().Name));</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">CloudMutex</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> previousMutex;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">if</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> (_threadOwnedMutexes.TryGetValue(MutexQueueUri, </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">out</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> previousMutex))</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Previous = previousMutex;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Previous.NextList.Add(InstanceID, </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">this</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">);</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OwnsMutex = </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">true</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AcquisitionMessage = Previous.AcquisitionMessage;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">else</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AcquisitionMessage = MutexQueueClient.Receive(</span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">TimeSpan</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.FromMilliseconds(millisecondsTimeout));</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OwnsMutex = </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">true</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _threadOwnedMutexes.Add(MutexQueueUri, </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">this</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">);</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">return</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> OwnsMutex;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">void</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> ReleaseMutex()</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">if</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> (!OwnsMutex)</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">throw</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">new</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">InvalidOperationException</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">(</span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">String</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.Format(</span><span style="background: white; color: #a31515; font-family: Consolas; font-size: 9.5pt;">"Cannot release the mutex backed by queue {0} on the Service Bus endpoint at {1}.&nbsp; It is not owned by this instance of {2}."</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">, Name, Settings.ServiceUri, GetType().Name));</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">if</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> (Previous != </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">null</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">)</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">if</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> (!Previous.NextList.Remove(InstanceID))</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">throw</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">new</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">InvalidOperationException</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">(</span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">String</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.Format(</span><span style="background: white; color: #a31515; font-family: Consolas; font-size: 9.5pt;">"Failed to remove the {0} instance with ID {1} from the previous {0}'s (ID: {2}) next list.&nbsp; The current instance was not found.&nbsp; This may indicate a bug in your software."</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">, GetType().Name, InstanceID, Previous.InstanceID));</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Previous = </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">null</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">else</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">if</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> (!_threadOwnedMutexes.Remove(MutexQueueUri))</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">throw</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">new</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">InvalidOperationException</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">(</span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">String</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.Format(</span><span style="background: white; color: #a31515; font-family: Consolas; font-size: 9.5pt;">"Failed to remove the {0} instance with ID {1} and path {2} from the thread owned mutex list.&nbsp; This may indicate a bug in your software."</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">, GetType().Name, InstanceID, MutexQueueUri));</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OwnsMutex = </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">false</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">var</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> releaseMessage = </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">new</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">BrokeredMessage</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">();</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MutexQueueClient.Send(releaseMessage);</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">void</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> Delete()</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Trace</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.WriteLine(</span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">String</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.Format(</span><span style="background: white; color: #a31515; font-family: Consolas; font-size: 9.5pt;">"{0} - About to delete queue '{1}' at {2}."</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">, </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">DateTime</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.Now, Name, Settings.ServiceUri), GetType().Name);</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Settings.NamespaceClient.DeleteQueue(Name);</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Trace</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.WriteLine(</span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">String</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.Format(</span><span style="background: white; color: #a31515; font-family: Consolas; font-size: 9.5pt;">"{0} - Successfully deleted queue '{1}' at {2}."</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">, </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">DateTime</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.Now, Name, Settings.ServiceUri), GetType().Name);</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">}</span></p>
<p class="WordSection1"><strong></strong>&nbsp;</p>
<p class="WordSection1"><strong>The Meta Lock</strong></p>
<p class="WordSection1">I wanted this so that I could ensure that the basic infrastructure needed in service bus to support any one mutex could be created in a safe, isolated manner, free from race conditions.&nbsp; All clients of this meta lock queue use the "peek lock" mechanism for accessing a singleton message within that queue.&nbsp; The act of receiving the message from the queue is analagous to acquiring a lock on the entire service bus namespace for the purposes of these mutexes.&nbsp; When the owner of the meta lock abandons the singleton message, that is analogous to releasing the lock. While this lock is held, one can be sure that no other thread is attempting to create service bus queues for mutexes so long as all parties respect the meta lock.&nbsp; To make the meta lock easy to use in code, I've created a MetaLockScope class that implements the IDisposable interface so that the using keyword can be applied in code to demark the beginning and end of a protected code section.&nbsp; The class has the following definition:</p>
<p class="WordSection1">&nbsp;</p>
<div class="WordSection1">
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> System;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> System.Collections.Generic;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> System.Linq;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> System.Text;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> System.Diagnostics;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> Microsoft.ServiceBus;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> Microsoft.ServiceBus.Messaging;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> Yeast.WindowsAzure.ServiceBus;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">namespace</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> Yeast.WindowsAzure.Threading</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">{</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">class</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">MetaLockScope</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">IDisposable</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #region</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> Constants</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">const</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">int</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> DefaultServerWaitTimeInSeconds = 60;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #region</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> Constructors</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> MetaLockScope()</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">this</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">ServiceBusSettings</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.FromConfiguration()</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Factory.CreateQueueClient(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">CloudMutex</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.MetaLockQueueName, </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">ReceiveMode</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.PeekLock))</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> MetaLockScope(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">QueueClient</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> metaLockQueueClient)</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">this</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">(metaLockQueueClient, </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">TimeSpan</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.FromSeconds(DefaultServerWaitTimeInSeconds))</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> MetaLockScope(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">QueueClient</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> metaLockQueueClient, </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">TimeSpan</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> serverWaitTime)</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">try</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MetaLockQueueClient = metaLockQueueClient;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">Trace</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.WriteLine(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">String</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.Format(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white;">"{0} - About to receive meta lock queue message from {1}"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">, </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">DateTime</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.Now, MetaLockQueueClient.Path), GetType().Name);</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SingletonMessage = MetaLockQueueClient.Receive(serverWaitTime);</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">if</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> (SingletonMessage == </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">null</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">)</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">throw</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">new</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">Exception</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">String</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.Format(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white;">"Failed to acquire the meta lock because the timeout expired.&nbsp; The server wait time is currently set to {0}."</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">, serverWaitTime));</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">Trace</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.WriteLine(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">String</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.Format(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white;">"{0} - Receive meta lock queue message with ID {1} from {2}"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">, </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">DateTime</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.Now, SingletonMessage.SequenceNumber, MetaLockQueueClient.Path), GetType().Name);</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">catch</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> (</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">Exception</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> exception)</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">throw</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">new</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">Exception</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">String</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.Format(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white;">"Failed to acquire the meta lock on queue {0} using {1} as the server wait time."</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">, </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">CloudMutex</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.MetaLockQueueName, serverWaitTime), exception);</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #region</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> Properties</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">protected</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">QueueClient</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> MetaLockQueueClient</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">get</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">private</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">set</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">protected</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">BrokeredMessage</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> SingletonMessage</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">get</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">private</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">set</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #region</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> IDisposable</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">void</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> Dispose()</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">if</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> (SingletonMessage != </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">null</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">)</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">Trace</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.WriteLine(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">String</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.Format(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white;">"{0} - About to abandon meta lock queue message with ID {1} from {2}"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">, </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">DateTime</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.Now, SingletonMessage.SequenceNumber, MetaLockQueueClient.Path), GetType().Name);</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SingletonMessage.Abandon();</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">Trace</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.WriteLine(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">String</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.Format(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white;">"{0} - Successfully abandoned lock queue message with ID {1} from {2}"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">, </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">DateTime</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.Now, SingletonMessage.SequenceNumber, MetaLockQueueClient.Path), GetType().Name);</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">}</span></p>
<p class="MsoNormal">&nbsp;</p>
</div>
<p class="WordSection1"><span style="font-size: large;"><strong>Acquiring and releasing the CloudMutex</strong></span></p>
<p class="WordSection1">With all of the scaffolding in place to support this cross machine synchronization mechanism laid out, I'll finally elaborate around how the two other key methods, WaitOne, and ReleaseMutex work internally.</p>
<p class="WordSection1">&nbsp;<strong>WaitOne</strong></p>
<p class="WordSection1">For each mutex, a unique service bus queue is required.&nbsp; That queue will be in an "acquireable" state if a single message is present in the queue.&nbsp; The act of receiving and deleting the message from the queue is done by the WaitOne method in order to acquire the mutex.&nbsp; Because of the way that service bus queues behave, only one consumer will be allowed to receive that message and thus acquire the mutex.&nbsp; All other callers will wait to receive a message, or return instantly without a message depending on the caller's choice.&nbsp; Should multiple calls all attempt to acquire the mutex before it has been released, only the first caller will succeed while the others will themselves be queued up behind one another</p>
<p class="WordSection1">&nbsp;<strong>ReleaseMutex</strong></p>
<p class="WordSection1">To release the mutex, and this make it acquireable by another caller, a message must be placed back into the queue.&nbsp; As such, the ReleaseMutex method underlyingly sends a message to the queue to effect the release.</p>
<p class="WordSection1">&nbsp;<strong>Notes</strong></p>
<div class="WordSection1">
<ul>
<li>I am fully aware that this class is far from complete and many misues can be made of these classes to cause their behavior to fail.&nbsp; Once this idea has been further vetted, I'll invest more time in plugging the many holes.</li>
<li>Full semaphore semantics are also possible with this design such that multiple acquisitions and releases could occur on a single "mutex" thus making the behavior much more like the Semaphore class in .NET</li>
</ul>
</div>
<p class="WordSection1"><span style="font-size: large;"><strong></strong></span>&nbsp;</p>
<p class="WordSection1"><span style="font-size: large;"><strong>Supporting actor</strong></span></p>
<p class="WordSection1">The following enum exists in my source base that I'll share for clarity.&nbsp;&nbsp;It doesn't&nbsp;do a terrible amount so I'll just post&nbsp;it for the curious.</p>
<p class="WordSection1"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> System;</span></p>
<div class="WordSection1">
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> System.Collections.Generic;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> System.Linq;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> System.Text;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">namespace</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> Yeast.WindowsAzure.Threading</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">{</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">enum</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">CloudMutexConstructionMode</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Full = 1,</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MetaLockOnly = 2</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">}</span></p>
<p class="MsoNormal">&nbsp;</p>
</div>
<p class="WordSection1">&nbsp;</p>
<p class="WordSection1"><span style="font-size: large;"><strong>Next steps</strong></span></p>
<p class="WordSection1">If anyone find this idea of a cloud mutex interesting, please let me know by commenting on this blog post and I'll look for some time to go deeper.</p>
<p class="WordSection1">Finally, there is a class called ServiceBusSettings that I've included here along with a sister class called ServiceBusSection (a configuration section), that might&nbsp;deserve a blog post of their own.&nbsp; That'll be my very next project unless something else catches my fancy first, if only to get feedback on other techniques that have worked well for others.&nbsp; Suffice it to say though, these classes provide a means by which to access Windows Azure Service Bus credentials in a way that works whether running inside or outside of the compute emulator.&nbsp; I consider that&nbsp;a general problem for which I have one general solution.</p>
<p class="WordSection1">As always, I look forward to your input.&nbsp;&nbsp; I post to share and I post to learn.</p>
<p class="WordSection1">&nbsp;</p>
<div class="WordSection1">
<p class="MsoNormal"><strong>ServiceBusSection</strong></p>
<p class="MsoNormal">&nbsp;</p>
<div class="WordSection1">
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> System;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> System.Collections.Generic;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> System.Linq;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> System.Text;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> System.Configuration;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">namespace</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> Yeast.WindowsAzure.ServiceBus</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">{</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">class</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">ServiceBusSection</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">ConfigurationSection</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #region</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> Shared Constants</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">const</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> SectionPath = </span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white;">"yeast/windowsAzure/serviceBus"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #region</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> Constructors</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">static</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> ServiceBusSection()</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _instance = </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">ConfigurationManager</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.GetSection(SectionPath) </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">as</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">ServiceBusSection</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">if</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> (_instance == </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">null</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">)</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _instance = </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">new</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">ServiceBusSection</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">();</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> ServiceBusSection()</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #region</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> Properties</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">private</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">static</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">ServiceBusSection</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> _instance;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">static</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">ServiceBusSection</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> Instance</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">get</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">return</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> _instance;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">const</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> ServiceNamespaceName = </span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white;">"serviceNamespace"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">ConfigurationProperty</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">(ServiceNamespaceName)]</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> ServiceNamespace</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">get</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">return</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> (</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">)</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">this</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">[ServiceNamespaceName];</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">const</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> IssuerNameName = </span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white;">"issuerName"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">ConfigurationProperty</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">(IssuerNameName)]</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> IssuerName</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">get</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">return</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> (</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">)</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">this</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">[IssuerNameName];</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">const</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> IssuerKeyName = </span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white;">"issuerKey"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">ConfigurationProperty</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">(IssuerKeyName)]</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> IssuerKey</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">get</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">return</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> (</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">)</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">this</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">[IssuerKeyName];</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">const</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> ServicePathName = </span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white;">"servicePath"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">ConfigurationProperty</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">(ServicePathName)]</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> ServicePath</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">get</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">return</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> (</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">)</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">this</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">[ServicePathName];</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">const</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> AllowRoleEnvironmentOverrideName = </span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white;">"allowRoleEnvironmentOverride"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">ConfigurationProperty</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">(AllowRoleEnvironmentOverrideName, DefaultValue = </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">true</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">)]</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">bool</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> AllowRoleEnvironmentOverride</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">get</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">return</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> (</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">bool</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">)</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">this</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">[AllowRoleEnvironmentOverrideName];</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">}</span></p>
<p class="MsoNormal">&nbsp;&nbsp;</p>
</div>
<p class="MsoNormal"><strong>ServiceBusSettings</strong></p>
<p class="MsoNormal"><strong></strong>&nbsp;&nbsp;</p>
</div>
<div class="WordSection1">
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> System;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> System.Collections.Generic;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> System.Linq;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> System.Text;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> Microsoft.WindowsAzure;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> Microsoft.WindowsAzure.ServiceRuntime;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> Microsoft.ServiceBus;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> Microsoft.ServiceBus.Messaging;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">namespace</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> Yeast.WindowsAzure.ServiceBus</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">{</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: gray; background: white;">///</span><span style="font-size: 9.5pt; font-family: Consolas; color: green; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: gray; background: white;">&lt;summary&gt;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: gray; background: white;">///</span><span style="font-size: 9.5pt; font-family: Consolas; color: green; background: white;"> Holds settings and methods useful in accessing Windows Azure Service Bus.</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: gray; background: white;">///</span><span style="font-size: 9.5pt; font-family: Consolas; color: green; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: gray; background: white;">&lt;/summary&gt;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: gray; background: white;">///</span><span style="font-size: 9.5pt; font-family: Consolas; color: green; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: gray; background: white;">&lt;remarks&gt;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: gray; background: white;">///</span><span style="font-size: 9.5pt; font-family: Consolas; color: green; background: white;"> This class is not thread safe.</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: gray; background: white;">///</span><span style="font-size: 9.5pt; font-family: Consolas; color: green; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: gray; background: white;">&lt;/remarks&gt;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">class</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">ServiceBusSettings</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #region</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> Shared Fields</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">const</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> ServiceBusUriScheme = </span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white;">"sb"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">const</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> ConfigurationKeyPrefix = </span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white;">"Yeast.WindowsAzure.ServiceBus."</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #region</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> Constructors</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> ServiceBusSettings()</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Source = </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">SettingsSource</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.Unknown;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #region</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> Properties</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">const</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> ServiceNamespaceConfigurationKey = ConfigurationKeyPrefix + </span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white;">"ServiceNamespace"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> ServiceNamespace</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">get</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">set</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">const</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> IssuerNameConfigurationKey = ConfigurationKeyPrefix + </span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white;">"IssuerName"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> IssuerName</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">get</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">set</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">const</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> IssuerKeyConfigurationKey = ConfigurationKeyPrefix + </span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white;">"IssuerKey"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> IssuerKey</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">get</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">set</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">const</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> ServicePathConfigurationKey = ConfigurationKeyPrefix + </span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white;">"ServicePath"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> ServicePath</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">get</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">set</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">SettingsSource</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> Source</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">get</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">private</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">set</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">private</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">TokenProvider</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> _credentials;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">TokenProvider</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> Credentials</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">get</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">if</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> (_credentials == </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">null</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">)</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _credentials = </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">TokenProvider</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.CreateSharedSecretTokenProvider(IssuerName, IssuerKey);</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">return</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> _credentials;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">private</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">Uri</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> _serviceUri;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">Uri</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> ServiceUri</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">get</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">if</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> (_serviceUri == </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">null</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">)</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _serviceUri = </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">ServiceBusEnvironment</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.CreateServiceUri(ServiceBusUriScheme, ServiceNamespace, ServicePath);</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">return</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> _serviceUri;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">private</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">NamespaceManager</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> _namespaceClient;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">NamespaceManager</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> NamespaceClient</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">get</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">if</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> (_namespaceClient == </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">null</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">)</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _namespaceClient = </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">new</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">NamespaceManager</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">(ServiceUri, Credentials);</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">return</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> _namespaceClient;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">private</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">MessagingFactory</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> _factory;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">MessagingFactory</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> Factory</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">get</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">if</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> (_factory == </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">null</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">)</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _factory = </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">MessagingFactory</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.Create(ServiceUri, Credentials);</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">return</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> _factory;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">bool</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> IsValid</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">get</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">return</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; !</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">String</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.IsNullOrWhiteSpace(ServiceNamespace)</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;&amp; !</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">String</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.IsNullOrWhiteSpace(IssuerName)</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;&amp; !</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">String</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.IsNullOrWhiteSpace(IssuerKey);</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #region</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> Overrides</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">override</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">bool</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> Equals(</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">object</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> obj)</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">var</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> areEqual = </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">false</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">if</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> (obj </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">is</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">ServiceBusSettings</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">)</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">var</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> operand = obj </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">as</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">ServiceBusSettings</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; areEqual = ServiceUri == operand.ServiceUri;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">return</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> areEqual;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">override</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> ToString()</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">return</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> ServiceUri.ToString();</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">override</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">int</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> GetHashCode()</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">return</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> ServiceUri.GetHashCode();</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #region</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> Methods</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">static</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">ServiceBusSettings</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> FromConfiguration()</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">var</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> settings = </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">new</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">ServiceBusSettings</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">();</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; settings.ServiceNamespace = </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">ServiceBusSection</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.Instance.ServiceNamespace;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; settings.IssuerName = </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">ServiceBusSection</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.Instance.IssuerName;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; settings.IssuerKey = </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">ServiceBusSection</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.Instance.IssuerKey;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; settings.ServicePath = </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">ServiceBusSection</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.Instance.ServicePath;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; settings.Source = </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">SettingsSource</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.AppConfig;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">if</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> (!settings.IsValid)</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;settings.Source |= </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">SettingsSource</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.Invalid;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">if</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> (</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">ServiceBusSection</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.Instance.AllowRoleEnvironmentOverride &amp;&amp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">RoleEnvironment</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.IsAvailable)</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">var</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> roleSettings = </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">new</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">ServiceBusSettings</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">();</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; roleSettings.ServiceNamespace = </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">RoleEnvironment</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.GetConfigurationSettingValue(ServiceNamespaceConfigurationKey);</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; roleSettings.IssuerName = </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">RoleEnvironment</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.GetConfigurationSettingValue(IssuerNameConfigurationKey);</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; roleSettings.IssuerKey = </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">RoleEnvironment</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.GetConfigurationSettingValue(IssuerKeyConfigurationKey);</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; roleSettings.ServicePath = </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">RoleEnvironment</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.GetConfigurationSettingValue(ServicePathConfigurationKey);</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; roleSettings.Source = </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">SettingsSource</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.RoleEnvironment;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">if</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> (roleSettings.IsValid)</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; settings = roleSettings;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">else</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; roleSettings.Source |= </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">SettingsSource</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.Invalid;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">if</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> (!settings.IsValid)</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">throw</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">new</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">Exception</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white;">String</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">.Format(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white;">"Unable to populate a {0} instance from configuration.&nbsp; The Source property is currently {1}."</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">, settings.GetType().Name, settings.Source));</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">return</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;"> settings;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="margin-bottom: .0001pt; line-height: normal; text-autospace: none;" class="MsoNormal"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white;">}</span></p>
<p class="MsoNormal">&nbsp;</p>
</div>]]></content:encoded>
    </item>
    <item>
      <title>FileLoadException in Unit Test on RoleEnvironment.IsAvailable with Visual Studio 2012 RC with Azure SDK 1.7</title>
      <link>https://docs.microsoft.com/archive/blogs/seendabean/fileloadexception-in-unit-test-on-roleenvironment-isavailable-with-visual-studio-2012-rc-with-azure-sdk-1-7</link>
      <pubDate>Mon, 25 Jun 2012 22:53:00 GMT</pubDate>
      <dc:creator><![CDATA[SeanIanHale]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/seendabean/2012/06/25/fileloadexception-in-unit-test-on-roleenvironment-isavailable-with-visual-studio-2012-rc-with-azure-sdk-1-7/</guid>
      <description><![CDATA[Problem and Solution
While upgrading to VS2012 Pro RC, my unit tests began to fail across the board...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: large;"><strong>Problem and Solution</strong></span></p>
<p>While upgrading to VS2012 Pro RC, my unit tests began to fail across the board when accessing various Azure APIs like RoleEnvironment.IsAvailable.&nbsp;&nbsp;I would get the exception below consistently:</p>
<p>System.TypeInitializationException: The type initializer for 'Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment' threw an exception. ---&gt; System.IO.FileLoadException: Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.<br />Result StackTrace:&nbsp;<br />at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.InitializeEnvironment()<br />&nbsp;&nbsp; at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment..cctor()<br />&nbsp;--- End of inner exception stack trace ---<br />&nbsp;&nbsp;&nbsp; at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.get_IsAvailable()</p>
<p>To reproduce this, I would do the following:</p>
<ul>
<li>Prerequisites: VS2012RC, .NET SDK for 1.7 Azure release (and it's dependencies from <a href="https://www.windowsazure.com/en-us/develop/net/">https://www.windowsazure.com/en-us/develop/net/)</a></li>
<li>Open VS2012RC</li>
<li>Create a new Test =&gt; Unit Test project</li>
<li>Add a reference to Microsoft.WindowsAzure.ServiceRuntime from: c:\Program Files\Microsoft SDKs\Windows Azure\.NET SDK\2012-06\ref\Microsoft.WindowsAzure.ServiceRuntime.dll</li>
<li>Add the following code to the default test file:&nbsp;</li>
</ul>
<div class="WordSection1">
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">using</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> System;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">using</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> Microsoft.VisualStudio.TestTools.UnitTesting;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">using</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> Microsoft.WindowsAzure.ServiceRuntime;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">namespace</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> UnitTestProject1</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">{</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [</span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">TestClass</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">]</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">class</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">UnitTest1</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [</span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">TestMethod</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">]</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">void</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> TestMethod1()</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">if</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;"> (!</span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">RoleEnvironment</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.IsAvailable)</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Console</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.WriteLine(</span><span style="background: white; color: #a31515; font-family: Consolas; font-size: 9.5pt;">"The Azure RoleEnvironment is not available.&nbsp; This is the expected output."</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">);</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt;">else</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Console</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">.WriteLine(</span><span style="background: white; color: #a31515; font-family: Consolas; font-size: 9.5pt;">"The Azure RoleEnvironment is available.&nbsp; This should never happen."</span><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">);</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p style="line-height: normal; margin-bottom: 0pt;" class="MsoNormal"><span style="background: white; color: black; font-family: Consolas; font-size: 9.5pt;">}</span></p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">Run the test using Test Explorer and the test should fail with approximately the output that I initially indicated.&nbsp; To work around this problem (which I feel I should not have had to), I did the following:</p>
<ul>
<li>
<div class="MsoNormal">Started my test in the debugger</div>
</li>
<li>
<div class="MsoNormal">Identified the PID of the process using System.Diagnostics.GetCurrentProcess().Id</div>
</li>
<li>
<div class="MsoNormal">Mapped that in task manager to "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.executionengine.x86.exe"</div>
</li>
<li>
<div class="MsoNormal">Opened the vstest.executionengine.x86.exe.config file in a text editor and added the following XML below the&nbsp;&lt;configuration&gt; opening tag:</div>
</li>
</ul>
<p class="MsoNormal">&lt;startup useLegacyV2RuntimeActivationPolicy="true"&gt;<br />&nbsp;&nbsp;&lt;supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/&gt;<br />&nbsp;&lt;/startup&gt;</p>
<ul>
<li>
<div class="MsoNormal">Closed and reopened Visual Studio</div>
</li>
<li>
<div class="MsoNormal">Reran my test</div>
</li>
<li>
<div class="MsoNormal">Success - The test passed and had the expected output on the console.</div>
</li>
</ul>
<p class="MsoNormal">Before attempting this relatively hackish solution, I did also try putting the startup configuration element in an app.config for the test project as well as machine.config, but to no avail.&nbsp; I did repro the problem in a simple console application but was able to use this workaround by placing the tag in that console app's app.config.</p>
<p><span style="font-size: large;"><strong></strong></span>&nbsp;</p>
<p><span style="font-size: large;"><strong>Questions and Concerns</strong></span></p>
<p>I don't think that I should have had to take the above steps to work around this problem.&nbsp; Can anyone explain to me why the default configuration of my system after installing Dev11 RC behaved this way?&nbsp; Note that I also have VS2010 Pro installed with the 1.6 SDK and the 1.7 SDK.&nbsp; Are these pre-existing installations part of the problem?</p>
<p>While researching this problem, I came across many different articles and posts talking about similar problems, but none with quite the solution I needed.&nbsp; For reference, I also spent time trying to absorb this post for detailed backround on the configuration attribute in play here: <a href="https://www.marklio.com/marklio/PermaLink,guid,ecc34c3c-be44-4422-86b7-900900e451f9.aspx">https://www.marklio.com/marklio/PermaLink,guid,ecc34c3c-be44-4422-86b7-900900e451f9.aspx</a></p>
<p>If you know the root cause of this and why I had to work around it, I'd love to know.&nbsp; I'm going to guess I won't be the only one seeing this.&nbsp; I hope this problem does not resurface with the GA release of VS2012 and/or that my system configuration is somehow unique.&nbsp; Note that I'm developing on Windows Server 2008 R2 (not that that should matter).</p>
<p>~Cheers</p>
<p>Sean</p>
<p>&nbsp;</p>
</div>]]></content:encoded>
    </item>
    <item>
      <title>Unity Interception with WCF</title>
      <link>https://docs.microsoft.com/archive/blogs/seendabean/unity-interception-with-wcf</link>
      <pubDate>Sat, 21 Jan 2012 16:41:00 GMT</pubDate>
      <dc:creator><![CDATA[SeanIanHale]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/seendabean/2012/01/21/unity-interception-with-wcf/</guid>
      <description><![CDATA[When working with a customer, I found a scenario where I thought it'd be "nice" to be able to inject...]]></description>
      <content:encoded><![CDATA[<p>When working with a customer, I found a scenario where I thought it'd be "nice" to be able to inject code around WCF service method calls in a totally transparent way that'd avoid having to add any imperative code to the service.&nbsp; The Unity&nbsp;from Enterprise Library&nbsp;(<a href="https://msdn.microsoft.com/en-us/library/ff663144.aspx">https://msdn.microsoft.com/en-us/library/ff663144.aspx)</a>&nbsp;came to mind.&nbsp; Now, while I know there are other methods of injecting behavior around WCF calls, I wanted to see if I could use Unity's inteface interception capabilities to add functionality around method calls.&nbsp; The particular scenario at hand was that I wanted to create a custom performance counters for each service method and update the performance counter with the execution time of the method upon completion.&nbsp; While I'm not a jedi master of either deep WCF scenarios nor of advanced performance counter application, I cobbled the following sample code together that makes it work.</p>
<p>The sample also illustrates how to hook into WCF internals, but that stuff is well documented elsewhere so I'll stay focused on the stuff that I found to be novel as I walk you through this <strong>SAMPLE</strong> code.</p>
<p><strong>Sample Service</strong></p>
<p>Nothing special.&nbsp; Here's the interface definition.</p>
<p><span style="font-family: courier new,courier;">using System;</span><br /><span style="font-family: courier new,courier;">using System.Collections.Generic;</span><br /><span style="font-family: courier new,courier;">using System.Linq;</span><br /><span style="font-family: courier new,courier;">using System.Runtime.Serialization;</span><br /><span style="font-family: courier new,courier;">using System.ServiceModel;</span><br /><span style="font-family: courier new,courier;">using System.Text;</span></p>
<p><span style="font-family: courier new,courier;">namespace Microsoft.Samples.DPE.WcfPerformanceCounters.Web</span><br /><span style="font-family: courier new,courier;">{</span><br /><span style="font-family: courier new,courier;">&nbsp;// NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "ISampleService" in both code and config file together.</span><br /><span style="font-family: courier new,courier;">&nbsp;[ServiceContract]</span><br /><span style="font-family: courier new,courier;">&nbsp;public interface ISampleService</span><br /><span style="font-family: courier new,courier;">&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;[OperationContract]</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;void DoWork();</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;[OperationContract]</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;void Cleanup();</span><br /><span style="font-family: courier new,courier;">&nbsp;}</span><br /><span style="font-family: courier new,courier;">}</span></p>
<p>Here's where things start to get interesting.&nbsp; The service implementation appears below.&nbsp; I'll explain it below the code itself:</p>
<p><span style="font-family: courier new,courier;">using System;</span><br /><span style="font-family: courier new,courier;">using System.Collections.Generic;</span><br /><span style="font-family: courier new,courier;">using System.Linq;</span><br /><span style="font-family: courier new,courier;">using System.Runtime.Serialization;</span><br /><span style="font-family: courier new,courier;">using System.ServiceModel;</span><br /><span style="font-family: courier new,courier;">using System.Text;</span></p>
<p><span style="font-family: courier new,courier;">using SampleFramework;</span><br /><span style="font-family: courier new,courier;">using SampleFramework.Diagnostics;</span></p>
<p><span style="font-family: courier new,courier;">namespace Microsoft.Samples.DPE.WcfPerformanceCounters.Web</span><br /><span style="font-family: courier new,courier;">{</span><br /><span style="font-family: courier new,courier;">&nbsp;[InterceptionBehavior(typeof(TrackMethodPerformanceBehavior))]</span><br /><span style="font-family: courier new,courier;">&nbsp;[UnityInstanceProvider(typeof(ISampleService), true)]</span><br /><span style="font-family: courier new,courier;">&nbsp;public class SampleService</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;: ISampleService</span><br /><span style="font-family: courier new,courier;">&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;#region Constructors</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;public SampleService()</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;#endregion</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;#region Methods</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;public void DoWork()</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;Random random = new Random();</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;var secondsToWait = random.Next(2000, 10000);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;System.Threading.Thread.Sleep(secondsToWait);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;public void Cleanup()</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;Random random = new Random();</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;var secondsToWait = random.Next(1000, 50000);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;System.Threading.Thread.Sleep(secondsToWait);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;#endregion</span><br /><span style="font-family: courier new,courier;">&nbsp;}</span><br /><span style="font-family: courier new,courier;">}</span></p>
<p>First, note that the method implementations just sleep for a random number of seconds to simulate variable execution times and to make our performance counter data interesting.&nbsp; Next, let's focus on the line "[UnityInstanceProvider(typeof(ISampleService), true)]".&nbsp; This line is our primary hook into WCF internals.&nbsp; It's definition appears below.&nbsp; The purpose of this attribute is to allow us to replace the IInstanceProvider (<a href="https://msdn.microsoft.com/en-us/library/system.servicemodel.dispatcher.iinstanceprovider.aspx">https://msdn.microsoft.com/en-us/library/system.servicemodel.dispatcher.iinstanceprovider.aspx)</a>&nbsp;in the WCF pipeline.&nbsp; The instance provider is the thing that actually goes about creating instances of the SampleService class when it's requested.&nbsp; It's within our custom instance provider that we'll place the code that allows us to intercept calls to the service methods.&nbsp; Again, the attribute definition is here:</p>
<p><span style="font-family: courier new,courier;">using System;</span><br /><span style="font-family: courier new,courier;">using System.Collections.Generic;</span><br /><span style="font-family: courier new,courier;">using System.Linq;</span><br /><span style="font-family: courier new,courier;">using System.Text;</span><br /><span style="font-family: courier new,courier;">using System.ServiceModel;</span><br /><span style="font-family: courier new,courier;">using System.ServiceModel.Dispatcher;</span><br /><span style="font-family: courier new,courier;">using System.ServiceModel.Description;</span><br /><span style="font-family: courier new,courier;">using System.Diagnostics.Contracts;</span></p>
<p><span style="font-family: courier new,courier;">using Yeast.Reflection;</span></p>
<p><span style="font-family: courier new,courier;">namespace SampleFramework</span><br /><span style="font-family: courier new,courier;">{</span><br /><span style="font-family: courier new,courier;">&nbsp;[AttributeUsage(AttributeTargets.Class)]</span><br /><span style="font-family: courier new,courier;">&nbsp;public class UnityInstanceProviderAttribute</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;: Attribute, IContractBehaviorAttribute, IContractBehavior</span><br /><span style="font-family: courier new,courier;">&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;#region Constructors</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;private UnityInstanceProviderAttribute()</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;public UnityInstanceProviderAttribute(Type targetContract, bool yieldsSingleton)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;Contract.Assume(targetContract != null);</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;TargetContract = targetContract;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;YieldsSingleton = yieldsSingleton;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;#endregion</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;#region Properties</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;public Type TargetContract</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;get;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;private set;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;public bool YieldsSingleton</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;get;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;private set;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;#endregion</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;#region Methods</span></p>
<p><span style="color: #ff0000;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;public void ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, DispatchRuntime dispatchRuntime)</span></strong></span><br /><span style="color: #ff0000;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span></strong></span><br /><span style="color: #ff0000;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;var providerGenericType = typeof(UnityInstanceProvider&lt;,&gt;);</span></strong></span><br /><span style="color: #ff0000;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;var providerConstructedType = providerGenericType.MakeGenericType(TargetContract, dispatchRuntime.Type);</span></strong></span><br /><span style="color: #ff0000;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;var provider = TypeFactory.CreateInstance(providerConstructedType) as IUnityInstanceProvider;</span></strong></span><br /><span style="color: #ff0000;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;provider.DispatchRuntime = dispatchRuntime;</span></strong></span><br /><span style="color: #ff0000;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;provider.YieldsSingleton = YieldsSingleton;</span></strong></span><br /><span style="color: #ff0000;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;dispatchRuntime.InstanceProvider = provider;</span></strong></span><br /><span style="color: #ff0000;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></strong></span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;public void AddBindingParameters(ContractDescription contractDescription, ServiceEndpoint endpoint, System.ServiceModel.Channels.BindingParameterCollection bindingParameters)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;public void ApplyClientBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, ClientRuntime clientRuntime)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;public void Validate(ContractDescription contractDescription, ServiceEndpoint endpoint)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;#endregion</span><br /><span style="font-family: courier new,courier;">&nbsp;}</span><br /><span style="font-family: courier new,courier;">}</span></p>
<p>The important point here is that we need access to the DispatchRuntime so that we can set the InstanceProvider property on it.&nbsp; I've done some monkey business with generics here so that I could take advantage of .NET type system so that I could have one IInstanceProvider type dynamically created for each service type I'm manipulating.&nbsp; This also allows me to use the new() operator when creating service instances as opposed to having to use Activator.&nbsp; Below you'll find the source code for the instance provider.&nbsp; This is where the magic happens and I invoke unity interception APIs:</p>
<p></p>
<p><span style="font-family: courier new,courier;">using System;</span><br /><span style="font-family: courier new,courier;">using System.Collections.Generic;</span><br /><span style="font-family: courier new,courier;">using System.Linq;</span><br /><span style="font-family: courier new,courier;">using System.Text;</span><br /><span style="font-family: courier new,courier;">using System.ServiceModel;</span><br /><span style="font-family: courier new,courier;">using System.ServiceModel.Description;</span><br /><span style="font-family: courier new,courier;">using System.ServiceModel.Dispatcher;</span><br /><span style="font-family: courier new,courier;">using System.ServiceModel.Channels;</span><br /><span style="font-family: courier new,courier;">using System.Diagnostics.Contracts;</span></p>
<p><span style="font-family: courier new,courier;">using Microsoft.Practices.Unity;</span><br /><span style="font-family: courier new,courier;">using Microsoft.Practices.Unity.ObjectBuilder;</span><br /><span style="font-family: courier new,courier;">using Microsoft.Practices.Unity.StaticFactory;</span><br /><span style="font-family: courier new,courier;">using Microsoft.Practices.Unity.Utility;</span><br /><span style="font-family: courier new,courier;">using Microsoft.Practices.Unity.InterceptionExtension;</span></p>
<p><span style="font-family: courier new,courier;">using Yeast;</span><br /><span style="font-family: courier new,courier;">using Yeast.Reflection;</span></p>
<p><span style="font-family: courier new,courier;">namespace SampleFramework</span><br /><span style="font-family: courier new,courier;">{</span><br /><span style="font-family: courier new,courier;">&nbsp;public class UnityInstanceProvider&lt;ContractType, ServiceType&gt;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;: IUnityInstanceProvider</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;where ServiceType : class, ContractType, new()</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;where ContractType : class</span><br /><span style="font-family: courier new,courier;">&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;#region Fields</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;private static object _singletonLockTarget = new object();</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;#endregion</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;#region Constructors</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;public UnityInstanceProvider()</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;#endregion</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;#region Properties</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;public static ContractType SingletonService</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;get;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;private set;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;public DispatchRuntime DispatchRuntime</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;get;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;set;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;public bool YieldsSingleton</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;get;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;set;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;#endregion</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;#region Methods</span></p>
<p><span style="color: #ff0000;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;public ContractType InstantiateService()</span></strong></span><br /><span style="color: #ff0000;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span></strong></span><br /><span style="color: #ff0000;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;var behaviors =</span></strong></span><br /><span style="color: #ff0000;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;(from attribute in typeof(ServiceType).GetAttributes&lt;InterceptionBehaviorAttribute&gt;(false)</span></strong></span><br /><span style="color: #ff0000;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp; let behavior = TypeFactory.CreateInstance(attribute.BehaviorType)</span></strong></span><br /><span style="color: #ff0000;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp; select behavior as IInterceptionBehavior).ToList();</span></strong></span><br />&nbsp;&nbsp;&nbsp;<br /><span style="color: #ff0000;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;var service = new ServiceType();</span></strong></span><br /><span style="color: #ff0000;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;var proxiedService = Intercept.ThroughProxy&lt;ContractType&gt;(</span></strong></span><br /><span style="color: #ff0000;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;service</span></strong></span><br /><span style="color: #ff0000;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;, new InterfaceInterceptor()</span></strong></span><br /><span style="color: #ff0000;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;, behaviors);</span></strong></span><br /><span style="color: #ff0000;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;return proxiedService;</span></strong></span><br /><span style="color: #ff0000;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></strong></span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;public object GetInstance(InstanceContext instanceContext, Message message)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;object instance;</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;if (YieldsSingleton)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;lock (_singletonLockTarget)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (SingletonService == null)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SingletonService = InstantiateService();</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;instance = SingletonService;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;}</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;}</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;else</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;instance = InstantiateService();</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;return instance;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;public object GetInstance(InstanceContext instanceContext)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;return GetInstance(instanceContext, null);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;public void ReleaseInstance(InstanceContext instanceContext, object instance)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;if (instance is IDisposable)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;(instance as IDisposable).Dispose();</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;}</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;#endregion</span><br /><span style="font-family: courier new,courier;">&nbsp;}</span><br /><span style="font-family: courier new,courier;">}</span></p>
<p>The most important method is the InstantiateService method that's called by the&nbsp;GetInstance method.&nbsp; It serves two key purposes:</p>
<ul>
<li>Looks for all InterceptionBehaviorAttribute instances that have been applied to the ServiceType.&nbsp; This extensibility point is reading the metadata applied to the service class via a lined of code that I have yet to explain.&nbsp; That is the [InterceptionBehavior(typeof(TrackMethodPerformanceBehavior))] attribute.&nbsp; This is another of my custom attributes and is not WCF related per se.&nbsp; It's basically hooking up the TrackMethodPerformanceBehavior class, which does the work of creating and using the performance counters that this whole exercise was really all about.</li>
<li>Creates an instance of the service class and calls the Unity method Intercept.ThroughProxy.&nbsp; The proxied service instance is returned <strong>instead</strong> of the raw service instance.&nbsp; This is "the main thing".</li>
</ul>
<p>The base interface, IUnityIntstanceProvider looks like this:</p>
<p><span style="font-family: courier new,courier;">using System;</span><br /><span style="font-family: courier new,courier;">using System.Collections.Generic;</span><br /><span style="font-family: courier new,courier;">using System.Linq;</span><br /><span style="font-family: courier new,courier;">using System.Text;</span><br /><span style="font-family: courier new,courier;">using System.ServiceModel;</span><br /><span style="font-family: courier new,courier;">using System.ServiceModel.Description;</span><br /><span style="font-family: courier new,courier;">using System.ServiceModel.Dispatcher;</span></p>
<p><span style="font-family: courier new,courier;">namespace SampleFramework</span><br /><span style="font-family: courier new,courier;">{</span><br /><span style="font-family: courier new,courier;">&nbsp;public interface IUnityInstanceProvider</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;: IInstanceProvider</span><br /><span style="font-family: courier new,courier;">&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;DispatchRuntime DispatchRuntime</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;get;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;set;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;bool YieldsSingleton</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;get;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;set;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span><br /><span style="font-family: courier new,courier;">&nbsp;}</span><br /><span style="font-family: courier new,courier;">}</span></p>
<p>This inteface is defined so that I can access the properties defined in non-generic code on instances of UnityInstanceProvider&lt;,&gt;.</p>
<p>Here's what the InterceptionBehaviorAttribute looks like.&nbsp; It's dead simple:</p>
<p><span style="font-family: courier new,courier;">using System;</span><br /><span style="font-family: courier new,courier;">using System.Collections.Generic;</span><br /><span style="font-family: courier new,courier;">using System.Linq;</span><br /><span style="font-family: courier new,courier;">using System.Text;</span><br /><span style="font-family: courier new,courier;">using System.Diagnostics.Contracts;</span></p>
<p><span style="font-family: courier new,courier;">using Microsoft.Practices.Unity.InterceptionExtension;</span></p>
<p><span style="font-family: courier new,courier;">namespace SampleFramework</span><br /><span style="font-family: courier new,courier;">{</span><br /><span style="font-family: courier new,courier;">&nbsp;[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]</span><br /><span style="font-family: courier new,courier;">&nbsp;public class InterceptionBehaviorAttribute</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;: Attribute</span><br /><span style="font-family: courier new,courier;">&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;#region Constructors</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;private InterceptionBehaviorAttribute()</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;public InterceptionBehaviorAttribute(Type behaviorType)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;Contract.Assume(behaviorType != null);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;Contract.Assume(typeof(IInterceptionBehavior).IsAssignableFrom(behaviorType));</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;BehaviorType = behaviorType;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;#endregion</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;#region Properties</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;public Type BehaviorType</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;get;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;private set;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;#endregion</span><br /><span style="font-family: courier new,courier;">&nbsp;}</span><br /><span style="font-family: courier new,courier;">}</span>&nbsp;</p>
<p>Next, I'll share the code for the TrackMethodPerformanceBehavior which implements the Unity IInterceptionBehavior interface so as to add the needed functionality&nbsp;before and after the method invocation:</p>
<p>&nbsp;<span style="font-family: courier new,courier;">using System;</span><br /><span style="font-family: courier new,courier;">using System.Collections.Generic;</span><br /><span style="font-family: courier new,courier;">using System.Linq;</span><br /><span style="font-family: courier new,courier;">using System.Text;</span><br /><span style="font-family: courier new,courier;">using System.ServiceModel;</span><br /><span style="font-family: courier new,courier;">using System.ServiceModel.Description;</span><br /><span style="font-family: courier new,courier;">using System.ServiceModel.Dispatcher;</span><br /><span style="font-family: courier new,courier;">using System.ServiceModel.Channels;</span><br /><span style="font-family: courier new,courier;">using System.Diagnostics.Contracts;</span><br /><span style="font-family: courier new,courier;">using System.Threading;</span></p>
<p><span style="font-family: courier new,courier;">using Microsoft.Practices.Unity;</span><br /><span style="font-family: courier new,courier;">using Microsoft.Practices.Unity.ObjectBuilder;</span><br /><span style="font-family: courier new,courier;">using Microsoft.Practices.Unity.StaticFactory;</span><br /><span style="font-family: courier new,courier;">using Microsoft.Practices.Unity.Utility;</span><br /><span style="font-family: courier new,courier;">using Microsoft.Practices.Unity.InterceptionExtension;</span></p>
<p><span style="font-family: courier new,courier;">using Yeast;</span><br /><span style="font-family: courier new,courier;">using Yeast.Reflection;</span><br /><span style="font-family: courier new,courier;">using Yeast.Threading;</span><br /><span style="font-family: courier new,courier;">using Yeast.Collections.Generic;</span></p>
<p><span style="font-family: courier new,courier;">namespace SampleFramework.Diagnostics</span><br /><span style="font-family: courier new,courier;">{</span><br /><span style="font-family: courier new,courier;">&nbsp;public class TrackMethodPerformanceBehavior</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;: IInterceptionBehavior</span><br /><span style="font-family: courier new,courier;">&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;#region Fields</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;private static ReaderWriterLockSlim _dictionaryLock = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;#endregion</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;#region Constructors</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;public TrackMethodPerformanceBehavior()</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;TypeCategoryMap = new Dictionary&lt;Type, IServiceContractPerformanceCategory&gt;();</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;#endregion</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;#region IInterceptionBehavior Members</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;public IEnumerable&lt;Type&gt; GetRequiredInterfaces()</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;return new List&lt;Type&gt;();</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><strong><span style="color: #ff0000; font-family: courier new,courier;">&nbsp;&nbsp;public IMethodReturn Invoke(IMethodInvocation input, GetNextInterceptionBehaviorDelegate getNext)</span></strong><br /><strong><span style="color: #ff0000; font-family: courier new,courier;">&nbsp;&nbsp;{</span></strong><br /><strong><span style="color: #ff0000; font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;IMethodReturn returnValue;</span></strong></p>
<p><strong><span style="color: #ff0000; font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;var beforeTime = DateTime.Now;</span></strong></p>
<p><strong><span style="color: #ff0000; font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;returnValue = getNext().Invoke(input, getNext);</span></strong></p>
<p><strong><span style="color: #ff0000; font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;var afterTime = DateTime.Now;</span></strong><br /><strong><span style="color: #ff0000; font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;var millisecondDelta = afterTime.Subtract(beforeTime).TotalMilliseconds;</span></strong><br /><strong><span style="color: #ff0000; font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;var category = this[input.Target.GetType()];</span></strong><br /><strong><span style="color: #ff0000; font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;var counter = category.MethodCounterMap[input.MethodBase];</span></strong><br /><strong><span style="color: #ff0000; font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;counter.RawValue = (int)millisecondDelta;</span></strong></p>
<p><strong><span style="color: #ff0000; font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;return returnValue;</span></strong><br /><strong><span style="color: #ff0000; font-family: courier new,courier;">&nbsp;&nbsp;}</span></strong></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;public bool WillExecute</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;get</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;return true;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;}</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp; public static Dictionary&lt;Type, IServiceContractPerformanceCategory&gt; TypeCategoryMap</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;get;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;private set;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;public IServiceContractPerformanceCategory this[Type serviceType]</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;get</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;IServiceContractPerformanceCategory category;</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;using (var readerLock = new UpgradeableReaderLockContext(_dictionaryLock))</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (!TypeCategoryMap.TryGetValue(serviceType, out category))</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;using (var writerLock = readerLock.GetWriterContext())</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (!TypeCategoryMap.TryGetValue(serviceType, out category))</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;category = ServiceContractPerformanceCategoryFactory.GetForContract(serviceType);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TypeCategoryMap.Add(serviceType, category);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;return category;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;}</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;#endregion</span><br /><span style="font-family: courier new,courier;">&nbsp;}</span><br /><span style="font-family: courier new,courier;">}</span></p>
<p>I've highlighted the important code in bold red.&nbsp; This method illustrates the raw power of unity to intercept method calls transparently so as to add code before and after method execution or even totally reimplement a method call.&nbsp; Tangentially, I'm using a Yeast class called UpgradeableReaderLockContext that I'll post a blog article about later.&nbsp; It provides an IDisposable-based wrapper around the ReaderWriterLockSlim class at makes for clean syntax.</p>
<p>Finally, I'll present the code that backs the expression <strong>ServiceContractPerformanceCategoryFactory.GetForContract(serviceType);</strong>.&nbsp; It's an ultra simple method that just does some reflection to create the constructed type that does the fun work:</p>
<p><span style="font-family: courier new,courier;">using System;</span><br /><span style="font-family: courier new,courier;">using System.Collections.Generic;</span><br /><span style="font-family: courier new,courier;">using System.Linq;</span><br /><span style="font-family: courier new,courier;">using System.Text;</span></p>
<p><span style="font-family: courier new,courier;">using Yeast.Reflection;</span></p>
<p><span style="font-family: courier new,courier;">namespace SampleFramework.Diagnostics</span><br /><span style="font-family: courier new,courier;">{</span><br /><span style="font-family: courier new,courier;">&nbsp;public static class ServiceContractPerformanceCategoryFactory</span><br /><span style="font-family: courier new,courier;">&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;public static IServiceContractPerformanceCategory GetForContract(Type contractType)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;var genericCategory = typeof(ServiceContractPerformanceCategory&lt;&gt;);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;var constructedCategory = genericCategory.MakeGenericType(contractType);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;var category = TypeFactory.CreateInstance(constructedCategory);</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;return category as IServiceContractPerformanceCategory;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span><br /><span style="font-family: courier new,courier;">&nbsp;}</span><br /><span style="font-family: courier new,courier;">}</span></p>
<p>The ServiceContractPerformanceCategory&lt;&gt; generic class is constructed using the WCF service type, instantiated, and returned.&nbsp; It does the bulk of the work.&nbsp; Note that, at this point in this blog article, I've already really demonstrated how to do the main point of the article which was to use Unity with WCF.&nbsp; The rest of this is interesting only insofar as you care about the code I used to dynamically create and use custom performance counters to instrument service methods.&nbsp; Here's the source for ServiceContractPerformanceCategory:</p>
<p><span style="font-family: courier new,courier;">using System;</span><br /><span style="font-family: courier new,courier;">using System.Collections.Generic;</span><br /><span style="font-family: courier new,courier;">using System.Linq;</span><br /><span style="font-family: courier new,courier;">using System.Text;</span><br /><span style="font-family: courier new,courier;">using System.ServiceModel;</span><br /><span style="font-family: courier new,courier;">using System.ServiceModel.Description;</span><br /><span style="font-family: courier new,courier;">using System.Reflection;</span><br /><span style="font-family: courier new,courier;">using System.Diagnostics.Contracts;</span><br /><span style="font-family: courier new,courier;">using System.Diagnostics;</span></p>
<p><span style="font-family: courier new,courier;">using Yeast.Reflection;</span></p>
<p><span style="font-family: courier new,courier;">namespace SampleFramework.Diagnostics</span><br /><span style="font-family: courier new,courier;">{</span><br /><span style="font-family: courier new,courier;">&nbsp;public class ServiceContractPerformanceCategory&lt;ServiceType&gt;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;: IServiceContractPerformanceCategory</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;where ServiceType : class</span><br /><span style="font-family: courier new,courier;">&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;#region Fields</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;private static Type _serviceTypeInstance;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;private static Type _contractTypeInstance;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;private static List&lt;MethodInfo&gt; _operations;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;private static Dictionary&lt;MethodBase, PerformanceCounter&gt; _methodCounterMap;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;private static PerformanceCounterCategory _category;</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;#endregion</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;#region Constructors &amp; Setup</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;static ServiceContractPerformanceCategory()</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;_serviceTypeInstance = typeof(ServiceType);</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;var serviceContractAttribute = _serviceTypeInstance.GetAttribute&lt;ServiceContractAttribute&gt;(false);</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;if (serviceContractAttribute == null)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;var serviceInterface =</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(from type in _serviceTypeInstance.GetInterfaces()</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; let attribute = type.GetAttribute&lt;ServiceContractAttribute&gt;(false)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; where attribute != null</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; select new { Type = type, Attribute = attribute }).FirstOrDefault();</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;if (serviceInterface == null)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw new Exception(String.Format("Could not find an interface implemented by {0} that is decorated with {1}.", _serviceTypeInstance, typeof(ServiceContractAttribute)));</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;serviceContractAttribute = serviceInterface.Attribute;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;_contractTypeInstance = serviceInterface.Type;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;}</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;else</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;_contractTypeInstance = _serviceTypeInstance;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;_operations =</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;(from operation in _contractTypeInstance.GetMethods(BindingFlags.Instance | BindingFlags.Public)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp; let operationContractAttribute = operation.GetAttribute&lt;OperationContractAttribute&gt;(false)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp; where operationContractAttribute != null</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp; select operation).ToList();</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;EnsureCreated();</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;_methodCounterMap = new Dictionary&lt;MethodBase, PerformanceCounter&gt;();</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;foreach (var operation in _operations)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;_methodCounterMap.Add(operation, new PerformanceCounter(PerformanceCategoryName, operation.Name, false));</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;}</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;public ServiceContractPerformanceCategory()</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;: this(true)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;public ServiceContractPerformanceCategory(bool shouldRecreate)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;if (shouldRecreate &amp;&amp; PerformanceCounterCategory.Exists(PerformanceCategoryName))</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;PerformanceCounterCategory.Delete(PerformanceCategoryName);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;EnsureCreated();</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;private static void EnsureCreated()</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;try</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;if (!PerformanceCounterCategory.Exists(PerformanceCategoryName))</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var creationData = new CounterCreationDataCollection();</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foreach (var operation in _operations)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;creationData.Add(new CounterCreationData()</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CounterType = PerformanceCounterType.NumberOfItems32,</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CounterName = operation.Name</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_category = PerformanceCounterCategory.Create(</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PerformanceCategoryName</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;, null</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;, PerformanceCounterCategoryType.SingleInstance</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;, creationData);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;}</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;else</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_category = new PerformanceCounterCategory(PerformanceCategoryName);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;}</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;}</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;catch (Exception exception)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;throw new Exception(String.Format("Failed to create performance category {0}.", PerformanceCategoryName), exception);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;}</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;#endregion</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;#region Properties</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;public static string PerformanceCategoryName</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;get</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;return _contractTypeInstance.Name;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;}</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;public Type ServiceTypeInstance</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;get</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;return _serviceTypeInstance;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;}</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;public Type ContractTypeInstance</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;get</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;return _contractTypeInstance;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;}</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;public List&lt;MethodInfo&gt; Operations</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;get</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;return _operations;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;}</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;public Dictionary&lt;MethodBase, PerformanceCounter&gt; MethodCounterMap</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;get</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;return _methodCounterMap;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;}</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;#endregion</span><br /><span style="font-family: courier new,courier;">&nbsp;}</span><br /><span style="font-family: courier new,courier;">}</span>&nbsp;</p>
<p><strong>Problem</strong></p>
<p>When running the sample application in a Windows Azure web role, I got an exception due to the fact that the service account that's used to run the application pool does not have sufficient permissions to&nbsp;write to the registry so as to create the performance counters.&nbsp; I now need to investigate how to&nbsp;configure things in Azure so that it will work properly there as well.&nbsp; My initial thought process is that I may need to use a startup task, but we'll see.&nbsp; Please provide any ideas you have there.</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Windows Azure blob download - Adding code that'll run before, during, and after</title>
      <link>https://docs.microsoft.com/archive/blogs/seendabean/windows-azure-blob-download-adding-code-thatll-run-before-during-and-after</link>
      <pubDate>Sat, 21 Jan 2012 15:39:00 GMT</pubDate>
      <dc:creator><![CDATA[SeanIanHale]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/seendabean/2012/01/21/windows-azure-blob-download-adding-code-thatll-run-before-during-and-after/</guid>
      <description><![CDATA[A customer posed a question to me around adding custom code that could run before, during, and after...]]></description>
      <content:encoded><![CDATA[<p>A customer posed a question to me around adding custom code that could run before, during, and after the download of a blob from Azure storage.The constraint I was given was that all of this code needed to run opaquely on the server side of the download and could not be something that a client downloading the file would be required to run.&nbsp; So, I set out to find an existing method to solve this problem but found none that really provided all of the control and flexibility that my customer wanted.&nbsp; As such, I went and invented one.&nbsp; This post will talk about how I solved the problem, a little bit about how I validated the solution against more mainstream blob download approaches, and the problems that I'm still left with.</p>
<p><strong>Goals</strong></p>
<ul>
<li>Expose a URL that an end user can click on that'll initiate a file download of a file stored in Azure blob storage</li>
<li>Ensure that any amount of security requirements can be enforced</li>
<li>Enable running custom code before, during, and after the file download to include writing progress information to a data store like SQL Azure or table storage</li>
<li>Support everything from tiny up to multi-gigabyte files</li>
<li>Provide performance on par with standard blob downloads</li>
</ul>
<p><strong>Approach</strong></p>
<p>I&rsquo;ve been examining four distinct download strategies and their performance characteristics across Tiny (&gt; 1MB), Small (~10MB), Medium (~200MB), and Gigantic file (~2.5GB) file sizes, implying four file size magnitudes.&nbsp; Each download strategy represents a different way of downloading a file from Azure blob storage.&nbsp; The strategies are:<br />&nbsp;<br />1.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Direct Download &ndash; Uses the direct Azure storage service URL and an ultra-simple HTTP file download mechanism<br />&nbsp;&nbsp;&nbsp; a.&nbsp;&nbsp;&nbsp; Consider this a good baseline measure<br />&nbsp;&nbsp;&nbsp; b.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Provides no ability to run code before, after, or during a file download<br />2.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; API Download &ndash; Uses the Azure storage APIs to download a file.&nbsp; This is fundamentally similar to a direct download call but is using owner-level permissions to access Azure storage<br />&nbsp;&nbsp;&nbsp; a.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Similar to a direct download, there is no ability to run server-side code before, after or during a file download<br />3.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Proxy Download &ndash; Leverages a web role that internally retrieves the blob stream from the blob storage service and proxies it through to the HTTP response stream.<br />&nbsp;&nbsp;&nbsp; a.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This makes all access to the storage service opaque and encapsulated into a custom HTTP handler that controls the entire download process<br />&nbsp;&nbsp;&nbsp; b.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Allows running code before, after, or during a file download<br />4.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Pass-through Download &ndash; Takes advantage of the Azure Shared Access Signature technology and essentially redirects the requestor to a URL that includes authentication information to ensure all downloads are secured<br />&nbsp;&nbsp;&nbsp; a.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Likely the best single solution to your storage problem.&nbsp; This solution minimizes overhead while retaining control over security<br />&nbsp;&nbsp;&nbsp; b.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Allows running code before *only* a blob download.&nbsp; This is because the HTTP response is an HTTP 302 redirection wherein the server relinquishes control once the download URL is transmitted<br />&nbsp;&nbsp;&nbsp; c.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This approach will tend to yield the greatest amount of consistency across file sizes<br />&nbsp;</p>
<p>To test how each of these perform with respect to one another, I created Visual Studio unit tests along with a set of Visual Studio load tests to see how they perform over time.&nbsp; The good news is that the Proxy strategy out performs other download strategies in 75% or more cases, where the pass-through strategy came generally in second (good news).&nbsp; Here are my statistics on average download times:</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/50/48/0160.AverageDownloadTimeStatistics.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-50-48/0160.AverageDownloadTimeStatistics.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/50/48/0160.AverageDownloadTimeStatistics.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-50-48/0160.AverageDownloadTimeStatistics.png" /></a></p>
<p>&nbsp;</p>
<p><strong>Problem</strong></p>
<p>There remains an issue that only occurs with supremely large files.&nbsp; That problem is that, since we are proxying the downloaded file through an Azure web role, there appears to be a timeout set somewhere (maybe on the load balancer???) that constrains downloads *of this strategy only* to about 30 minutes.&nbsp; As a result, files in excess of about 2GB will download in large part but have the potential to get aborted closer to the end of the download.&nbsp; This limitation, again, appears to be a network infrastructure issue and not specific to the download strategy.&nbsp; Can anyone verify the root cause of this for me?&nbsp; Are there any solutions in site?&nbsp; If you can solve this, you help me solve an important customer problem.</p>
<p>&nbsp;</p>
<p><strong>The Guts</strong></p>
<p>The main chunk of code that I used to implement the Proxy approach is a very simple HTTP handler that asynchronously reads buffers from blob storage.&nbsp; The code appears below.&nbsp; At first, I tried just using <span style="font-family: Consolas; font-size: x-small;" size="2" face="Consolas"><span style="font-family: Consolas; font-size: x-small;" size="2" face="Consolas"><span style="font-family: Consolas; font-size: x-small;" size="2" face="Consolas"></span></span></span></p>
<p><span style="font-family: courier new,courier;">blob.DownloadToStream(context.Response.OutputStream);</span>, but this would end out failing with anything other than small files since no content was showing up on the response stream for a long period of time (until the entire download was complete).&nbsp; That approach also yielded problems with causing the file download dialog to pop up.&nbsp; This approach of chunking the download works well.&nbsp; I even made the buffer size configurable via the query string for the purposes of this&nbsp;<span style="color: #ff0000;"><strong>SAMPLE</strong></span> code.</p>
<p></p>
<p><span style="font-family: courier new,courier;">using System;</span><br /><span style="font-family: courier new,courier;">using System.Collections.Generic;</span><br /><span style="font-family: courier new,courier;">using System.Linq;</span><br /><span style="font-family: courier new,courier;">using System.Web;</span><br /><span style="font-family: courier new,courier;">using System.Text;</span><br /><span style="font-family: courier new,courier;">using System.Text.RegularExpressions;</span><br /><span style="font-family: courier new,courier;">using System.IO;</span><br /><span style="font-family: courier new,courier;">using System.Threading;</span></p>
<p><span style="font-family: courier new,courier;">using Microsoft.WindowsAzure;</span><br /><span style="font-family: courier new,courier;">using Microsoft.WindowsAzure.StorageClient;</span><br /><span style="font-family: courier new,courier;">using Microsoft.WindowsAzure.ServiceRuntime;</span></p>
<p><span style="font-family: courier new,courier;">using Yeast;</span><br /><span style="font-family: courier new,courier;">using Yeast.Collections.Generic;</span><br /><span style="font-family: courier new,courier;">using Yeast.IO;</span></p>
<p><span style="font-family: courier new,courier;">namespace BlobProxy.Web</span><br /><span style="font-family: courier new,courier;">{</span><br /><span style="font-family: courier new,courier;">&nbsp;/// &lt;summary&gt;</span><br /><span style="font-family: courier new,courier;">&nbsp;/// Summary description for Download</span><br /><span style="font-family: courier new,courier;">&nbsp;/// &lt;/summary&gt;</span><br /><span style="font-family: courier new,courier;">&nbsp;public class Download</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;: IHttpHandler</span><br /><span style="font-family: courier new,courier;">&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;public void ProcessRequest(HttpContext context)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;try</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;var accountName = context.Request["accountName"];</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;var path = context.Request["path"];</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;int bufferSize;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;if (!Int32.TryParse(context.Request["bufferSize"], out bufferSize))</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bufferSize = 100 * 1024;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;if (accountName != Configuration.BlobProxySection.Instance.AccountName)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;context.Response.ContentType = "text/plain";</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;context.Response.Write(String.Format("I don't understand how to work with account name '{0}'.", accountName));</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;}</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;else</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var account = CloudStorageAccount.Parse(String.Format("DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1}", accountName, Configuration.BlobProxySection.Instance.AccountKey));</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var client = account.CreateCloudBlobClient();</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var pathExpression = new Regex("/(?&lt;containerName&gt;[^/]+)/(?&lt;blobPath&gt;.+)", RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.ExplicitCapture);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var pathMatch = pathExpression.Match(path);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var containerName = pathMatch.Groups["containerName"].Value;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var blobPath = pathMatch.Groups["blobPath"].Value;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var container = client.GetContainerReference(containerName);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var blob = container.GetBlobReference(blobPath);</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Exception downloadException = null;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bool isDataComplete = false;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var dataQueue = new BlockingQueue&lt;Tuple&lt;int, byte[]&gt;&gt;();</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var bufferQueue = new BlockingQueue&lt;byte[]&gt;();</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ThreadPool.QueueUserWorkItem(new WaitCallback(o =&gt;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var blobStream = blob.OpenRead();</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int blockLength = 0;</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;do</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;byte[] blockBuffer = null;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (bufferQueue.Count &gt; 0)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;blockBuffer = bufferQueue.Dequeue();</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;blockBuffer = new byte[bufferSize];</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;blockLength = blobStream.Read(blockBuffer, 0, blockBuffer.Length);</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (blockLength &gt; 0)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dataQueue.Enqueue(new Tuple&lt;int, byte[]&gt;(blockLength, blockBuffer));</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} while (blockLength &gt; 0);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;catch (Exception exception)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;downloadException = exception;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;finally</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;isDataComplete = true;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}));</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;blob.FetchAttributes();</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;context.Response.ContentType = "application/x-msdownload"; // blob.Properties.ContentType;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;context.Response.Buffer = false;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;context.Response.AddHeader("content-disposition", "attachment; filename=" + blobPath);</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while (context.Response.IsClientConnected &amp;&amp; (!isDataComplete || dataQueue.Count &gt; 0))</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (downloadException != null)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw new Exception("The internal blob download failed.", downloadException);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var data = dataQueue.Dequeue();</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;context.Response.OutputStream.Write(data.Item2, 0, data.Item1);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;context.Response.Flush();</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//Put the processed buffer back into the queue so as to minimize memory consumption</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bufferQueue.Enqueue(data.Item2);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;}</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;}</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;catch (Exception exception)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;context.Response.Write(String.Format("Failed to download file due to the exception:{0}{1}", Environment.NewLine, exception));</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;}</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;public bool IsReusable</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;get</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;return true;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;}</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;}</span><br /><span style="font-family: courier new,courier;">&nbsp;}</span><br /><span style="font-family: courier new,courier;">}</span></p>]]></content:encoded>
    </item>
    <item>
      <title>Yeast</title>
      <link>https://docs.microsoft.com/archive/blogs/seendabean/yeast</link>
      <pubDate>Sat, 21 Jan 2012 15:12:00 GMT</pubDate>
      <dc:creator><![CDATA[SeanIanHale]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/seendabean/2012/01/21/yeast/</guid>
      <description><![CDATA[Throughout my blog, you'll see references to code under the Yeast.* namespace.&nbsp; Yeast is the...]]></description>
      <content:encoded><![CDATA[<p>Throughout my blog, you'll see references to code under the Yeast.* namespace.&nbsp; Yeast is the name of a framework that I've created for my personal use over the years whose purpose is to solve problems for which i could not find a solution in the .NET base class libraries.&nbsp; As I blog, I'll make reference to content in the Yeast framework so as to clarify the code upon which my blog posts are based.&nbsp; Sometimes, I'll include just the class metadata if the blog post isn't really about the Yeast class but just uses it.&nbsp; In other cases, I'll include full source code if it is my intention to explain the Yeast class's capabilities themselves.</p>
<p>Now, the common question: "Why the heck is the framework called Yeast?"&nbsp; It's a metaphor for adding yeast to bread dough so that it'll rise.&nbsp; So, by adding Yeast to your software, you'll make it rise too.&nbsp; Nobody wants a flat app, now do they.&nbsp; Also, I do my very best not to compete with pre-existing or new solutions to problems and welcome having my Yeast code become obsolete because Microsoft has introduced a solution.&nbsp; As an example, the original version of this post introduced a class I called BlockingQueue&lt;T&gt; that implemented a thread safe producer-consumer queue.&nbsp; Thanks to that original post version Stephen Toub turned me on to BlockingCollection&lt;T&gt; which gives me exactly what I need.&nbsp; I'm ripping out BlockingQueue&lt;T&gt; from Yeast as we speak.&nbsp; For perpetuity sake, this is what BlockingQueue looks like.</p>
<p>using System;<br />using System.Collections;<br />using System.Collections.Generic;<br />using System.Threading;</p>
<p>namespace Yeast.Collections.Generic<br />{<br />&nbsp;// Summary:<br />&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp; Implements a queue which blocks all consumer threads if the queue is empty,<br />&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp; and signals any waiting consumers once data becomes available.<br />&nbsp;public class BlockingQueue&lt;T&gt; : IEnumerable&lt;T&gt;, IEnumerable<br />&nbsp;{<br />&nbsp;&nbsp;// Summary:<br />&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp; THe object used to ensure that the methods herein are thread safe.<br />&nbsp;&nbsp;public readonly object SyncRoot;</p>
<p>&nbsp;&nbsp;public BlockingQueue();<br />&nbsp;&nbsp;//<br />&nbsp;&nbsp;//<br />&nbsp;&nbsp;// Parameters:<br />&nbsp;&nbsp;//&nbsp;&nbsp; capacity:<br />&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp; The maximum capacity of the underlying queue.<br />&nbsp;&nbsp;//<br />&nbsp;&nbsp;// Exceptions:<br />&nbsp;&nbsp;//&nbsp;&nbsp; System.ArgumentException:<br />&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp; If the capacity specified is less than one, this constructor will fail.<br />&nbsp;&nbsp;public BlockingQueue(int capacity);</p>
<p>&nbsp;&nbsp;// Summary:<br />&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp; Gets the capacity of this instance as specified in the constructor.<br />&nbsp;&nbsp;public int Capacity { get; }<br />&nbsp;&nbsp;//<br />&nbsp;&nbsp;// Summary:<br />&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp; Gets the number of elements currently in the queue.<br />&nbsp;&nbsp;public int Count { get; }<br />&nbsp;&nbsp;//<br />&nbsp;&nbsp;// Summary:<br />&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp; Set when the queue has no elements in it.<br />&nbsp;&nbsp;public WaitHandle Empty { get; }<br />&nbsp;&nbsp;//<br />&nbsp;&nbsp;// Summary:<br />&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp; Set when the queue has reached it's Capacity.<br />&nbsp;&nbsp;public WaitHandle Full { get; }</p>
<p>&nbsp;&nbsp;// Summary:<br />&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp; Removes an element from the queue and returns it. This method will block<br />&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp; if the queue is empty and will unblock once an item has been enqueued.<br />&nbsp;&nbsp;//<br />&nbsp;&nbsp;// Returns:<br />&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp; An item of type T that is at the front of the queue.<br />&nbsp;&nbsp;public T Dequeue();<br />&nbsp;&nbsp;//<br />&nbsp;&nbsp;// Summary:<br />&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp; Adds an element to the back of the queue.<br />&nbsp;&nbsp;//<br />&nbsp;&nbsp;// Parameters:<br />&nbsp;&nbsp;//&nbsp;&nbsp; element:<br />&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp; The element to be added to the queue.<br />&nbsp;&nbsp;//<br />&nbsp;&nbsp;// Remarks:<br />&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp; If the queue is empty prior to this operation, the Empty event will be set.<br />&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If the queue reaches its capacity as a result of this operation, the Full<br />&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp; event will be set.<br />&nbsp;&nbsp;public void Enqueue(T element);<br />&nbsp;&nbsp;//<br />&nbsp;&nbsp;// Summary:<br />&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp; Implements an enumerator that internally calls Yeast.Collections.Generic.BlockingQueue&lt;T&gt;.Dequeue()<br />&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp; so as to yield the next elements in the queue.&nbsp; The resulting enumerator<br />&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp; will behave just as if Dequeue were called in a loop.<br />&nbsp;&nbsp;//<br />&nbsp;&nbsp;// Returns:<br />&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp; An enumerator that internally dequeues elements from the queue infinitely.<br />&nbsp;&nbsp;public IEnumerator&lt;T&gt; GetEnumerator();<br />&nbsp;}<br />}</p>]]></content:encoded>
    </item>
    <item>
      <title>Introductions</title>
      <link>https://docs.microsoft.com/archive/blogs/seendabean/introductions</link>
      <pubDate>Fri, 20 Jan 2012 19:15:00 GMT</pubDate>
      <dc:creator><![CDATA[SeanIanHale]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/seendabean/2012/01/20/introductions/</guid>
      <description><![CDATA[My name is Sean and I work at Microsoft.&nbsp; I'm a Sr. Architect Evangelist for Windows Azure...]]></description>
      <content:encoded><![CDATA[<p>My name is Sean and I work at Microsoft.&nbsp; I'm a Sr. Architect Evangelist for Windows Azure serving Cloud Service Vendors.&nbsp; As a kid, the spelling of my name and it's surprisingly common mispronunciation yielded a nickname that I decided I'd just go ahead and own.&nbsp; So, with a little imagination, you'll understand the name of my blog and the nickname it's based on.</p>
<p>As an adult, I've been oft been called everything from&nbsp;a Microsoft fan boy to a Microsoft zealot, depending on how much you like me =^).&nbsp; I'll own those labels too.&nbsp; Hopefully I'll live up to them.</p>
<p>Now, getting down to business: My plan is to blog about technology from Microsoft, my own inventions and discoveries, as well as the excellent and awful from the tech universe at large.&nbsp; Obviously, I spend a lot of my time focused on the Cloud, but I'll stray from there as it suits me to discuss what&nbsp;impassions me at the moment.</p>
<p>I look forward to your interest, ideas, and passion.</p>
<p>~Cheers</p>
<p>Sean</p>]]></content:encoded>
    </item>
  </channel>
</rss>