<?xml version="1.0" encoding="utf-8"?>
<feed xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom">
  <title>Program With .NET</title>
  <link rel="alternate" type="text/html" href="http://programwith.net/" />
  <link rel="self" href="http://programwith.net/SyndicationService.asmx/GetAtom" />
  <icon>favicon.ico</icon>
  <updated>2009-08-18T22:41:32.1314127-04:00</updated>
  <author>
    <name>Matt Casto</name>
  </author>
  <subtitle>Matt Casto's .NET Journal</subtitle>
  <id>http://programwith.net/</id>
  <generator uri="http://www.dasblog.net" version="2.0.7180.0">DasBlog</generator>
  <entry>
    <title>devLink 2009 Presentation Materials</title>
    <link rel="alternate" type="text/html" href="http://programwith.net/2009/08/19/devLink2009PresentationMaterials.aspx" />
    <id>http://programwith.net/PermaLink,guid,15600bc6-826a-4275-b272-1b7f231543b3.aspx</id>
    <published>2009-08-18T22:41:32.1314127-04:00</published>
    <updated>2009-08-18T22:41:32.1314127-04:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I’ve uploaded the power point slides and demo projects from my presentations at <a href="http://devlink.net" target="_blank">devLink
2009</a> to my <a href="http://cid-63a50a5c41970075.skydrive.live.com/home.aspx" target="_blank">Sky
Drive</a>. 
</p>
        <p>
          <a href="http://cid-63a50a5c41970075.skydrive.live.com/self.aspx/DevLink%202009/IntroRegex.zip" target="_blank">Introduction
to Regular Expressions</a>
        </p>
        <p>
Each of the examples in the slides have also been included as Regulator files. You
can get Regulator <a href="http://www.osherove.com/tools" target="_blank">here</a> and
see some of the Regular Expression resources I mentioned at <a href="http://del.icio.us/mattcasto/regex">http://del.icio.us/mattcasto/regex</a>. 
</p>
        <p>
          <a href="http://cid-63a50a5c41970075.skydrive.live.com/self.aspx/DevLink%202009/CreatingAppsUsingMVVM.zip" target="_blank">Creating
Applications using the Model-View-ViewModel Pattern</a>
        </p>
        <p>
The demonstration projects are organized into four folders – one for each step of
the demonstration. If you came to my talk and just want to see the finished project,
you should go straight to the fourth step. I only got through the first three steps,
so you might want to compare that with Step 4. 
</p>
        <p>
I hope everyone came away from my talks informed. If you have any feedback to give,
please feel free to do so at <a href="http://speakerrate.com/speakers/1427-matt-casto" target="_blank">Speaker
Rate</a>. 
</p>
        <p>
Thanks to John Kellar and crew who organized and volunteered for this truly one of
a kind community driven event. This year was even better than last and I feel honored
to be able to contribute. 
</p>
        <p>
Also, kudos to Alan Stevens for facilitating the best open spaces I’ve been to. For
some reason devLink seems to be the right environment for great discussions, and that’s
the biggest reason I’ll keep coming back for more.
</p>
        <img width="0" height="0" src="http://programwith.net/aggbug.ashx?id=15600bc6-826a-4275-b272-1b7f231543b3" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Pixel Shader Effects with Silverlight 3</title>
    <link rel="alternate" type="text/html" href="http://programwith.net/2009/07/17/PixelShaderEffectsWithSilverlight3.aspx" />
    <id>http://programwith.net/PermaLink,guid,6b49d0a8-b45b-4c49-813d-d28ccf1e8112.aspx</id>
    <published>2009-07-17T14:00:44.7016999-04:00</published>
    <updated>2009-07-17T14:00:44.7016999-04:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Pixel shaders, also known as shader effects, are a cool new feature the became available
with Silverlight 3. The two most common effects – drop shadow and blur – are included
with Silverlight. Its easy to add these effects to any UIElement.
</p>
        <p>
Lets build upon the simple form that was introduced in Jeff’s post <a href="http://jeffblankenburg.com/2009/07/day-10-styling-silverlight-controls.aspx" target="_blank">Day
#10: Styling Silverlight Controls</a>. We can add a drop shadow effect to the email
address textbox by changing the Page.xaml to look like this.
</p>
        <div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, 'Courier New', courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px">
          <div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">TextBox</span>
              <span style="color: #ff0000">x:Name</span>
              <span style="color: #0000ff">="Email"</span>
              <span style="color: #ff0000">Text</span>
              <span style="color: #0000ff">=""</span>
              <span style="color: #ff0000">Grid</span>.<span style="color: #ff0000">Row</span><span style="color: #0000ff">="4"</span><span style="color: #ff0000">Style</span><span style="color: #0000ff">="{StaticResource
TextBox}"</span><span style="color: #0000ff">&gt;</span></pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">TextBox.Effect</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">DropShadowEffect</span>
              <span style="color: #ff0000">ShadowDepth</span>
              <span style="color: #0000ff">="2"</span>
              <span style="color: #ff0000">BlurRadius</span>
              <span style="color: #0000ff">="3"</span>
              <span style="color: #ff0000">Direction</span>
              <span style="color: #0000ff">="300"</span>
              <span style="color: #0000ff">/&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">&lt;/</span>
              <span style="color: #800000">TextBox.Effect</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">&lt;/</span>
              <span style="color: #800000">TextBox</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
          </div>
        </div>
        <p>
 
</p>
        <p>
Running the application will show the drop shadow effect has been applied to the textbox.
</p>
        <p>
          <img title="PixelShaders_1" border="0" alt="PixelShaders_1" src="images/PixelShaders_1.png" />
        </p>
        <p>
You can adjust the ShadowDepth, BlurRadius and Direction dependency properties to
change the way the effect is rendered. For instance, if we change all of these values
to be 10 we end up with this.
</p>
        <p>
          <img title="PixelShaders_2" border="0" alt="PixelShaders_2" src="images/PixelShaders_2.png" />
        </p>
        <p>
Let's also change the Page.xaml.cs code behind to set a Blur effect on the submit
button while the Mailer service is being called.
</p>
        <div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, 'Courier New', courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px">
          <div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">void</span> Clicky_Click(<span style="color: #0000ff">object</span> sender,
RoutedEventArgs e)</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">{</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">if</span> (Email.Text
== <span style="color: #006080">""</span>){</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        Email.Focus();</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    }</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">else</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        MailerReference.MailerSoapClient mailerClient = <span style="color: #0000ff">new</span> MailerReference.MailerSoapClient();</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        mailerClient.SendMailCompleted += <span style="color: #0000ff">new</span> EventHandler&lt;SilverlightStyling.MailerReference.SendMailCompletedEventArgs&gt;(mailerClient_SendMailCompleted);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">string</span> name
= FirstName.Text.ToString() + <span style="color: #006080">" "</span> + LastName.Text.ToString();</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">string</span> body
= FirstName.Text.ToString() + <span style="color: #006080">"\n"</span> + LastName.Text.ToString()
+ <span style="color: #006080">"\n"</span> + Address.Text.ToString() + <span style="color: #006080">"\n"</span> +
CityStateZip.Text.ToString();</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        mailerClient.SendMailAsync(<span style="color: #006080">"jeff@jeffblankenburg.com"</span>,
Email.Text.ToString(), name, body);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"> </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        Clicky.Effect = <span style="color: #0000ff">new</span> System.Windows.Media.Effects.BlurEffect
{ Radius = 3 };</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    }</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">}</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"> </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">void</span> mailerClient_SendMailCompleted(<span style="color: #0000ff">object</span> sender,
SilverlightStyling.MailerReference.SendMailCompletedEventArgs e)</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">{</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    Clicky.Content = <span style="color: #006080">"Sent!"</span>;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    Clicky.IsEnabled = <span style="color: #0000ff">false</span>;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    Clicky.Effect = <span style="color: #0000ff">null</span>;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">}</pre>
          </div>
        </div>
        <p>
Run the application now and click Submit after filling in an email address and you’ll
see the button get blurry until the service call has completed.
</p>
        <p>
Pixel shaders modify the pixels before they’re rendered to display. This takes place
at runtime and doesn’t use hardware acceleration at this point, so don’t expect these
effects to be the most performant.
</p>
        <h4>Adding Your Own Shader
</h4>
        <p>
You can create your own pixel shaders using <a href="http://msdn.microsoft.com/en-us/library/bb509561(VS.85).aspx" target="_blank">High-Level
Shading Language</a> (HLSL) compiled with the <a href="http://www.microsoft.com/downloads/details.aspx?familyid=5493F76A-6D37-478D-BA17-28B1CCA4865A&amp;displaylang=en" target="_blank">DirectX
SDK</a>. Or you can download the <a href="http://blog.wpfwonderland.com/2008/10/08/shazzam-wpf-pixel-shader-effect-testing-tool-now-available/" target="_blank">Shazzam</a> application
to create, test and debug your pixel shader. Shazzam was created for WPF but all of
these effects should work in Silverlight as well. Note that you’ll need the DirectX
SDK installed first.
</p>
        <p>
I pulled the Invert Color sample from Shazzam’s Shader Loader samples into the project
by selecting Tools-&gt;View Compiled Shaders, copying the file (InvertColor.ps) and
pasting it into the SilverlightStyling project. Also, I made sure the build action
for the file is set to Resource. I then created a class to load the InvertColor.ps
file.
</p>
        <div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, 'Courier New', courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px">
          <div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">using</span> System;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">using</span> System.Windows.Media.Effects;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"> </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">namespace</span> SilverlightStyling</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">{</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">class</span> InvertColor
: ShaderEffect</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">public</span> InvertColor()</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            var uri = <span style="color: #0000ff">new</span> Uri(<span style="color: #006080">@"/SilverlightStyling;component/InvertColor.ps"</span>,
UriKind.Relative);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            PixelShader = <span style="color: #0000ff">new</span> PixelShader
{ UriSource = uri };</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        }</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    }</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">}</pre>
          </div>
        </div>
        <p>
Then I applied the shader to the entire form by adding the effect to the LayoutRoot
grid element.
</p>
        <div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, 'Courier New', courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px">
          <div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">UserControl</span>
              <span style="color: #ff0000">x:Class</span>
              <span style="color: #0000ff">="SilverlightStyling.Page"</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #ff0000">xmlns</span>
              <span style="color: #0000ff">="http://schemas.microsoft.com/winfx/2006/xaml/presentation"</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #ff0000">xmlns:x</span>
              <span style="color: #0000ff">="http://schemas.microsoft.com/winfx/2006/xaml"</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #ff0000">xmlns:SilverlightStyling</span>
              <span style="color: #0000ff">="clr-namespace:SilverlightStyling"</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #ff0000">Width</span>
              <span style="color: #0000ff">="400"</span>
              <span style="color: #ff0000">Height</span>
              <span style="color: #0000ff">="300"</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">Grid</span>
              <span style="color: #ff0000">x:Name</span>
              <span style="color: #0000ff">="LayoutRoot"</span>
              <span style="color: #ff0000">Background</span>
              <span style="color: #0000ff">="White"</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">Grid.Effect</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">SilverlightStyling:InvertColor</span>
              <span style="color: #0000ff">/&gt;</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #0000ff">&lt;/</span>
              <span style="color: #800000">Grid.Effect</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
          </div>
        </div>
        <p>
Now our entire form has a beautiful effect.
</p>
        <p>
          <img title="PixelShaders_3" border="0" alt="PixelShaders_3" src="images/PixelShaders_3.png" />
        </p>
        <p>
There are a lot more pixel shaders available from the <a href="http://wpffx.codeplex.com/" target="_blank">Windows
Presentation Foundation Pixel Shader Effects Library</a> CodePlex project which was
updated recently to work with Silverlight 3.
</p>
        <p>
          <a href="PixelShaders/SilverlightStyling_PixelShaders.zip" target="_blank">The modified
project file can be downloaded here.</a>
        </p>
        <img width="0" height="0" src="http://programwith.net/aggbug.ashx?id=6b49d0a8-b45b-4c49-813d-d28ccf1e8112" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Central Ohio Day of .NET Slides</title>
    <link rel="alternate" type="text/html" href="http://programwith.net/2009/04/19/CentralOhioDayOfNETSlides.aspx" />
    <id>http://programwith.net/PermaLink,guid,f5c5ea29-9189-4575-b8f5-ab1c0ad62cd0.aspx</id>
    <published>2009-04-19T17:05:41.8925537-04:00</published>
    <updated>2009-04-19T17:08:08.7169199-04:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://www.cinnug.org/cododn">
            <img style="border-bottom-style: none; border-right-style: none; display: inline; border-top-style: none; margin-left: 0px; border-left-style: none; margin-right: 0px" border="0" align="right" src="http://www.cinnug.org/images/cododn2009Badge.gif" />
          </a>
        </p>
        <p>
The demo projects and slides from my presentation at the <a href="http://cinnug.org/cododn/" target="_blank">Central
Ohio Day of .NET</a> are now posted to my <a href="http://cid-63a50a5c41970075.skydrive.live.com/home.aspx" target="_blank">Sky
Drive</a>.
</p>
        <p>
          <a href="https://cid-63a50a5c41970075.skydrive.live.com/browse.aspx/CODODN%202009" target="_blank">Creating
Applications using the Model-View-ViewModel Pattern</a>
        </p>
        <p>
 
</p>
        <p>
The demonstration projects are organized into four folders – one for each step of
the demonstration. If you came to my talk and just want to see the finished project,
you should go straight to the fourth step.
</p>
        <p>
Each step folder has the WPF and Silverlight versions in their own folders as well.
</p>
        <p>
I hope everyone enjoyed the talk. If you have any feedback to give, please feel free
to do so at <a href="http://speakerrate.com/talks/644-creating-appliicatons-using-the-model-view-viewmodel-pattern" target="_blank">Speaker
Rate</a>.
</p>
        <p>
Thanks to everyone who organized and volunteered for this great community driven event.
It was a blast again this year!
</p>
        <img width="0" height="0" src="http://programwith.net/aggbug.ashx?id=f5c5ea29-9189-4575-b8f5-ab1c0ad62cd0" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Silverlight 3 &amp;ndash; Deep Linking</title>
    <link rel="alternate" type="text/html" href="http://programwith.net/2009/03/23/Silverlight3NdashDeepLinking.aspx" />
    <id>http://programwith.net/PermaLink,guid,31941008-466d-4308-a7e8-25d246dcf961.aspx</id>
    <published>2009-03-23T01:11:13.207-04:00</published>
    <updated>2009-03-23T01:34:29.0618969-04:00</updated>
    <category term="silverlight" label="silverlight" scheme="http://programwith.net/CategoryView,category,silverlight.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
This is part 1 of my <a href="http://programwith.net/2009/03/23/Silverlight3FeatureByFeature.aspx" target="_blank">Silverlight
3 Feature By Feature</a> series of blog posts.
</p>
        <h4>No More Blank Slate
</h4>
        <p align="left">
The first thing you may try after installing the <a href="http://silverlight.net/getstarted/silverlight3/default.aspx" target="_blank">Silverlight
3 Beta 1 Tools</a> is creating a new Silverlight application. There is a new project
template available called <strong>Silverlight Navigation Application</strong>. Using
this project template creates a Silverlight project with a few things already set
up for you. This is a departure from what we've had so far - a blank slate that is
intimidating and doesn't really help new developers.
</p>
        <p align="left">
The new project contains the typical App.xaml but now with a bunch styles used in
the main page. The MainPage.xaml is a generic, but nice looking, layout for an example
Silverlight application. There are links to the Home and About views, which are both
located in the Views folder of the project along with a view reserved for errors.
</p>
        <p>
          <img style="border-width: 0px; margin: 0px; display: inline;" title="SilverlightNavApp_SlnExpl" alt="SilverlightNavApp_SlnExpl" src="http://programwith.net/images/SilverlightNavApp_SlnExpl.jpg" border="0" />
        </p>
        <p>
Running the application without any changes shows the full page Silverlight application.
Click on the links will change the URL in your browser and update the browsing history.
You can use these URLs to go to a specific view. For example, from the About view
copy the URL, then open an alternative browser and paste in the URL. Viola! Deep linking!
</p>
        <p>
          <img style="border-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto;" title="SilverlightNavApp_FirstRun" alt="SilverlightNavApp_FirstRun" src="http://programwith.net/images/SilverlightNavApp_FirstRun.jpg" border="0" />
        </p>
        <h4>How It Works
</h4>
        <p>
The trick to the navigation, as implemented in the project template, is the <strong>Frame</strong> control
in MainPage.xaml.
</p>
        <div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; line-height: 12pt; background-color: rgb(244, 244, 244); width: 97.5%; font-family: consolas,'Courier New',courier,monospace; max-height: 200px; font-size: 8pt; cursor: text;">
          <div style="border-style: none; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 1:</span>
              <span style="color: rgb(0, 0, 255);">&lt;</span>
              <span style="color: rgb(128, 0, 0);">UserControl</span>
              <span style="color: rgb(255, 0, 0);">x:Class</span>
              <span style="color: rgb(0, 0, 255);">="SilverlightNavigation.MainPage"</span>
            </pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 2:</span>
              <span style="color: rgb(255, 0, 0);">xmlns</span>
              <span style="color: rgb(0, 0, 255);">="http://schemas.microsoft.com/winfx/2006/xaml/presentation"</span>
            </pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 3:</span>
              <span style="color: rgb(255, 0, 0);">xmlns:x</span>
              <span style="color: rgb(0, 0, 255);">="http://schemas.microsoft.com/winfx/2006/xaml"</span>
            </pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 4:</span>
              <span style="color: rgb(255, 0, 0);">xmlns:navigation</span>
              <span style="color: rgb(0, 0, 255);">="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"</span>
              <span style="color: rgb(0, 0, 255);">&gt;</span>
            </pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 5:</span> ...</pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 6:</span>
              <span style="color: rgb(0, 0, 255);">&lt;</span>
              <span style="color: rgb(128, 0, 0);">navigation:Frame</span>
              <span style="color: rgb(255, 0, 0);">x:Name</span>
              <span style="color: rgb(0, 0, 255);">="Frame"</span>
              <span style="color: rgb(255, 0, 0);">Source</span>
              <span style="color: rgb(0, 0, 255);">="/Views/HomePage.xaml"</span>
            </pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 7:</span>
              <span style="color: rgb(255, 0, 0);">HorizontalContentAlignment</span>
              <span style="color: rgb(0, 0, 255);">="Stretch"</span>
            </pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 8:</span>
              <span style="color: rgb(255, 0, 0);">VerticalContentAlignment</span>
              <span style="color: rgb(0, 0, 255);">="Stretch"</span>
            </pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 9:</span>
              <span style="color: rgb(255, 0, 0);">Padding</span>
              <span style="color: rgb(0, 0, 255);">="15,10,15,10"</span>
            </pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 10:</span>
              <span style="color: rgb(255, 0, 0);">Background</span>
              <span style="color: rgb(0, 0, 255);">="White"</span>
              <span style="color: rgb(0, 0, 255);">/&gt;</span>
            </pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 11:</span> ...</pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 12:</span>
              <span style="color: rgb(0, 0, 255);">&lt;/</span>
              <span style="color: rgb(128, 0, 0);">UserControl</span>
              <span style="color: rgb(0, 0, 255);">&gt;</span>
            </pre>
          </div>
        </div>
        <p>
In particular, notice the navigation namespace. The project has a reference to the <strong>System.Windows.Controls.Navigation</strong> assembly
which contains new controls and other things used for navigation.
</p>
        <p>
The Frame is instructed to navigate in the Click event handler of the buttons.
</p>
        <div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; line-height: 12pt; background-color: rgb(244, 244, 244); width: 97.5%; font-family: consolas,'Courier New',courier,monospace; max-height: 200px; font-size: 8pt; cursor: text;">
          <div style="border-style: none; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 1:</span>
              <span style="color: rgb(0, 0, 255);">private</span>
              <span style="color: rgb(0, 0, 255);">void</span> NavButton_Click(<span style="color: rgb(0, 0, 255);">object</span> sender,
RoutedEventArgs e)</pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 2:</span> {</pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 3:</span> Button
navigationButton = sender <span style="color: rgb(0, 0, 255);">as</span> Button;</pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 4:</span> String
goToPage = navigationButton.Tag.ToString();</pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 5:</span>
              <span style="color: rgb(0, 0, 255);">this</span>.Frame.Navigate(<span style="color: rgb(0, 0, 255);">new</span> Uri(goToPage,
UriKind.Relative));</pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 6:</span> }</pre>
          </div>
        </div>
        <p>
I don’t exactly like the method of storing the destination page in the buttons’ Tag
property, but that could easily be encapsulated by a custom NavigationButton control.
Perhaps we’ll get one before RTW? I’ll definitely have to expand on this in a separate
blog post.
</p>
        <p>
HomePage.xaml and AboutPage.xaml are both <strong>Page</strong> objects instead of
UserControl, which is typically the base control of new XAML files in a Silverlight
2 project. Its easy enough to add new navigable content to your application. Just
add a new item to your project, and choose the <strong>Silverlight Page</strong> template
in the <strong>Add New Item</strong> dialog.
</p>
        <h4>Custom Navigation
</h4>
        <p>
What I wanted to do with my <a href="http://silverlightoverview.codeplex.com/" target="_blank">Silverlight
Overview</a> application was have a tree view control listing all of the examples,
and each of these example pages showing up as a unique URL so I could link to a specific
example. My original Silverlight Demo application had examples split into tab controls.
Each tab was a separate XAML file. I could have modified these to be a Page instead
of UserControl, but I wanted to break them down further and didn’t relish the thought
of having 30+ Page files.
</p>
        <p>
Using <a href="http://www.red-gate.com/products/reflector/" target="_blank">Reflector</a>,
I found that the Frame control’s Navigate method is using the NavigationService. Looking
into this code wasn’t leading me anywhere so I decided to look at the <a href="http://msdn.microsoft.com/en-us/library/cc838158%28VS.96%29.aspx" target="_blank">Silverlight
3</a> documentation on MSDN. Interestingly, the only page that I found related to
navigation, <a href="http://msdn.microsoft.com/en-us/library/cc838245%28VS.96%29.aspx" target="_blank">Navigation
Overview</a>, hasn’t been updated for Silverlight 3 and contains incorrect information.
Finally I found Tim Heuer’s <a href="http://silverlight.net/learn/learnvideo.aspx?video=187319" target="_blank">Navigation
Framework screencast</a> and <a href="http://timheuer.com/blog/archive/2009/03/22/silverlight-navigation-framework-and-uri-routing.aspx" target="_blank">blog
post</a> which shows how to use the <strong>UriMapper </strong>to accomplish what
I’m looking for.
</p>
        <div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; line-height: 12pt; background-color: rgb(244, 244, 244); width: 97.5%; font-family: consolas,'Courier New',courier,monospace; max-height: 200px; font-size: 8pt; cursor: text;">
          <div style="border-style: none; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(0, 0, 255);">&lt;</span>
              <span style="color: rgb(128, 0, 0);">nav:UriMapper</span>
              <span style="color: rgb(255, 0, 0);">x:Key</span>
              <span style="color: rgb(0, 0, 255);">="uriMapper"</span>
              <span style="color: rgb(0, 0, 255);">&gt;</span>
            </pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(0, 0, 255);">&lt;</span>
              <span style="color: rgb(128, 0, 0);">nav:UriMapping</span>
              <span style="color: rgb(255, 0, 0);">Uri</span>
              <span style="color: rgb(0, 0, 255);">="Examples/{example}"</span>
              <span style="color: rgb(255, 0, 0);">MappedUri</span>
              <span style="color: rgb(0, 0, 255);">="/ExamplePage.xaml?example={example}"</span>
              <span style="color: rgb(0, 0, 255);">/&gt;</span>
            </pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(0, 0, 255);">&lt;/</span>
              <span style="color: rgb(128, 0, 0);">nav:UriMapper</span>
              <span style="color: rgb(0, 0, 255);">&gt;</span>
            </pre>
          </div>
        </div>
        <p>
Currently the UriMapper can only be defined in the App.xaml. Hopefully we’ll be able
to move this to resource dictionary or even the same file as the Frame control.
</p>
        <p>
Along with my changes to the App.xaml I added one Page to my project, ExamplePage.xaml.
</p>
        <div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; line-height: 12pt; background-color: rgb(244, 244, 244); width: 97.5%; font-family: consolas,'Courier New',courier,monospace; max-height: 200px; font-size: 8pt; cursor: text;">
          <div style="border-style: none; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(0, 0, 255);">&lt;</span>
              <span style="color: rgb(128, 0, 0);">navigation:Page</span>
              <span style="color: rgb(255, 0, 0);">x:Class</span>
              <span style="color: rgb(0, 0, 255);">="SilverlightOverview.ExamplePage"</span>
            </pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(255, 0, 0);">xmlns</span>
              <span style="color: rgb(0, 0, 255);">="http://schemas.microsoft.com/winfx/2006/xaml/presentation"</span>
            </pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(255, 0, 0);">xmlns:x</span>
              <span style="color: rgb(0, 0, 255);">="http://schemas.microsoft.com/winfx/2006/xaml"</span>
            </pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(255, 0, 0);">xmlns:navigation</span>
              <span style="color: rgb(0, 0, 255);">="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"</span>
            </pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(255, 0, 0);">Title</span>
              <span style="color: rgb(0, 0, 255);">="Example
Page"</span>
            </pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(255, 0, 0);">xmlns:slo</span>
              <span style="color: rgb(0, 0, 255);">="clr-namespace:SilverlightOverview"</span>
            </pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(255, 0, 0);">Loaded</span>
              <span style="color: rgb(0, 0, 255);">="Page_Loaded"</span>
              <span style="color: rgb(0, 0, 255);">&gt;</span>
            </pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(0, 0, 255);">&lt;</span>
              <span style="color: rgb(128, 0, 0);">Grid</span>
              <span style="color: rgb(255, 0, 0);">x:Name</span>
              <span style="color: rgb(0, 0, 255);">="LayoutRoot"</span>
              <span style="color: rgb(255, 0, 0);">Background</span>
              <span style="color: rgb(0, 0, 255);">="White"</span>
              <span style="color: rgb(0, 0, 255);">&gt;</span>
            </pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(0, 0, 255);">&lt;</span>
              <span style="color: rgb(128, 0, 0);">slo:XamlViewer</span>
              <span style="color: rgb(255, 0, 0);">x:Name</span>
              <span style="color: rgb(0, 0, 255);">="viewer"</span>
              <span style="color: rgb(0, 0, 255);">/&gt;</span>
            </pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(0, 0, 255);">&lt;/</span>
              <span style="color: rgb(128, 0, 0);">Grid</span>
              <span style="color: rgb(0, 0, 255);">&gt;</span>
            </pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(0, 0, 255);">&lt;/</span>
              <span style="color: rgb(128, 0, 0);">navigation:Page</span>
              <span style="color: rgb(0, 0, 255);">&gt;</span>
            </pre>
          </div>
        </div>
        <div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; line-height: 12pt; background-color: rgb(244, 244, 244); width: 97.5%; font-family: consolas,'Courier New',courier,monospace; max-height: 200px; font-size: 8pt; cursor: text;">
          <div style="border-style: none; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 1:</span>
              <span style="color: rgb(0, 0, 255);">public</span>
              <span style="color: rgb(0, 0, 255);">partial</span>
              <span style="color: rgb(0, 0, 255);">class</span> ExamplePage</pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 2:</span> {</pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 3:</span>
              <span style="color: rgb(0, 0, 255);">public</span> ExamplePage()</pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 4:</span> {</pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 5:</span> InitializeComponent();</pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 6:</span> }</pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 7:</span>  </pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 8:</span>
              <span style="color: rgb(0, 0, 255);">private</span>
              <span style="color: rgb(0, 0, 255);">void</span> Page_Loaded(<span style="color: rgb(0, 0, 255);">object</span> sender,
RoutedEventArgs e)</pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 9:</span> {</pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 10:</span>
              <span style="color: rgb(0, 0, 255);">if</span> (<span style="color: rgb(0, 0, 255);">this</span>.NavigationContext.QueryString[<span style="color: rgb(0, 96, 128);">"example"</span>]
!= <span style="color: rgb(0, 0, 255);">null</span>)</pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 11:</span> {</pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 12:</span> viewer.XamlFilename
= <span style="color: rgb(0, 0, 255);">string</span>.Format(<span style="color: rgb(0, 96, 128);">"SilverlightOverview.Xaml.{0}.xaml"</span>,</pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 13:</span>
              <span style="color: rgb(0, 0, 255);">this</span>.NavigationContext.QueryString[<span style="color: rgb(0, 96, 128);">"example"</span>]);</pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 14:</span> }</pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 15:</span> }</pre>
            <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">
              <span style="color: rgb(96, 96, 96);"> 16:</span> }</pre>
          </div>
        </div>
        <p>
Running the project shows that my URLs to look like this.
</p>
        <p>
          <img style="border-width: 0px; display: inline; margin-left: 0px; margin-right: 0px;" title="SilverlightNavApp_URL" alt="SilverlightNavApp_URL" src="http://programwith.net/images/SilverlightNavApp_URL.jpg" border="0" />
        </p>
        <p>
You can even <a href="http://programwith.net/SilverlightOverview/Default.html#Examples/RotateTransform" target="_blank">try
it for yourself</a> if you have the <a href="http://silverlight.net/getstarted/silverlight3/default.aspx" target="_blank">Silverlight
3 Beta 1</a> runtime installed.
</p>
        <p>
I really wanted to avoid the “Examples/” part of the URL since I only have one view,
but there is a limitation built in which throws exceptions if I don’t have at least
a something in there.
</p>
        <p>
At this point all I had to do was add a TreeView and Frame to a Grid in my MainPage.xaml,
bind the tree to a static list of example data, and my application is running. I’d
like to figure out a way to dynamically change the page’s title, but I ran out of
time. At first glace it appears that the only place to do this is from within the
Page control, but I bet there’s way to get the currently displayed page from the Frame.
</p>
        <p>
You can view the <a href="http://programwith.net/SilverlightOverview/Default.html" target="_blank">Silverlight
Overview application here</a>. At the time of writing this blog post, the deep linking
is the only Silverlight 3 feature that’s been added.
</p>
        <h4>Summary
</h4>
        <p>
          <strong>The Good</strong>:  The Navigation Framework is a really great addition
to Silverlight!
</p>
        <p>
          <strong>The Bad</strong>:  I’d rather be able to manually add items to the browser
history and display pages based on the URL, but this solution will be fine for now.
I think there might be a way to do that, but I could not find any other documentation
and I ran out of time to look through everything with Reflector.
</p>
        <p>
          <strong>The Beautiful:</strong>  I finally have something to point to when Flash
developers ask what Silverlight has to offer that Flash/Flex does’t.
</p>
        <p>
          <em>(note – I wanted to summarize with the good, the bad and the ugly, but there’s
nothing truly ugly about Silverlight 3 so I went with the opposite)</em>
        </p>
        <img width="0" height="0" src="http://programwith.net/aggbug.ashx?id=31941008-466d-4308-a7e8-25d246dcf961" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Silverlight 3 Feature By Feature</title>
    <link rel="alternate" type="text/html" href="http://programwith.net/2009/03/23/Silverlight3FeatureByFeature.aspx" />
    <id>http://programwith.net/PermaLink,guid,dca5f26d-6b42-4966-936b-33e10cc55bbb.aspx</id>
    <published>2009-03-23T01:06:23.339-04:00</published>
    <updated>2009-03-23T01:28:05.1029765-04:00</updated>
    <category term="silverlight" label="silverlight" scheme="http://programwith.net/CategoryView,category,silverlight.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I’m starting a series of blog posts where I’d go through each of Silverlight 3’s new
features. To do this, I’m taking my Silverlight Demo application and updating it to
include these new features.
</p>
        <h4>Silverlight Overview
</h4>
        <p>
To start this off, I’ve converted my demo application to work with <a href="http://silverlight.net/getstarted/silverlight3/default.aspx" target="_blank">Silverlight
3 Beta 1</a> and posted it on CodePlex as <a href="http://silverlightoverview.codeplex.com/" target="_blank">Silverlight
Overview</a>. This application is a great interactive introduction and overview of
XAML, controls and data binding in Silverlight. Currently the project only covers
features through Silverlight 2, but I will be updating it as I cover each feature
of Silverlight 3.
</p>
        <h4>Feature By Feature
</h4>
        <p>
I’ll update this post with links as I add posts for each feature of Silverlight 3
to my series.
</p>
        <ul>
          <li>
            <a href="http://programwith.net/2009/03/23/Silverlight3NdashDeepLinking.aspx" target="_blank">Deep
Linking</a>
          </li>
          <li>
Out of Browser (coming soon) 
</li>
          <li>
Data Binding (coming soon) 
</li>
          <li>
Perspective 3D (coming soon) 
</li>
          <li>
Easing Animations (coming soon) 
</li>
          <li>
Pixel Shader (coming soon) 
</li>
          <li>
Resource Dictionaries (coming soon) 
</li>
          <li>
Bitmap Enhancements (coming soon) 
</li>
          <li>
more when I get there ;-)</li>
        </ul>
        <img width="0" height="0" src="http://programwith.net/aggbug.ashx?id=dca5f26d-6b42-4966-936b-33e10cc55bbb" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Automatic Mocking Specification</title>
    <link rel="alternate" type="text/html" href="http://programwith.net/2009/03/14/AutomaticMockingSpecification.aspx" />
    <id>http://programwith.net/PermaLink,guid,1ac04938-13ad-489c-9b5d-9fb5076e604c.aspx</id>
    <published>2009-03-14T15:29:41.8060187-04:00</published>
    <updated>2009-03-14T15:29:41.8060187-04:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
In the spirit of <a href="http://mvwood.com/blog/codeshare-week-march-8-14th-2009/">Code
Share Week</a>, I’ve decided to share a base class we’ve been using for our test classes
on my current project.
</p>
        <h4>Specification
</h4>
        <p>
We’ve been using a Specification base class for our NUnit test classes, which is kind
of following the BDD style of unit testing.
</p>
        <div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4">
          <div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 1:</span> [TestFixture]</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 2:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">class</span> Specification</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 3:</span> {</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 4:</span> [SetUp]</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 5:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">void</span> Initialize()</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 6:</span> {</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 7:</span> Mocks
= <span style="color: #0000ff">new</span> MockRepository();</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 8:</span> Before_each();</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 9:</span> ReplayAll();</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 10:</span> Because();</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 11:</span> }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 12:</span>  </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 13:</span> [TearDown]</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 14:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">void</span> Cleanup()</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 15:</span> {</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 16:</span> After_each();</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 17:</span> }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 18:</span>  </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 19:</span>
              <span style="color: #0000ff">protected</span>
              <span style="color: #0000ff">virtual</span>
              <span style="color: #0000ff">void</span> Before_each()
{ }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 20:</span>
              <span style="color: #0000ff">protected</span>
              <span style="color: #0000ff">virtual</span>
              <span style="color: #0000ff">void</span> After_each()
{ }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 21:</span>
              <span style="color: #0000ff">protected</span>
              <span style="color: #0000ff">virtual</span>
              <span style="color: #0000ff">void</span> Because()
{ }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 22:</span>  </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 23:</span>
              <span style="color: #0000ff">public</span> MockRepository
Mocks { get; <span style="color: #0000ff">private</span> set; }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 24:</span>  </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 25:</span>
              <span style="color: #0000ff">protected</span> T
Mock&lt;T&gt;() <span style="color: #0000ff">where</span> T : <span style="color: #0000ff">class</span></pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 26:</span> {</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 27:</span>
              <span style="color: #0000ff">return</span> MockRepository.GenerateMock&lt;T&gt;();</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 28:</span> }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 29:</span>  </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 30:</span>
              <span style="color: #0000ff">protected</span> T
Stub&lt;T&gt;() <span style="color: #0000ff">where</span> T : <span style="color: #0000ff">class</span></pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 31:</span> {</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 32:</span>
              <span style="color: #0000ff">return</span> MockRepository.GenerateStub&lt;T&gt;();</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 33:</span> }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 34:</span>  </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 35:</span>
              <span style="color: #0000ff">protected</span> T
Stub&lt;T&gt;(<span style="color: #0000ff">params</span><span style="color: #0000ff">object</span>[]
args) <span style="color: #0000ff">where</span> T : <span style="color: #0000ff">class</span></pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 36:</span> {</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 37:</span>
              <span style="color: #0000ff">return</span> MockRepository.GenerateStub&lt;T&gt;(args);</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 38:</span> }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 39:</span>  </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 40:</span>
              <span style="color: #0000ff">protected</span> T
Partial&lt;T&gt;() <span style="color: #0000ff">where</span> T : <span style="color: #0000ff">class</span></pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 41:</span> {</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 42:</span>
              <span style="color: #0000ff">return</span> Mocks.PartialMock&lt;T&gt;();</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 43:</span> }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 44:</span>  </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 45:</span>
              <span style="color: #0000ff">protected</span> T
Partial&lt;T&gt;(<span style="color: #0000ff">params</span><span style="color: #0000ff">object</span>[]
args) <span style="color: #0000ff">where</span> T : <span style="color: #0000ff">class</span></pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 46:</span> {</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 47:</span>
              <span style="color: #0000ff">return</span> Mocks.PartialMock&lt;T&gt;(args);</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 48:</span> }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 49:</span>  </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 50:</span>
              <span style="color: #0000ff">protected</span>
              <span style="color: #0000ff">void</span> Raise(<span style="color: #0000ff">object</span> mock, <span style="color: #0000ff">string</span> eventName, <span style="color: #0000ff">object</span> sender,
EventArgs args)</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 51:</span> {</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 52:</span>
              <span style="color: #0000ff">new</span> EventRaiser((IMockedObject)mock,
eventName).Raise(sender, args);</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 53:</span> }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 54:</span>  </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 55:</span>
              <span style="color: #0000ff">protected</span>
              <span style="color: #0000ff">virtual</span>
              <span style="color: #0000ff">void</span> ReplayAll()</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 56:</span> {</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 57:</span> Mocks.ReplayAll();</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 58:</span> }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 59:</span>  </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 60:</span>
              <span style="color: #0000ff">protected</span>
              <span style="color: #0000ff">void</span> spec_not_implemented()</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 61:</span> {</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 62:</span> MethodBase
caller = <span style="color: #0000ff">new</span> StackTrace().GetFrame(1).GetMethod();</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 63:</span>  </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 64:</span> spec_not_implemented(caller.DeclaringType.Name
+ <span style="color: #006080">"."</span> + caller.Name);</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 65:</span> }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 66:</span>  </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 67:</span>
              <span style="color: #0000ff">protected</span>
              <span style="color: #0000ff">void</span> spec_not_implemented(<span style="color: #0000ff">string</span> specName)</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 68:</span> {</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 69:</span> Console.WriteLine(<span style="color: #006080">"Specification
not implemented : "</span> + specName);</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 70:</span> }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 71:</span>  </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 72:</span> }</pre>
          </div>
        </div>
        <h4>A typical Specification
</h4>
        <p>
Here’s a typical specification written to test user account creation.
</p>
        <div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4">
          <div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 1:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">class</span> When_creating_a_new_user_account
: Specification</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 2:</span> {</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 3:</span>
              <span style="color: #0000ff">private</span> IThirdPartyUserService
_thirdPartyUserService;</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 4:</span>
              <span style="color: #0000ff">private</span> IUserDetailController
_userDetailController;</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 5:</span>
              <span style="color: #0000ff">private</span> CreateUserCommand
_newUserCommand;</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 6:</span>
              <span style="color: #0000ff">private</span> UserService
_userService;</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 7:</span>  </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 8:</span>
              <span style="color: #0000ff">protected</span>
              <span style="color: #0000ff">override</span>
              <span style="color: #0000ff">void</span> Before_each()</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 9:</span> {</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 10:</span> _thirdPartyUserService
= Stub&lt;IThirdPartyUserService&gt;();</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 11:</span> _userDetailController
= Stub&lt;IUserDetailController&gt;();</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 12:</span> var
lookupService = Stub&lt;ILookupService&gt;();</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 13:</span> var
logService = Stub&lt;ILogService&gt;();</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 14:</span> var
encryptionService = Stub&lt;IEncryptionService&gt;();</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 15:</span> _newUserCommand
= <span style="color: #0000ff">new</span> CreateUserCommand();</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 16:</span> _thirdPartyUserService.Stub(tpus
=&gt; tpus.CreateUser(_newUserCommand)).Return(<span style="color: #006080">"fakeAuthTicket"</span>);</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 17:</span> encryptionService.Stub(es
=&gt; es.Encrypt(_newUserCommand.Password)).Return(_newUserCommand.Password);</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 18:</span> _userService
= <span style="color: #0000ff">new</span> UserService(_thirdPartyUserService, _userDetailController, </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 19:</span> logService,
lookupService, encryptionService);</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 20:</span> }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 21:</span>  </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 22:</span>
              <span style="color: #0000ff">protected</span>
              <span style="color: #0000ff">override</span>
              <span style="color: #0000ff">void</span> Because()</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 23:</span> {</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 24:</span> _userService.CreateUser(_newUserCommand);</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 25:</span> }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 26:</span>  </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 27:</span> [Test]</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 28:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">void</span> Should_call_the_ThirdParty_user_service()</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 29:</span> {</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 30:</span> _thirdPartyUserService.AssertWasCalled(tpus
=&gt; tpus.CreateUser(_newUserCommand));</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 31:</span> }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 32:</span>  </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 33:</span> [Test]</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 34:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">void</span> Should_call_the_UserDetailController_to_persist_data()</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 35:</span> {</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 36:</span> _userDetailController.AssertWasCalled(udc
=&gt; udc.Insert(_newUserCommand.Login,</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 37:</span> _newUserCommand.Password,
_newUserCommand.Email));</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 38:</span> }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 39:</span> }</pre>
          </div>
        </div>
        <h4>Specification using RhinoAutoMocker
</h4>
        <p>
One problem we ran into was that the UserService class kept having dependencies added
as more functionality was added to the class. We’re using <a href="http://structuremap.sourceforge.net/Default.htm">StructureMap</a> as
an IoC container, so there’s no impact to code when you add a dependency to a constructor,
but it was requiring us to refactor our tests since we’re not using StructureMap to
create instances inside of our tests.
</p>
        <p>
StructureMap comes with a separate assembly containing the <a href="http://devlicio.us/blogs/derik_whittaker/archive/2008/10/05/using-the-rhinoautomocker-that-is-part-of-structuremap-2-5.aspx">RhinoAutoMocker</a> which
my colleague <a href="http://jonkruger.com/blog/">Jon Kruger</a> suggested would solve
our constant refactoring problem. You can use the auto mocker functionality to automatically
mock all dependencies of a class. This also cleans up your code because you don’t
have to create fields for dependencies that you plan on using in multiple test methods.
</p>
        <div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4">
          <div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 1:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">class</span> When_creating_a_new_user_account
: Specification</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 2:</span> {</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 3:</span>
              <span style="color: #0000ff">private</span> RhinoAutoMocker&lt;UserService&gt;
_mocker;</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 4:</span>
              <span style="color: #0000ff">private</span> IThirdPartyUserService
_thirdPartyUserService;</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 5:</span>
              <span style="color: #0000ff">private</span> IUserDetailController
_userDetailController;</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 6:</span>
              <span style="color: #0000ff">private</span> CreateUserCommand
_newUserCommand;</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 7:</span>  </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 8:</span>
              <span style="color: #0000ff">protected</span>
              <span style="color: #0000ff">override</span>
              <span style="color: #0000ff">void</span> Before_each()</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 9:</span> {</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 10:</span> _mocker
= <span style="color: #0000ff">new</span> RhinoAutoMocker&lt;UserService&gt;();</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 11:</span> _newUserCommand
= <span style="color: #0000ff">new</span> CreateUserCommand();</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 12:</span> _thirdPartyUserService
= _mocker.Get&lt;IThirdPartyUserService&gt;();</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 13:</span> _thirdPartyUserService.Stub(tpus
=&gt; tpus.CreateUser(_newUserCommand))</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 14:</span> .Return(<span style="color: #006080">"fakeAuthTicket"</span>);</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 15:</span> _userDetailController
= _mocker.Get&lt;IUserDetailController&gt;();</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 16:</span> _mocker.Get&lt;IEncryptionService&gt;().Stub(es
=&gt; es.Encrypt(_newUserCommand.Password))</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 17:</span> .Return(_newUserCommand.Password);</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 18:</span> }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 19:</span>  </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 20:</span>
              <span style="color: #0000ff">protected</span>
              <span style="color: #0000ff">override</span>
              <span style="color: #0000ff">void</span> Because()</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 21:</span> {</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 22:</span> _mocker.ClassUnderTest.CreateUser(_newUserCommand);</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 23:</span> }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 24:</span>  </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 25:</span> [Test]</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 26:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">void</span> Should_call_the_ThirdParty_user_service()</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 27:</span> {</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 28:</span> _thirdPartyUserService.AssertWasCalled(tpus
=&gt; tpus.CreateUser(_newUserCommand));</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 29:</span> }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 30:</span>  </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 31:</span> [Test]</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 32:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">void</span> Should_call_the_UserDetailController_to_persist_data()</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 33:</span> {</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 34:</span> _userDetailController.AssertWasCalled(udc
=&gt; udc.Insert(_newUserCommand.Login,</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 35:</span> _newUserCommand.Password,
_newUserCommand.Email));</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 36:</span> }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 37:</span> }</pre>
          </div>
        </div>
        <h4>AutoMockingSpecification
</h4>
        <p>
I took this a step further and created a base class that is used when you’re only
testing one class. It doesn’t add all that much functionality, but it does make your
specs look much cleaner.
</p>
        <div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4">
          <div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 1:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">class</span> AutoMockingSpecification&lt;T&gt;
: Specification</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 2:</span>
              <span style="color: #0000ff">where</span> T
: <span style="color: #0000ff">class</span></pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 3:</span> {</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 4:</span>
              <span style="color: #0000ff">private</span>
              <span style="color: #0000ff">bool</span> _replayTheClassUnderTest
= <span style="color: #0000ff">false</span>;</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 5:</span>  </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 6:</span>
              <span style="color: #0000ff">public</span> RhinoAutoMocker&lt;T&gt;
Mocker { get; set; }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 7:</span>  </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 8:</span>
              <span style="color: #0000ff">protected</span>
              <span style="color: #0000ff">override</span>
              <span style="color: #0000ff">void</span> Before_each()</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 9:</span> {</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 10:</span>
              <span style="color: #0000ff">base</span>.Before_each();</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 11:</span> Mocker
= <span style="color: #0000ff">new</span> RhinoAutoMocker&lt;T&gt;();</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 12:</span> }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 13:</span>  </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 14:</span>
              <span style="color: #0000ff">protected</span>
              <span style="color: #0000ff">override</span>
              <span style="color: #0000ff">void</span> ReplayAll()</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 15:</span> {</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 16:</span>
              <span style="color: #0000ff">base</span>.ReplayAll();</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 17:</span>
              <span style="color: #0000ff">if</span> (_replayTheClassUnderTest)</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 18:</span> Mocker.ClassUnderTest.Replay();</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 19:</span> }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 20:</span>  </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 21:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">virtual</span>
              <span style="color: #0000ff">void</span> PartialMockTheClassUnderTest()</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 22:</span> {</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 23:</span> Mocker.PartialMockTheClassUnderTest();</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 24:</span> _replayTheClassUnderTest
= <span style="color: #0000ff">true</span>;</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 25:</span> }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 26:</span> }</pre>
          </div>
        </div>
        <h4>Specification Using AutoMockingSpecification
</h4>
        <p>
Here’s our sample UserService specification refactored to use the AutoMockingSpecification
base class.
</p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4">
          <div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 1:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">class</span> When_creating_a_new_user_account
: AutoMockingSpecification&lt;UserService&gt;</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 2:</span> {</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 3:</span>
              <span style="color: #0000ff">private</span> CreateUserCommand
_newUserCommand;</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 4:</span>  </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 5:</span>
              <span style="color: #0000ff">protected</span>
              <span style="color: #0000ff">override</span>
              <span style="color: #0000ff">void</span> Before_each()</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 6:</span> {</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 7:</span>
              <span style="color: #0000ff">base</span>.Before_each();</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 8:</span> _newUserCommand
= <span style="color: #0000ff">new</span> CreateUserCommand();</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 9:</span> Mocker.Get&lt;IThirdPartyUserService&gt;().Stub(tpus
=&gt; tpus.CreateUser(_newUserCommand))</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 10:</span> .Return(<span style="color: #006080">"fakeAuthTicket"</span>);</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 11:</span> Mocker.Get&lt;IEncryptionService&gt;().Stub(es
=&gt; es.Encrypt(_newUserCommand.Password))</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 12:</span> .Return(_newUserCommand.Password);</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 13:</span> }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 14:</span>  </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 15:</span>
              <span style="color: #0000ff">protected</span>
              <span style="color: #0000ff">override</span>
              <span style="color: #0000ff">void</span> Because()</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 16:</span> {</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 17:</span> Mocker.ClassUnderTest.CreateUser(_newUserCommand);</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 18:</span> }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 19:</span>  </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 20:</span> [Test]</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 21:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">void</span> Should_call_the_ThirdParty_user_service()</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 22:</span> {</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 23:</span> Mocker.Get&lt;IThirdPartyUserService&gt;().AssertWasCalled(tpus
=&gt; tpus.CreateUser(_newUserCommand));</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 24:</span> }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 25:</span>  </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 26:</span> [Test]</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 27:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">void</span> Should_call_the_UserDetailController_to_persist_data()</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 28:</span> {</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 29:</span> Mocker.Get&lt;IUserDetailController&gt;().AssertWasCalled(</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 30:</span> udc
=&gt; udc.Insert(_newUserCommand.Login, _newUserCommand.Password, _newUserCommand.Email));</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #606060"> 31:</span> }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 32:</span> }</pre>
          </div>
        </div>
        <p>
        </p>
        <p>
 
</p>
        <p>
I’m pleased with the result, and it seems to be pretty popular with the other developers
on our project.
</p>
        <img width="0" height="0" src="http://programwith.net/aggbug.ashx?id=1ac04938-13ad-489c-9b5d-9fb5076e604c" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Cincinnati Silverlight Firestarter</title>
    <link rel="alternate" type="text/html" href="http://programwith.net/2009/03/13/CincinnatiSilverlightFirestarter.aspx" />
    <id>http://programwith.net/PermaLink,guid,92576357-1662-4a83-81fa-68d494931edc.aspx</id>
    <published>2009-03-13T10:17:55.1201369-04:00</published>
    <updated>2009-03-13T10:17:55.1201369-04:00</updated>
    <category term="silverlight" label="silverlight" scheme="http://programwith.net/CategoryView,category,silverlight.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">I'll be speaking at the <a href="http://cinnug.org/blog/archive/2009/02/23/cincinnati-silverlight-firestarter.aspx">Cincinnati
Silverlight Firestarter</a> event at the Microsoft office in Mason, OH on March 28th. 
Following in the Cleveland event's footsteps, this is going to have local speakers
and is a great full day introduction to Silverlight.  I'll be giving the Controls
and Databinding post-lunch talk again. (Hopefully this time my laptop will work with
the projector.)<br /><p style="margin: 0in 0in 0pt;">
 
</p><p style="margin: 0in 0in 0pt;">
Agenda:
</p><p style="margin: 0in 0in 0pt;">
 8:30 AM: Registration
</p><p style="margin: 0in 0in 0pt;">
 9:00 AM: An Introduction to Silverlight (<a href="http://www.jeffblankenburg.com/default.aspx">Jeff
Blankenburg</a>)
</p><p style="margin: 0in 0in 0pt;">
 10:30 AM: An Introduction to XAML (<a href="http://joewirtley.blogspot.com/">Joe
Wirtley</a>)
</p><p style="margin: 0in 0in 0pt;">
 11:45 AM: Lunch break
</p><p style="margin: 0in 0in 0pt;">
 12:30 PM: An Introduction to the Tools (<a href="http://joshholmes.com">Josh
Holmes</a>)
</p><p style="margin: 0in 0in 0pt;">
 2:00 PM: An Introduction to Controls &amp; Data Binding (Matt Casto)
</p><p style="margin: 0in 0in 0pt;">
 3:30 PM: Server Communication (<a href="http://clevelanddotnet.blogspot.com/">Sam
Nasr</a><a href="http://riathoughts.com/"></a>)
</p><p style="margin: 0in 0in 0pt;">
 4:45 PM: Giveaways and closing<br /></p><br /><p style="margin: 0in 0in 0pt;">
To register for this event, please go to <a href="https://www.clicktoattend.com/invitation.aspx?code=136101">https://www.clicktoattend.com/invitation.aspx?code=136101</a><a href="http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032392883&amp;Culture=en-US"></a></p><p style="margin: 0in 0in 0pt;"><a href="http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032392883&amp;Culture=en-US"><br /></a></p><p style="margin: 0in 0in 0pt;">
Hope to see you there!
</p><p></p><img width="0" height="0" src="http://programwith.net/aggbug.ashx?id=92576357-1662-4a83-81fa-68d494931edc" /></div>
    </content>
  </entry>
  <entry>
    <title>Is Blend's Cost Prohibitive to Silverlight Adoption?</title>
    <link rel="alternate" type="text/html" href="http://programwith.net/2009/03/13/IsBlendsCostProhibitiveToSilverlightAdoption.aspx" />
    <id>http://programwith.net/PermaLink,guid,4b85cefc-e72c-4db1-ab8c-23ebfc85f1fb.aspx</id>
    <published>2009-03-13T08:09:13.442-04:00</published>
    <updated>2009-03-13T09:39:51.8504651-04:00</updated>
    <category term="silverlight" label="silverlight" scheme="http://programwith.net/CategoryView,category,silverlight.aspx" />
    <category term="tools" label="tools" scheme="http://programwith.net/CategoryView,category,tools.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">I was reading <a href="http://wildermuth.com/2009/03/12/What_I_Use_for_Silverlight_Development">Shawn
Wildermuth</a> and <a href="http://johnpapa.net/silverlight/my-silverlight-war-room/">John
Papa</a>'s blog posts about all of the tools that they use for Silverlight development,
and it finally pushed me to put a thought that's been rattling around in my brain
into words.<br /><br />
Last weekend I was at the <a href="http://artandcode.ning.com/">Art &amp; Code</a> conference
at CMU in Pittsburg presenting, along with <a href="http://twitter.com/timhibner">Tim
Hibner</a>, an introduction to Silverlight. Being in that environment reminded me
of what it was like when I was a student and was looking at various programming languages.
One of the things I was interested in doing back then was developing video games.
I remember looking into Flash programming and was turned off by the cost of the development
environment. To be honest, that was a while ago and I don't remember what the costs
were, but I do remember the feeling that I couldn't bother with the hassle of learning
the platform.<br /><br />
Developing video games like today's casual Flash games is a huge opportunity for an
entry point to learning Silverlight. Just look at all of the Flash <a href="http://www.kongregate.com/">game</a><a href="http://www.newgrounds.com/">sites</a><a href="http://www.flashportal.com/">out</a><a href="http://mochiland.com/articles/45-sites-to-submit-your-flash-games">there</a>.
There are actually some Silverlight specific game sites getting started now like <a href="http://silverarcade.com/">Silver
Arcade</a> and <a href="http://www.silverlightclub.com/">Silverlight Club</a>. In
fact, there is currently a <a href="http://www.serverquestcontest.com/">Silverlight
game development contest</a> with a grand prize of $5000, which should definitely
get people interested.<br /><br />
The first place people interested to start with Silverlight are pointed to is the <a href="http://silverlight.net/getstarted">Get
Started</a> page on the official Silverlight web site. This page starts out by linking
to the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=c22d6a7b-546f-4407-8ef6-d60c8ee221ed&amp;displaylang=en">Silverlight
Tools for Visual Studio 2008 SP1</a>, which in turn requires you to already have <a href="http://msdn.microsoft.com/en-us/vs2008/products/cc268305.aspx">Visual
Studio 2008</a> or <a href="http://www.microsoft.com/express/vwd/">Visual Web Developer
Express</a> installed with Service Pack 1. Assuming the user downloads the Visual
Web Developer Express, they have a joy filled hour+ of baby sitting installs. Then,
the second step is to download and install the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=5FF08106-B9F4-43CD-ABAD-4CC9D9C208D7&amp;displaylang=en">Expression
Blend 2 trial</a>, and download and install the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=EB9B5C48-BA2B-4C39-A1C3-135C60BBBE66&amp;displaylang=en">Expression
Blend 2 Service Pack 1</a> on top of that. Gah! It goes on from there.<br /><br />
I'm seriously wondering how many people make it that far, or have given up at this
point. I think the final straw for me would have been the fact that Blend is only
a 30 day trial. What do I do after that? Pay <a href="http://www.microsoft.com/expression/products/Purchase.aspx?key=blend">$499
for Expression Blend</a> or <a href="http://www.microsoft.com/expression/products/Purchase.aspx?key=professional">$999
for Expression Studio</a>? No way! Even as a professional developer today I wouldn't
pay that. And, sure, there's <a href="https://www.dreamspark.com/default.aspx">DreamSpark</a>,
but that's an extra hassle, and the get started page doesn't even mention it.<br /><br />
I love Silverlight, but its been easy for me since I've been developing on the Microsoft
platform for over 10 years and I have access to MSDN downloads. Thank goodness for
the fact that Blend is available through that, or else no one would bother with it.<br /><br />
Microsoft has done a great job with making free versions of its tools available lately,
but for all the weight they're putting behind Silverlight I don't understand why they
don't, at the very least, have an Express version of Blend. I would even suggest that
there should be a free version of the entire Expression Suite, although a name like
Expression Suite Express is kinda silly. :-)<br /><p></p><img width="0" height="0" src="http://programwith.net/aggbug.ashx?id=4b85cefc-e72c-4db1-ab8c-23ebfc85f1fb" /></div>
    </content>
  </entry>
  <entry>
    <title>Cleveland Silverlight Firestarter Recap</title>
    <link rel="alternate" type="text/html" href="http://programwith.net/2008/11/04/ClevelandSilverlightFirestarterRecap.aspx" />
    <id>http://programwith.net/PermaLink,guid,c875d34f-7fc0-428c-bac2-f269a34baeed.aspx</id>
    <published>2008-11-03T22:10:04.171-05:00</published>
    <updated>2008-11-03T22:24:00.9369286-05:00</updated>
    <category term="silverlight" label="silverlight" scheme="http://programwith.net/CategoryView,category,silverlight.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">Last Saturday's <a href="http://programwith.net/2008/10/21/ClevelandSilverlightFirestarter.aspx">Silverlight
Firestarter</a> event in Cleveland was a blast.  Being able to express my excitement
for Silverlight to so many people (around 70 people showed) that had little to no
experience with it was unbelievable.<br /><br />
I had problems connecting my Dell Inspiron 1720 laptop to the external display so
the projector wouldn't work.  I had the same problem last Tuesday night at the <a href="http://cinnug.org">CINNUG</a> presentation,
but this time <a href="http://riathoughts.com/">John Stockton</a> was there to save
the day.  I was able to present all of my material on his machine without much
of a hitch.<br /><br /><a href="http://www.jeffblankenburg.com">Jeff Blankenburg</a> did a top notch job
presenting the keynote and improvising in his Tools talk when his Blend install wouldn't
work with Silverlight 2 projects.  <a href="http://www.codinggeekette.com/">Sarah
Dutkiewicz</a> was inspirational in her XAML basics session - she gave a clear introduction
to XAML while being sick and barely able to talk!  Finally, John Stockton's presentation
on Server Communicatiion in Silverlight showed why he's the man.  :-D<br /><br />
The project and slide files that I used for the presentations are available from my
Sky Drive:<br /><br /><iframe marginheight="0" marginwidth="0" style="border: 1px solid rgb(221, 229, 233); margin: 3px; padding: 0pt; width: 240px; height: 26px; background-color: rgb(255, 255, 255);" src="http://cid-63a50a5c41970075.skydrive.live.com/embedrow.aspx/ClevelandSilverlightFirestarter" scrolling="no" frameborder="0"></iframe><img width="0" height="0" src="http://programwith.net/aggbug.ashx?id=c875d34f-7fc0-428c-bac2-f269a34baeed" /></div>
    </content>
  </entry>
  <entry>
    <title>Cleveland Silverlight Firestarter</title>
    <link rel="alternate" type="text/html" href="http://programwith.net/2008/10/21/ClevelandSilverlightFirestarter.aspx" />
    <id>http://programwith.net/PermaLink,guid,7a783681-837c-41b3-9b32-1b0a9afd41b7.aspx</id>
    <published>2008-10-21T14:09:19.771-04:00</published>
    <updated>2008-10-21T14:17:54.1744623-04:00</updated>
    <category term="silverlight" label="silverlight" scheme="http://programwith.net/CategoryView,category,silverlight.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">I'll be speaking at the <a href="http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032392883&amp;Culture=en-US">Cleveland
Silverlight Firestarter</a> event on November 1st.  This event is going to have
mostly the same structure as the <a href="http://blogs.msdn.com/peterlau/archive/2008/10/06/nyc-silverlight-2-fire-starter-content-and-links.aspx">NYC
Silverlight Firestarter</a>, but with (mostly) local speakers.  For instance,
I'll be filling <a href="http://wildermuth.com/2008/09/13/Just_Back_From_the_Silverlight_2_Firestarter_in_NYC">Shawn
Wildermuth</a>'s shoes by giving the Controls and Databinding afternoon talk.<p style="margin: 0in 0in 0pt;">
 
</p><p style="margin: 0in 0in 0pt;">
Agenda:
</p><p style="margin: 0in 0in 0pt;">
 8:00 AM: Registration
</p><p style="margin: 0in 0in 0pt;">
 9:00 AM: Keynote/Intro to Silverlight 2 (<a href="http://www.jeffblankenburg.com/default.aspx">Jeff
Blankenburg</a>)
</p><p style="margin: 0in 0in 0pt;">
 10:30 AM: XAML Basics (<a href="http://www.codinggeekette.com/">Sarah Dutkiewicz</a>)
</p><p style="margin: 0in 0in 0pt;">
 Noon: Lunch break
</p><p style="margin: 0in 0in 0pt;">
 1:00 PM: The Tools (Jeff Blankenburg)
</p><p style="margin: 0in 0in 0pt;">
 2:30 PM: Controls &amp; Data Binding (Matt Casto)
</p><p style="margin: 0in 0in 0pt;">
 4:00 PM: Server Communication (<a href="http://riathoughts.com/">John Stockton</a>)
</p><p style="margin: 0in 0in 0pt;"><br /></p><p style="margin: 0in 0in 0pt;"></p><p style="margin: 0in 0in 0pt;">
To register for this event, please go to <a href="http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032392883&amp;Culture=en-US">http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032392883&amp;Culture=en-US</a></p><p style="margin: 0in 0in 0pt;"><a href="http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032392883&amp;Culture=en-US"><br /></a></p><p style="margin: 0in 0in 0pt;"></p><p style="margin: 0in 0in 0pt;">
Hope to see you there!
</p><img width="0" height="0" src="http://programwith.net/aggbug.ashx?id=7a783681-837c-41b3-9b32-1b0a9afd41b7" /></div>
    </content>
  </entry>
  <entry>
    <title>Ball Blocks</title>
    <link rel="alternate" type="text/html" href="http://programwith.net/2008/10/07/BallBlocks.aspx" />
    <id>http://programwith.net/PermaLink,guid,eb154aab-3dea-41b8-a447-30f8eef99be3.aspx</id>
    <published>2008-10-07T11:35:12.934-04:00</published>
    <updated>2008-10-07T11:35:12.9345843-04:00</updated>
    <category term="silverlight" label="silverlight" scheme="http://programwith.net/CategoryView,category,silverlight.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">My submission to the <a href="http://www.teamzonesports.com/SilverlightGameContest">Create
a Sports Game in Silverlight Contest</a> hosted by <a href="http://www.teamzonesports.com/">Team
Zone Sports</a> ended up in second place!<br /><br />
The game is called Ball Blocks because I couldn't come up with a better name at the
time.  You play by drawing a square over the balls where the four corners of
the square are on top of the same type of ball.  The bigger the square (more
balls inside of it) the more points you get and the more time gets added back to the
timer.<br /><br />
The game currently has a bug in it where it can freeze the browser during the game
over animation when time expires.  This seems to happen more often on slower
machines.  It may be because of the spinning textblock ... I'm just not sure.<br /><br />
Because of time spent trying to fix this bug, I didn't get sounds fully implemented
and didn't get a far into the game development as I'd hoped.  I'm hoping to spend
some more time on it some time soon and get some of the features I'd originally envisioned
implemented.<br /><br />
I've created a <a href="http://www.codeplex.com/BallBlocks">Ball Blocks project</a> on
CodePlex and uploaded the code.  The project has been updated to work in Silverlight
2.0 RC0 so it should be ready once Silverlight 2 is released.<br /><p></p><img width="0" height="0" src="http://programwith.net/aggbug.ashx?id=eb154aab-3dea-41b8-a447-30f8eef99be3" /></div>
    </content>
  </entry>
  <entry>
    <title>Crawling Border Animation</title>
    <link rel="alternate" type="text/html" href="http://programwith.net/2008/04/22/CrawlingBorderAnimation.aspx" />
    <id>http://programwith.net/PermaLink,guid,c41366fc-ccb3-4d12-8431-b355e6c4b39f.aspx</id>
    <published>2008-04-21T22:55:36.323-04:00</published>
    <updated>2008-04-22T21:12:39.5533548-04:00</updated>
    <category term="silverlight" label="silverlight" scheme="http://programwith.net/CategoryView,category,silverlight.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
This is a very simple animation that can be used just about anywhere.
</p>
        <p>
          <iframe style="width: 300px; height: 150px" src="http://silverlight.services.live.com/invoke/63993/Crawling%20Border/iframe.html" frameborder="0" scrolling="no">
          </iframe>
        </p>
        <p>
[[ If you're viewing this post through an RSS reader, you won't be able to see the
Silverlight example ]]
</p>
        <p>
Following is my Page.xaml for this example.  There was no code needed.
</p>
        <div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4">
          <div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">UserControl</span>
              <span style="color: #ff0000">x:Class</span>
              <span style="color: #0000ff">="AnimationSample.Page"</span>
            </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #ff0000">xmlns</span>
              <span style="color: #0000ff">="http://schemas.microsoft.com/client/2007"</span>
            </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #ff0000">xmlns:x</span>
              <span style="color: #0000ff">="http://schemas.microsoft.com/winfx/2006/xaml"</span>
            </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #ff0000">Width</span>
              <span style="color: #0000ff">="300"</span>
              <span style="color: #ff0000">Height</span>
              <span style="color: #0000ff">="150"</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">Grid</span>
              <span style="color: #ff0000">x:Name</span>
              <span style="color: #0000ff">="LayoutRoot"</span>
              <span style="color: #ff0000">Background</span>
              <span style="color: #0000ff">="White"</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">Grid.Triggers</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">EventTrigger</span>
              <span style="color: #ff0000">RoutedEvent</span>
              <span style="color: #0000ff">="Grid.Loaded"</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">EventTrigger.Actions</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">BeginStoryboard</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">Storyboard</span>
              <span style="color: #ff0000">x:Name</span>
              <span style="color: #0000ff">="CrawlingBorder"</span>
              <span style="color: #ff0000">RepeatBehavior</span>
              <span style="color: #0000ff">="Forever"</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">DoubleAnimationUsingKeyFrames</span>
              <span style="color: #ff0000">Storyboard</span>.<span style="color: #ff0000">TargetName</span><span style="color: #0000ff">="rectangle"</span></pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #ff0000">Storyboard</span>.<span style="color: #ff0000">TargetProperty</span><span style="color: #0000ff">="(Shape.StrokeDashOffset)"</span><span style="color: #ff0000">BeginTime</span><span style="color: #0000ff">="00:00:00"</span><span style="color: #0000ff">&gt;</span></pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">SplineDoubleKeyFrame</span>
              <span style="color: #ff0000">KeyTime</span>
              <span style="color: #0000ff">="00:00:00"</span>
              <span style="color: #ff0000">Value</span>
              <span style="color: #0000ff">="0"</span>
              <span style="color: #0000ff">/&gt;</span>
            </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">SplineDoubleKeyFrame</span>
              <span style="color: #ff0000">KeyTime</span>
              <span style="color: #0000ff">="00:00:00.5000000"</span>
              <span style="color: #ff0000">Value</span>
              <span style="color: #0000ff">="5"</span>
              <span style="color: #0000ff">/&gt;</span>
            </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #0000ff">&lt;/</span>
              <span style="color: #800000">DoubleAnimationUsingKeyFrames</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #0000ff">&lt;/</span>
              <span style="color: #800000">Storyboard</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #0000ff">&lt;/</span>
              <span style="color: #800000">BeginStoryboard</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #0000ff">&lt;/</span>
              <span style="color: #800000">EventTrigger.Actions</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #0000ff">&lt;/</span>
              <span style="color: #800000">EventTrigger</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #0000ff">&lt;/</span>
              <span style="color: #800000">Grid.Triggers</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">Rectangle</span>
              <span style="color: #ff0000">Stroke</span>
              <span style="color: #0000ff">="Green"</span>
              <span style="color: #ff0000">StrokeThickness</span>
              <span style="color: #0000ff">="6"</span>
              <span style="color: #ff0000">StrokeDashArray</span>
              <span style="color: #0000ff">="3,2"</span>
              <span style="color: #ff0000">StrokeDashCap</span>
              <span style="color: #0000ff">="Round"</span>
            </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #ff0000">Margin</span>
              <span style="color: #0000ff">="20"</span>
              <span style="color: #ff0000">StrokeDashOffset</span>
              <span style="color: #0000ff">="0"</span>
              <span style="color: #ff0000">StrokeLineJoin</span>
              <span style="color: #0000ff">="Round"</span>
              <span style="color: #ff0000">x:Name</span>
              <span style="color: #0000ff">="rectangle"</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #0000ff">&lt;/</span>
              <span style="color: #800000">Rectangle</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">TextBlock</span>
              <span style="color: #ff0000">FontFamily</span>
              <span style="color: #0000ff">="Lucida
Sans Unicode"</span>
              <span style="color: #ff0000">FontSize</span>
              <span style="color: #0000ff">="24"</span>
            </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #ff0000">Text</span>
              <span style="color: #0000ff">="Crawling
Border"</span>
              <span style="color: #ff0000">FontWeight</span>
              <span style="color: #0000ff">="Bold"</span>
            </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #ff0000">HorizontalAlignment</span>
              <span style="color: #0000ff">="Center"</span>
              <span style="color: #ff0000">VerticalAlignment</span>
              <span style="color: #0000ff">="Center"</span>
              <span style="color: #ff0000">Foreground</span>
              <span style="color: #0000ff">="#FFDE680A"</span>
              <span style="color: #0000ff">/&gt;</span>
            </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #0000ff">&lt;/</span>
              <span style="color: #800000">Grid</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #0000ff">&lt;/</span>
              <span style="color: #800000">UserControl</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
          </div>
        </div>
        <img width="0" height="0" src="http://programwith.net/aggbug.ashx?id=c41366fc-ccb3-4d12-8431-b355e6c4b39f" />
      </div>
    </content>
  </entry>
  <entry>
    <title>PresentLight - A Silverlight Presentation Written in Silverlight</title>
    <link rel="alternate" type="text/html" href="http://programwith.net/2008/04/22/PresentLightASilverlightPresentationWrittenInSilverlight.aspx" />
    <id>http://programwith.net/PermaLink,guid,92aeb18f-3f9e-452a-9331-d0ee6e99e33c.aspx</id>
    <published>2008-04-21T22:15:26.4009345-04:00</published>
    <updated>2008-04-21T22:15:26.4009345-04:00</updated>
    <category term="silverlight" label="silverlight" scheme="http://programwith.net/CategoryView,category,silverlight.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I gave a talk at the <a href="http://cinnug.org/cododn/">Central Ohio Day of .NET</a> last
Saturday about Silverlight 2.  The presentation was written in Silverlight 2
Beta 1 and included examples of functionality built into Silverlight versions 1 and
2, and the beginning steps in creating the presentation itself.
</p>
        <p>
I have much more planned to be added to the presentation, so I created a CodePlex
project called <a href="http://www.codeplex.com/PresentLight">PresentLight</a>. 
I'm hoping that other people will like the idea of giving a presentation in the technology
that they're speaking about, and maybe they'll use the framework or even add their
own content!
</p>
        <p>
I uploaded a slightly older version than the one I gave at CODoDN to silverlight.live.com,
check it out by clicking on the following preview image.  The XAP is 14 MB so
expect a decent wait for everything to load ... I need to reduce the size.  I'll
update this post with a better example as soon as I have it available.
</p>
        <p>
          <a href="http://silverlight.services.live.com/invoke/63993/PresentLight/iframe.html">
            <img height="325" src="http://programwith.net/images/PresentLightSS.png" width="443" />
          </a>
        </p>
        <p>
Much thanks goes out to <a href="http://www.jeffblankenburg.com/index.html">Jeff Blankenburg</a> for
building the original slide deck that I based this presentation on.  Also, I
got the idea from <a href="http://david.sleeckx.be/?p=12">David Sleeckx</a>'s WPF
presentation, which is an excellent way to get an overview of WPF.
</p>
        <h3>Using the Presentation
</h3>
        <p>
You can navigate the slides through the menu on the left, or move forward one slide
by clicking on the header area.  A few of the slides don't have much at first,
but clicking in the slide area will show text which was talking points for that part
of the presentation.  The interactive slides in the middle should be pretty self
explanatory - you can modify the XAML in most of the examples to see changes in real
time.
</p>
        <p>
The screen shots at the end can be clicked on to view the full size.  I wanted
to keep the entire presentation in Silverlight, so I was trying to use screen shots
instead of jumping into Visual Studio.  These slides were taking over an hour
each to prepare, because I was trying to give each one a different type of animation. 
I think they ended up being a little disjointed though - its much more natural to
see someone working with the environment than seeing screen shots of some code, then
the solution explorer, then XAML.  I'm definitely going to have to give more
thought to that area.
</p>
        <h3>Plans for the Future
</h3>
        <p>
I plan to have the slides stored in data rather than hard coded in the page code behind. 
I'm going to integrate more examples, such as Isolated Storage, Communications with
web services and through sockets, and dynamic languages integrated directly into the
slides, like I did with the XAML examples.
</p>
        <p>
Also, I'm going to expand more on some of the user controls that I created as part
of the application.  I already went into the scrolling textbox control in my
last post, so there will be more of that on the way.
</p>
        <img width="0" height="0" src="http://programwith.net/aggbug.ashx?id=92aeb18f-3f9e-452a-9331-d0ee6e99e33c" />
      </div>
    </content>
  </entry>
</feed>