<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Building a Better User Experience - Silverlight</title>
    <link>http://www.mindfusioncorp.com/weblog/</link>
    <description>A weblog authored by Keith Rome, with a focus on the User Experience.</description>
    <language>en-us</language>
    <copyright>Keith Rome</copyright>
    <lastBuildDate>Mon, 06 Apr 2009 20:42:57 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.3.9074.18820</generator>
    <managingEditor>krome@wintellect.com</managingEditor>
    <webMaster>krome@wintellect.com</webMaster>
    <item>
      <trackback:ping>http://www.mindfusioncorp.com/weblog/Trackback.aspx?guid=263c1425-729e-4dae-b47c-5f88e61299e8</trackback:ping>
      <pingback:server>http://www.mindfusioncorp.com/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mindfusioncorp.com/weblog/PermaLink,guid,263c1425-729e-4dae-b47c-5f88e61299e8.aspx</pingback:target>
      <dc:creator>Keith Rome</dc:creator>
      <wfw:comment>http://www.mindfusioncorp.com/weblog/CommentView,guid,263c1425-729e-4dae-b47c-5f88e61299e8.aspx</wfw:comment>
      <wfw:commentRss>http://www.mindfusioncorp.com/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=263c1425-729e-4dae-b47c-5f88e61299e8</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
In a few hours I will be giving a new presentation to the <a href="http://www.atlantamspros.com/" target="_blank">Atlanta
MS Professionals User Group</a>. The topic for tonight is Asynchronous UI.
</p>
        <p>
I will be talking about a number of common development patterns, along with discussion
of the benefits and tradeoffs of each, and demos of the more mainstream approaches.
I will also be covering a very simple and elegant solution that meets most async requirements
– <a href="http://www.wintellect.com/PowerThreading.aspx" target="_blank">Jeffrey
Richter’s AsyncEnumerator</a>.
</p>
        <p>
In advance of tonight’s presentation, I am posting my slides and code early. <a href="http://www.mindfusioncorp.com/weblog/content/binary/AsyncUi.zip" target="_blank">You
can download them from this link</a>. They may also become available as a download
for members of the MSPros user group after the session.
</p>
        <p>
Also, as a raffle prize, I am donating a one-year subscription to MSDN Premium with
Visual Studio 2008 Team Suite Edition. If you were to <a href="http://www.amazon.com/Microsoft-Visual-Studio-System-Suite/dp/B000WM1Z5A/ref=sr_1_2?ie=UTF8&amp;s=software&amp;qid=1239050215&amp;sr=1-2" target="_blank">buy
it from Amazon</a>, this subscription would cost over $10,000, so be sure to show
up tonight if for nothing else than to win. 
</p>
        <img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=263c1425-729e-4dae-b47c-5f88e61299e8" />
      </body>
      <title>Asynchronous UI in WPF and Silverlight (and Windows Forms too)</title>
      <guid isPermaLink="false">http://www.mindfusioncorp.com/weblog/PermaLink,guid,263c1425-729e-4dae-b47c-5f88e61299e8.aspx</guid>
      <link>http://www.mindfusioncorp.com/weblog/2009/04/06/AsynchronousUIInWPFAndSilverlightAndWindowsFormsToo.aspx</link>
      <pubDate>Mon, 06 Apr 2009 20:42:57 GMT</pubDate>
      <description>&lt;p&gt;
In a few hours I will be giving a new presentation to the &lt;a href="http://www.atlantamspros.com/" target="_blank"&gt;Atlanta
MS Professionals User Group&lt;/a&gt;. The topic for tonight is Asynchronous UI.
&lt;/p&gt;
&lt;p&gt;
I will be talking about a number of common development patterns, along with discussion
of the benefits and tradeoffs of each, and demos of the more mainstream approaches.
I will also be covering a very simple and elegant solution that meets most async requirements
– &lt;a href="http://www.wintellect.com/PowerThreading.aspx" target="_blank"&gt;Jeffrey
Richter’s AsyncEnumerator&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
In advance of tonight’s presentation, I am posting my slides and code early. &lt;a href="http://www.mindfusioncorp.com/weblog/content/binary/AsyncUi.zip" target="_blank"&gt;You
can download them from this link&lt;/a&gt;. They may also become available as a download
for members of the MSPros user group after the session.
&lt;/p&gt;
&lt;p&gt;
Also, as a raffle prize, I am donating a one-year subscription to MSDN Premium with
Visual Studio 2008 Team Suite Edition. If you were to &lt;a href="http://www.amazon.com/Microsoft-Visual-Studio-System-Suite/dp/B000WM1Z5A/ref=sr_1_2?ie=UTF8&amp;amp;s=software&amp;amp;qid=1239050215&amp;amp;sr=1-2" target="_blank"&gt;buy
it from Amazon&lt;/a&gt;, this subscription would cost over $10,000, so be sure to show
up tonight if for nothing else than to win. 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=263c1425-729e-4dae-b47c-5f88e61299e8" /&gt;</description>
      <comments>http://www.mindfusioncorp.com/weblog/CommentView,guid,263c1425-729e-4dae-b47c-5f88e61299e8.aspx</comments>
      <category>Events</category>
      <category>General</category>
      <category>Silverlight</category>
      <category>WPF</category>
    </item>
    <item>
      <trackback:ping>http://www.mindfusioncorp.com/weblog/Trackback.aspx?guid=a207c534-3e58-4daf-8de0-a203f31ad191</trackback:ping>
      <pingback:server>http://www.mindfusioncorp.com/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mindfusioncorp.com/weblog/PermaLink,guid,a207c534-3e58-4daf-8de0-a203f31ad191.aspx</pingback:target>
      <dc:creator>Keith Rome</dc:creator>
      <wfw:comment>http://www.mindfusioncorp.com/weblog/CommentView,guid,a207c534-3e58-4daf-8de0-a203f31ad191.aspx</wfw:comment>
      <wfw:commentRss>http://www.mindfusioncorp.com/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=a207c534-3e58-4daf-8de0-a203f31ad191</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I ran across <a href="http://www.soundsnap.com/">SoundSnap</a> today – what a great
resource for finding free sound effects and music loops. For those participating in
the <a href="http://www.ggmug.com/">GGMUG</a> Silverlight Game Development Contest,
this might come in handy for you, so please check it out!
</p>
        <p>
          <a title="http://www.soundsnap.com/" href="http://www.soundsnap.com/">http://www.soundsnap.com/</a>
        </p>
        <p>
By the way, the GGMUG is a great venue to meet new people who are passionate about
.NET development. If you live on the East side of town, and just can’t make it to
those Alpharetta meetings held by the other user groups, then please check this new
group out if you haven’t already.
</p>
        <img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=a207c534-3e58-4daf-8de0-a203f31ad191" />
      </body>
      <title>Excellent Free Sound Effects Resource</title>
      <guid isPermaLink="false">http://www.mindfusioncorp.com/weblog/PermaLink,guid,a207c534-3e58-4daf-8de0-a203f31ad191.aspx</guid>
      <link>http://www.mindfusioncorp.com/weblog/2008/06/19/ExcellentFreeSoundEffectsResource.aspx</link>
      <pubDate>Thu, 19 Jun 2008 18:17:48 GMT</pubDate>
      <description>&lt;p&gt;
I ran across &lt;a href="http://www.soundsnap.com/"&gt;SoundSnap&lt;/a&gt; today – what a great
resource for finding free sound effects and music loops. For those participating in
the &lt;a href="http://www.ggmug.com/"&gt;GGMUG&lt;/a&gt; Silverlight Game Development Contest,
this might come in handy for you, so please check it out!
&lt;/p&gt;
&lt;p&gt;
&lt;a title="http://www.soundsnap.com/" href="http://www.soundsnap.com/"&gt;http://www.soundsnap.com/&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
By the way, the GGMUG is a great venue to meet new people who are passionate about
.NET development. If you live on the East side of town, and just can’t make it to
those Alpharetta meetings held by the other user groups, then please check this new
group out if you haven’t already.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=a207c534-3e58-4daf-8de0-a203f31ad191" /&gt;</description>
      <comments>http://www.mindfusioncorp.com/weblog/CommentView,guid,a207c534-3e58-4daf-8de0-a203f31ad191.aspx</comments>
      <category>Games</category>
      <category>General</category>
      <category>Media</category>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.mindfusioncorp.com/weblog/Trackback.aspx?guid=ce802397-894c-4772-994b-5d5ba4df3fda</trackback:ping>
      <pingback:server>http://www.mindfusioncorp.com/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mindfusioncorp.com/weblog/PermaLink,guid,ce802397-894c-4772-994b-5d5ba4df3fda.aspx</pingback:target>
      <dc:creator>Keith Rome</dc:creator>
      <wfw:comment>http://www.mindfusioncorp.com/weblog/CommentView,guid,ce802397-894c-4772-994b-5d5ba4df3fda.aspx</wfw:comment>
      <wfw:commentRss>http://www.mindfusioncorp.com/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=ce802397-894c-4772-994b-5d5ba4df3fda</wfw:commentRss>
      <slash:comments>7</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Audio support is all too often one of the last things a developer thinks of when it
comes to building a user interface. Fortunately, Silverlight offers some basic building
blocks that make it fairly trivial to add event-driven sounds to our applications.
I have taken the built-in functionality one step further, and created a simple run-time
audio engine that makes it even easier.
</p>
        <p>
First, I will discuss the requirements that I had in mind when I created this engine.
Second, I will discuss the ideal API for a complete solution. Third, I submit the
simple effects engine that I developed in order to meet those requirements and API.
</p>
        <p>
          <strong>Sound Effects Engine Requirements</strong>
        </p>
        <ul>
          <li>
Must be able to play looping “background music” tracks. 
</li>
          <li>
Must be able to play smaller sound effects on demand. 
</li>
          <li>
Must support concurrent (and overlapping) sounds effects without interfering with
already-playing audio. 
</li>
          <li>
Must adequately handle the possibility of download delays when pulling down external
audio files. 
</li>
          <li>
Should cache audio files between playbacks. 
</li>
          <li>
Should allow serving of audio from high-bandwidth CDN such as Silverlight Streaming. 
</li>
        </ul>
        <p>
          <strong>An Ideal Sound Effects API</strong>
        </p>
        <ul>
          <li>
Should be very approachable. If possible, only a single line of code to play any audio
(similar to PlaySound() API). 
</li>
          <li>
Should support any formats supported by Silverlight. 
</li>
          <li>
Should be efficient. 
</li>
          <li>
Should offer download and playback completion callbacks (for chaining and synchronization). 
</li>
          <li>
Should support aggressive background pre-caching of audio files. 
</li>
        </ul>
        <p>
          <strong>The SilverlightToolbox Solution</strong>
        </p>
        <p>
To address the simplicity requirements, this sound effects engine is implemented as
a single static C# class that can be easily included into any Silverlight project.
It can exist in a referenced class library, or can be linked directly into the main
project.
</p>
        <p>
To address looping background music, a single method SetBackgroundLoop() is supplied.
This will begin playback of a single audio clip, and will automatically repeat it.
Only one track can be played as the background loop – calling this method again will
terminate the running track and start the new one. You can also pass String.Empty
to stop all background music.
</p>
        <p>
To address typical sound effect clips. two overloads of the PlaySoundEffect() method
are supplied. The simpler of the two methods will simply play a clip once it has been
downloaded. The extended version allows you to specify a callback for when the clip
has been downloaded and started playing, and a second callback that can be used for
notification that the clip has ended.
</p>
        <p>
To address the scenario where multiple sound effects might be played at the same time,
the engine internally maintains a queue of MediaElements. When a new sound needs to
played, it pulls an unused element and puts it into service. Once the sound is finished,
the element is returned to the queue. This allows Silverlight itself to handle media
mixing, and by caching those MediaElements, it does so without placing undue stress
on the environment.
</p>
        <p>
To address the issue of download delays, the startedCallback and completedCallback
parameters of PlaySoundEffect() were introduced.
</p>
        <p>
To address caching of audio files, a WebClient is used (which in turn leverages the
browser’s cache). Furthermore, the engine will reuse any downloaded file streams (and
is smart enough to not re-queue the same file if it already queued for download).
</p>
        <p>
By using a MediaElement for playback, audio tracks are automatically supported from
streaming sources and Content Delivery Networks, and can be of any type supported
by Silverlight.
</p>
        <p>
To support chaining of audio effects, and to support synchronization of UI with audio,
the PlaySoundEffect() method accepts callback events that are fired when the clip
has been downloaded, and again when it has completed playback. To further help with
UI synchronization, a second utility class is provided (DelayedAction) which provides
a simple wrapper for BackgroundWorker that can be used to easily delay execution of
a block of code after a specified amount of time.
</p>
        <p>
To support pre-caching of audio files, the PreloadMedia() method can be used.
</p>
        <p>
          <strong>Typical usage:</strong>
        </p>
        <p>
In order for the sound effects engine to function properly, it must be provided with
a top-level XAML container (MediaElement currently will not perform playback without
a parent object). This is done by calling the Initialize() method, typically from
your program’s startup code:
</p>
        <div>
          <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">SoundEffects.Initialize(<span style="color: #0000ff">this</span>.LayoutRoot);</pre>
        </div>
        <p>
 
</p>
        <p>
After this has been done, background music can be played, and we can also queue up
some sound effect clips for later:
</p>
        <div>
          <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">SoundEffects.SetBackgroundLoop(<span style="color: #006080">"cautious-path.wma"</span>);
SoundEffects.PreloadMedia(<span style="color: #006080">"pop1.wma"</span>);</pre>
        </div>
        <p>
 
</p>
        <p>
Then, at various points throughout the application, we can play the sound effect (for
example, in response to a control event):
</p>
        <div>
          <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">SoundEffects.PlaySoundEffect(<span style="color: #006080">"pop1.wma"</span>);</pre>
        </div>
        <p>
 
</p>
        <p>
If at any point we need to delay the sound effect slightly, we can control this be
introducing a short delay:
</p>
        <div>
          <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">DelayedAction.Execute(2.0, () =&gt; SoundEffects.PlaySoundEffect(<span style="color: #006080">"pop1.wma"</span>));</pre>
        </div>
        <p>
 
</p>
        <p>
Complete Source Code for DelayedAction.cs:
</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: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 1:</span>
              <span style="color: #0000ff">using</span> System;</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">using</span> System.ComponentModel;</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"> 3:</span>
              <span style="color: #0000ff">using</span> System.Threading;</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: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 5:</span>
              <span style="color: #0000ff">namespace</span> Wintellect.SilverlightToolbox</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: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 7:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">class</span> DelayedAction</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> {</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"> 9:</span>
              <span style="color: #0000ff">class</span> DelayedCallback</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> {</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"> 11:</span>
              <span style="color: #0000ff">public</span> TimeSpan
Delay { 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: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 12:</span>
              <span style="color: #0000ff">public</span> Action
Callback { 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: #f4f4f4; 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: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 15:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">static</span>
              <span style="color: #0000ff">void</span> Execute(<span style="color: #0000ff">double</span> seconds,
Action callback)</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: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 17:</span> BackgroundWorker
Delay = <span style="color: #0000ff">new</span> BackgroundWorker();</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> Delay.DoWork
+= (s, e) =&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"> 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> DelayedCallback
DelayCallback = (DelayedCallback)e.Argument;</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"> 21:</span> Thread.Sleep(DelayCallback.Delay);</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> e.Result
= DelayCallback.Callback;</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"> 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> Delay.RunWorkerCompleted
+= (s, e) =&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"> 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> Action
Callback = e.Result <span style="color: #0000ff">as</span> Action;</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"> 27:</span> Callback();</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: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 29:</span> Delay.RunWorkerAsync(<span style="color: #0000ff">new</span> DelayedCallback</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: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 31:</span> Delay
= TimeSpan.FromSeconds(seconds),</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> Callback
= callback</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"> 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: #f4f4f4; 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> }</pre>
          </div>
        </div>
        <p>
 
</p>
        <p>
Complete Source Code for SoundEffects.cs:
</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: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 1:</span>
              <span style="color: #0000ff">using</span> System;</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">using</span> System.Collections.Generic;</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"> 3:</span>
              <span style="color: #0000ff">using</span> System.IO;</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">using</span> System.Net;</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"> 5:</span>
              <span style="color: #0000ff">using</span> System.Windows;</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">using</span> System.Windows.Controls;</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"> 7:</span>
              <span style="color: #0000ff">using</span> System.Windows.Media;</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>  </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"> 9:</span>
              <span style="color: #0000ff">namespace</span> Wintellect.SilverlightToolbox</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> {</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"> 11:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">static</span>
              <span style="color: #0000ff">class</span> SoundEffects</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: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 13:</span>
              <span style="color: #0000ff">static</span> Panel
Root;</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">static</span> MediaElement
BackgroundLoop = <span style="color: #0000ff">new</span> MediaElement();</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"> 15:</span>
              <span style="color: #0000ff">static</span> WebClient
EffectDownloader = <span style="color: #0000ff">new</span> WebClient();</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: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 17:</span>
              <span style="color: #0000ff">static</span> Queue&lt;MediaElement&gt;
AvailableSoundEffectGenerators = <span style="color: #0000ff">new</span> Queue&lt;MediaElement&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"> 18:</span>
              <span style="color: #0000ff">static</span> Dictionary&lt;<span style="color: #0000ff">string</span>,
Stream&gt; DownloadedEffects = <span style="color: #0000ff">new</span> Dictionary&lt;<span style="color: #0000ff">string</span>,
Stream&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"> 19:</span>
              <span style="color: #0000ff">static</span> Queue&lt;<span style="color: #0000ff">string</span>&gt;
PendingDownloads = <span style="color: #0000ff">new</span> Queue&lt;<span style="color: #0000ff">string</span>&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"> 20:</span>
              <span style="color: #0000ff">static</span> Queue&lt;QueuedEffect&gt;
PendingEffects = <span style="color: #0000ff">new</span> Queue&lt;QueuedEffect&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"> 21:</span>
              <span style="color: #0000ff">static</span> Dictionary&lt;MediaElement,
Action&gt; PendingStartupCallbacks = <span style="color: #0000ff">new</span> Dictionary&lt;MediaElement,
Action&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"> 22:</span>
              <span style="color: #0000ff">static</span> Dictionary&lt;MediaElement,
Action&gt; PendingCompletionCallbacks = <span style="color: #0000ff">new</span> Dictionary&lt;MediaElement,
Action&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"> 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>
              <span style="color: #0000ff">enum</span> TargetType</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"> 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> BackgroundMusic,</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"> 27:</span> SoundEffect,</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: #f4f4f4; 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">class</span> QueuedEffect</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"> 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">public</span>
              <span style="color: #0000ff">string</span> MediaName
{ 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: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 33:</span>
              <span style="color: #0000ff">public</span> TargetType
Target { 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: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 34:</span>
              <span style="color: #0000ff">public</span> Action
StartedCallback { 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: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 35:</span>
              <span style="color: #0000ff">public</span> Action
CompletedCallback { 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: #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: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 37:</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"> 38:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">static</span>
              <span style="color: #0000ff">void</span> Initialize(Panel
root)</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"> 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> Root
= root;</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"> 41:</span> InitializeTarget(root,
BackgroundLoop);</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> EffectDownloader.OpenReadCompleted
+= (s, e) =&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"> 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> DownloadedEffects[(<span style="color: #0000ff">string</span>)e.UserState]
= e.Result;</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"> 45:</span> DownloadEffects();</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> PlayEffect();</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"> 47:</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"> 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: #f4f4f4; 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">static</span>
              <span style="color: #0000ff">void</span> DownloadEffects()</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"> 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">if</span> (PendingDownloads.Count
== 0)</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"> 53:</span>
              <span style="color: #0000ff">return</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>
              <span style="color: #0000ff">string</span> MediaName
= PendingDownloads.Dequeue();</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"> 55:</span> EffectDownloader.OpenReadAsync(<span style="color: #0000ff">new</span> Uri(MediaName,
UriKind.Relative), MediaName);</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: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 57:</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"> 58:</span>
              <span style="color: #0000ff">static</span>
              <span style="color: #0000ff">void</span> InitializeTarget(Panel
root, MediaElement target)</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"> 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> target.Width
= 0;</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"> 61:</span> target.Height
= 0;</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> target.Visibility
= Visibility.Collapsed;</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"> 63:</span> root.Children.Add(target);</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> target.AutoPlay
= <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: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 65:</span> target.MediaOpened
+= (s, e) =&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"> 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: #f4f4f4; border-bottom-style: none">
              <span style="color: #606060"> 67:</span> MediaElement
Target = s <span style="color: #0000ff">as</span> MediaElement;</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> Target.Volume
= 0.35;</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"> 69:</span> Target.Play();</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>
              <span style="color: #0000ff">if</span> (PendingStartupCallbacks.ContainsKey(Target))</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"> 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> Target.Dispatcher.BeginInvoke(PendingStartupCallbacks[Target]);</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"> 73:</span> PendingStartupCallbacks.Remove(Target);</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"> 74:</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"> 75:</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"> 76:</span> target.MediaEnded
+= (s, e) =&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"> 77:</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"> 78:</span> MediaElement
Target = s <span style="color: #0000ff">as</span> MediaElement;</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"> 79:</span> Target.Stop();</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"> 80:</span>
              <span style="color: #0000ff">if</span> (s
== BackgroundLoop)</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"> 81:</span> Target.Play();</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"> 82:</span>
              <span style="color: #0000ff">else</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"> 83:</span> AvailableSoundEffectGenerators.Enqueue(Target);</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"> 84:</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"> 85:</span>
              <span style="color: #0000ff">if</span> (PendingCompletionCallbacks.ContainsKey(Target))</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"> 86:</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"> 87:</span> Target.Dispatcher.BeginInvoke(PendingCompletionCallbacks[Target]);</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"> 88:</span> PendingCompletionCallbacks.Remove(Target);</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"> 89:</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"> 90:</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"> 91:</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"> 92:</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"> 93:</span>
              <span style="color: #0000ff">static</span> MediaElement
GetUnusedEffectGenerator()</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"> 94:</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"> 95:</span>
              <span style="color: #0000ff">if</span> (AvailableSoundEffectGenerators.Count
&gt; 0)</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"> 96:</span>
              <span style="color: #0000ff">return</span> AvailableSoundEffectGenerators.Dequeue();</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"> 97:</span>
              <span style="color: #0000ff">else</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"> 98:</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"> 99:</span> MediaElement
Result = <span style="color: #0000ff">new</span> MediaElement();</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"> 100:</span> InitializeTarget(Root,
Result);</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"> 101:</span>
              <span style="color: #0000ff">return</span> Result;</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"> 102:</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"> 103:</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"> 104:</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"> 105:</span>
              <span style="color: #0000ff">static</span>
              <span style="color: #0000ff">void</span> PlayEffect()</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"> 106:</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"> 107:</span>
              <span style="color: #0000ff">lock</span> (PendingEffects)</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"> 108:</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"> 109:</span>
              <span style="color: #0000ff">if</span> (PendingEffects.Count
== 0)</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"> 110:</span>
              <span style="color: #0000ff">return</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"> 111:</span> QueuedEffect
Effect = PendingEffects.Dequeue();</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"> 112:</span>
              <span style="color: #0000ff">if</span> (DownloadedEffects.ContainsKey(Effect.MediaName))</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"> 113:</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"> 114:</span> MediaElement
TargetElement = <span style="color: #0000ff">null</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"> 115:</span>
              <span style="color: #0000ff">switch</span> (Effect.Target)</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"> 116:</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"> 117:</span>
              <span style="color: #0000ff">case</span> TargetType.BackgroundMusic:</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"> 118:</span> {
TargetElement = BackgroundLoop; <span style="color: #0000ff">break</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"> 119:</span>
              <span style="color: #0000ff">case</span> TargetType.SoundEffect:</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"> 120:</span> {
TargetElement = GetUnusedEffectGenerator(); <span style="color: #0000ff">break</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"> 121:</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"> 122:</span>
              <span style="color: #0000ff">if</span> (Effect.StartedCallback
!= <span style="color: #0000ff">null</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"> 123:</span> PendingStartupCallbacks.Add(TargetElement,
Effect.StartedCallback);</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"> 124:</span>
              <span style="color: #0000ff">if</span> (Effect.CompletedCallback
!= <span style="color: #0000ff">null</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"> 125:</span> PendingCompletionCallbacks.Add(TargetElement,
Effect.CompletedCallback);</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"> 126:</span> TargetElement.SetSource(DownloadedEffects[Effect.MediaName]);</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"> 127:</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"> 128:</span>
              <span style="color: #0000ff">else</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"> 129:</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"> 130:</span> PendingEffects.Enqueue(Effect);</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"> 131:</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"> 132:</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"> 133:</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"> 134:</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"> 135:</span>
              <span style="color: #0000ff">static</span>
              <span style="color: #0000ff">void</span> PlaySound(TargetType
target, <span style="color: #0000ff">string</span> mediaName, Action startedCallback,
Action completedCallback)</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"> 136:</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"> 137:</span>
              <span style="color: #0000ff">if</span> (target
== TargetType.BackgroundMusic)</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"> 138:</span>
              <span style="color: #0000ff">if</span> (BackgroundLoop.CurrentState
!= MediaElementState.Stopped)</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"> 139:</span> BackgroundLoop.Stop();</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"> 140:</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"> 141:</span>
              <span style="color: #0000ff">if</span> (mediaName
!= String.Empty)</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"> 142:</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"> 143:</span>
              <span style="color: #0000ff">lock</span> (PendingEffects)</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"> 144:</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"> 145:</span>
              <span style="color: #0000ff">if</span> (!DownloadedEffects.ContainsKey(mediaName))</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"> 146:</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"> 147:</span> PendingDownloads.Enqueue(mediaName);</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"> 148:</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"> 149:</span> PendingEffects.Enqueue(<span style="color: #0000ff">new</span> QueuedEffect</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"> 150:</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"> 151:</span> MediaName
= mediaName,</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"> 152:</span> Target
= target,</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"> 153:</span> StartedCallback
= startedCallback,</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"> 154:</span> CompletedCallback
= completedCallback</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"> 155:</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"> 156:</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"> 157:</span> DownloadEffects();</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"> 158:</span> PlayEffect();</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"> 159:</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"> 160:</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"> 161:</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"> 162:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">static</span>
              <span style="color: #0000ff">void</span> SetBackgroundLoop(<span style="color: #0000ff">string</span> mediaName)</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"> 163:</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"> 164:</span> PlaySound(TargetType.BackgroundMusic,
mediaName, <span style="color: #0000ff">null</span>, <span style="color: #0000ff">null</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"> 165:</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"> 166:</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"> 167:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">static</span>
              <span style="color: #0000ff">void</span> PlaySoundEffect(<span style="color: #0000ff">string</span> effectName)</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"> 168:</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"> 169:</span> PlaySound(TargetType.SoundEffect,
effectName, <span style="color: #0000ff">null</span>, <span style="color: #0000ff">null</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"> 170:</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"> 171:</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"> 172:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">static</span>
              <span style="color: #0000ff">void</span> PlaySoundEffect(<span style="color: #0000ff">string</span> effectName,
Action startedCallback, Action completedCallback)</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"> 173:</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"> 174:</span> PlaySound(TargetType.SoundEffect,
effectName, startedCallback, completedCallback);</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"> 175:</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"> 176:</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"> 177:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">static</span>
              <span style="color: #0000ff">void</span> PreloadMedia(<span style="color: #0000ff">string</span> mediaName)</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"> 178:</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"> 179:</span>
              <span style="color: #0000ff">if</span> (!DownloadedEffects.ContainsKey(mediaName))</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"> 180:</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"> 181:</span> PendingDownloads.Enqueue(mediaName);</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"> 182:</span> DownloadEffects();</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"> 183:</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"> 184:</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"> 185:</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"> 186:</span> }</pre>
          </div>
        </div>
        <img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=ce802397-894c-4772-994b-5d5ba4df3fda" />
      </body>
      <title>A Simple Sound Effects Engine for Silverlight 2</title>
      <guid isPermaLink="false">http://www.mindfusioncorp.com/weblog/PermaLink,guid,ce802397-894c-4772-994b-5d5ba4df3fda.aspx</guid>
      <link>http://www.mindfusioncorp.com/weblog/2008/06/09/ASimpleSoundEffectsEngineForSilverlight2.aspx</link>
      <pubDate>Mon, 09 Jun 2008 21:59:22 GMT</pubDate>
      <description>&lt;p&gt;
Audio support is all too often one of the last things a developer thinks of when it
comes to building a user interface. Fortunately, Silverlight offers some basic building
blocks that make it fairly trivial to add event-driven sounds to our applications.
I have taken the built-in functionality one step further, and created a simple run-time
audio engine that makes it even easier.
&lt;/p&gt;
&lt;p&gt;
First, I will discuss the requirements that I had in mind when I created this engine.
Second, I will discuss the ideal API for a complete solution. Third, I submit the
simple effects engine that I developed in order to meet those requirements and API.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Sound Effects Engine Requirements&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Must be able to play looping “background music” tracks. 
&lt;/li&gt;
&lt;li&gt;
Must be able to play smaller sound effects on demand. 
&lt;/li&gt;
&lt;li&gt;
Must support concurrent (and overlapping) sounds effects without interfering with
already-playing audio. 
&lt;/li&gt;
&lt;li&gt;
Must adequately handle the possibility of download delays when pulling down external
audio files. 
&lt;/li&gt;
&lt;li&gt;
Should cache audio files between playbacks. 
&lt;/li&gt;
&lt;li&gt;
Should allow serving of audio from high-bandwidth CDN such as Silverlight Streaming. 
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;strong&gt;An Ideal Sound Effects API&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Should be very approachable. If possible, only a single line of code to play any audio
(similar to PlaySound() API). 
&lt;/li&gt;
&lt;li&gt;
Should support any formats supported by Silverlight. 
&lt;/li&gt;
&lt;li&gt;
Should be efficient. 
&lt;/li&gt;
&lt;li&gt;
Should offer download and playback completion callbacks (for chaining and synchronization). 
&lt;/li&gt;
&lt;li&gt;
Should support aggressive background pre-caching of audio files. 
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;strong&gt;The SilverlightToolbox Solution&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
To address the simplicity requirements, this sound effects engine is implemented as
a single static C# class that can be easily included into any Silverlight project.
It can exist in a referenced class library, or can be linked directly into the main
project.
&lt;/p&gt;
&lt;p&gt;
To address looping background music, a single method SetBackgroundLoop() is supplied.
This will begin playback of a single audio clip, and will automatically repeat it.
Only one track can be played as the background loop – calling this method again will
terminate the running track and start the new one. You can also pass String.Empty
to stop all background music.
&lt;/p&gt;
&lt;p&gt;
To address typical sound effect clips. two overloads of the PlaySoundEffect() method
are supplied. The simpler of the two methods will simply play a clip once it has been
downloaded. The extended version allows you to specify a callback for when the clip
has been downloaded and started playing, and a second callback that can be used for
notification that the clip has ended.
&lt;/p&gt;
&lt;p&gt;
To address the scenario where multiple sound effects might be played at the same time,
the engine internally maintains a queue of MediaElements. When a new sound needs to
played, it pulls an unused element and puts it into service. Once the sound is finished,
the element is returned to the queue. This allows Silverlight itself to handle media
mixing, and by caching those MediaElements, it does so without placing undue stress
on the environment.
&lt;/p&gt;
&lt;p&gt;
To address the issue of download delays, the startedCallback and completedCallback
parameters of PlaySoundEffect() were introduced.
&lt;/p&gt;
&lt;p&gt;
To address caching of audio files, a WebClient is used (which in turn leverages the
browser’s cache). Furthermore, the engine will reuse any downloaded file streams (and
is smart enough to not re-queue the same file if it already queued for download).
&lt;/p&gt;
&lt;p&gt;
By using a MediaElement for playback, audio tracks are automatically supported from
streaming sources and Content Delivery Networks, and can be of any type supported
by Silverlight.
&lt;/p&gt;
&lt;p&gt;
To support chaining of audio effects, and to support synchronization of UI with audio,
the PlaySoundEffect() method accepts callback events that are fired when the clip
has been downloaded, and again when it has completed playback. To further help with
UI synchronization, a second utility class is provided (DelayedAction) which provides
a simple wrapper for BackgroundWorker that can be used to easily delay execution of
a block of code after a specified amount of time.
&lt;/p&gt;
&lt;p&gt;
To support pre-caching of audio files, the PreloadMedia() method can be used.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Typical usage:&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
In order for the sound effects engine to function properly, it must be provided with
a top-level XAML container (MediaElement currently will not perform playback without
a parent object). This is done by calling the Initialize() method, typically from
your program’s startup code:
&lt;/p&gt;
&lt;div&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;SoundEffects.Initialize(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.LayoutRoot);&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
&amp;#160;
&lt;/p&gt;
&lt;p&gt;
After this has been done, background music can be played, and we can also queue up
some sound effect clips for later:
&lt;/p&gt;
&lt;div&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;SoundEffects.SetBackgroundLoop(&lt;span style="color: #006080"&gt;&amp;quot;cautious-path.wma&amp;quot;&lt;/span&gt;);
SoundEffects.PreloadMedia(&lt;span style="color: #006080"&gt;&amp;quot;pop1.wma&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
&amp;#160;
&lt;/p&gt;
&lt;p&gt;
Then, at various points throughout the application, we can play the sound effect (for
example, in response to a control event):
&lt;/p&gt;
&lt;div&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;SoundEffects.PlaySoundEffect(&lt;span style="color: #006080"&gt;&amp;quot;pop1.wma&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
&amp;#160;
&lt;/p&gt;
&lt;p&gt;
If at any point we need to delay the sound effect slightly, we can control this be
introducing a short delay:
&lt;/p&gt;
&lt;div&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;DelayedAction.Execute(2.0, () =&amp;gt; SoundEffects.PlaySoundEffect(&lt;span style="color: #006080"&gt;&amp;quot;pop1.wma&amp;quot;&lt;/span&gt;));&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
&amp;#160;
&lt;/p&gt;
&lt;p&gt;
Complete Source Code for DelayedAction.cs:
&lt;/p&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4"&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.ComponentModel;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Threading;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 4:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 5:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; Wintellect.SilverlightToolbox&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 6:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 7:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; DelayedAction&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 8:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 9:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; DelayedCallback&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 10:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 11:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; TimeSpan
Delay { get; set; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 12:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; Action
Callback { get; set; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 13:&lt;/span&gt; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 14:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 15:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Execute(&lt;span style="color: #0000ff"&gt;double&lt;/span&gt; seconds,
Action callback)&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 16:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 17:&lt;/span&gt; BackgroundWorker
Delay = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; BackgroundWorker();&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 18:&lt;/span&gt; Delay.DoWork
+= (s, e) =&amp;gt;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 19:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 20:&lt;/span&gt; DelayedCallback
DelayCallback = (DelayedCallback)e.Argument;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 21:&lt;/span&gt; Thread.Sleep(DelayCallback.Delay);&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 22:&lt;/span&gt; e.Result
= DelayCallback.Callback;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 23:&lt;/span&gt; };&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 24:&lt;/span&gt; Delay.RunWorkerCompleted
+= (s, e) =&amp;gt;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 25:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 26:&lt;/span&gt; Action
Callback = e.Result &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; Action;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 27:&lt;/span&gt; Callback();&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 28:&lt;/span&gt; };&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 29:&lt;/span&gt; Delay.RunWorkerAsync(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; DelayedCallback&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 30:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 31:&lt;/span&gt; Delay
= TimeSpan.FromSeconds(seconds),&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 32:&lt;/span&gt; Callback
= callback&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 33:&lt;/span&gt; });&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 34:&lt;/span&gt; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 35:&lt;/span&gt; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 36:&lt;/span&gt; }&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
&amp;#160;
&lt;/p&gt;
&lt;p&gt;
Complete Source Code for SoundEffects.cs:
&lt;/p&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4"&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.IO;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 4:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Net;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 5:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Windows;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 6:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Windows.Controls;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 7:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Windows.Media;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 8:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 9:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; Wintellect.SilverlightToolbox&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 10:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 11:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; SoundEffects&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 12:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 13:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; Panel
Root;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 14:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; MediaElement
BackgroundLoop = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; MediaElement();&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 15:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; WebClient
EffectDownloader = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; WebClient();&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 16:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 17:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; Queue&amp;lt;MediaElement&amp;gt;
AvailableSoundEffectGenerators = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Queue&amp;lt;MediaElement&amp;gt;();&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 18:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; Dictionary&amp;lt;&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;,
Stream&amp;gt; DownloadedEffects = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Dictionary&amp;lt;&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;,
Stream&amp;gt;();&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 19:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; Queue&amp;lt;&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;&amp;gt;
PendingDownloads = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Queue&amp;lt;&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;&amp;gt;();&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 20:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; Queue&amp;lt;QueuedEffect&amp;gt;
PendingEffects = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Queue&amp;lt;QueuedEffect&amp;gt;();&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 21:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; Dictionary&amp;lt;MediaElement,
Action&amp;gt; PendingStartupCallbacks = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Dictionary&amp;lt;MediaElement,
Action&amp;gt;();&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 22:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; Dictionary&amp;lt;MediaElement,
Action&amp;gt; PendingCompletionCallbacks = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Dictionary&amp;lt;MediaElement,
Action&amp;gt;();&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 23:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 24:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;enum&lt;/span&gt; TargetType&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 25:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 26:&lt;/span&gt; BackgroundMusic,&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 27:&lt;/span&gt; SoundEffect,&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 28:&lt;/span&gt; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 29:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 30:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; QueuedEffect&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 31:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 32:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; MediaName
{ get; set; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 33:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; TargetType
Target { get; set; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 34:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; Action
StartedCallback { get; set; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 35:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; Action
CompletedCallback { get; set; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 36:&lt;/span&gt; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 37:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 38:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Initialize(Panel
root)&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 39:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 40:&lt;/span&gt; Root
= root;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 41:&lt;/span&gt; InitializeTarget(root,
BackgroundLoop);&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 42:&lt;/span&gt; EffectDownloader.OpenReadCompleted
+= (s, e) =&amp;gt;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 43:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 44:&lt;/span&gt; DownloadedEffects[(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;)e.UserState]
= e.Result;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 45:&lt;/span&gt; DownloadEffects();&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 46:&lt;/span&gt; PlayEffect();&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 47:&lt;/span&gt; };&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 48:&lt;/span&gt; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 49:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 50:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; DownloadEffects()&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 51:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 52:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (PendingDownloads.Count
== 0)&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 53:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;return&lt;/span&gt;;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 54:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; MediaName
= PendingDownloads.Dequeue();&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 55:&lt;/span&gt; EffectDownloader.OpenReadAsync(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Uri(MediaName,
UriKind.Relative), MediaName);&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 56:&lt;/span&gt; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 57:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 58:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; InitializeTarget(Panel
root, MediaElement target)&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 59:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 60:&lt;/span&gt; target.Width
= 0;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 61:&lt;/span&gt; target.Height
= 0;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 62:&lt;/span&gt; target.Visibility
= Visibility.Collapsed;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 63:&lt;/span&gt; root.Children.Add(target);&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 64:&lt;/span&gt; target.AutoPlay
= &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 65:&lt;/span&gt; target.MediaOpened
+= (s, e) =&amp;gt;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 66:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 67:&lt;/span&gt; MediaElement
Target = s &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; MediaElement;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 68:&lt;/span&gt; Target.Volume
= 0.35;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 69:&lt;/span&gt; Target.Play();&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 70:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (PendingStartupCallbacks.ContainsKey(Target))&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 71:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 72:&lt;/span&gt; Target.Dispatcher.BeginInvoke(PendingStartupCallbacks[Target]);&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 73:&lt;/span&gt; PendingStartupCallbacks.Remove(Target);&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 74:&lt;/span&gt; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 75:&lt;/span&gt; };&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 76:&lt;/span&gt; target.MediaEnded
+= (s, e) =&amp;gt;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 77:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 78:&lt;/span&gt; MediaElement
Target = s &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; MediaElement;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 79:&lt;/span&gt; Target.Stop();&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 80:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (s
== BackgroundLoop)&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 81:&lt;/span&gt; Target.Play();&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 82:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 83:&lt;/span&gt; AvailableSoundEffectGenerators.Enqueue(Target);&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 84:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 85:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (PendingCompletionCallbacks.ContainsKey(Target))&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 86:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 87:&lt;/span&gt; Target.Dispatcher.BeginInvoke(PendingCompletionCallbacks[Target]);&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 88:&lt;/span&gt; PendingCompletionCallbacks.Remove(Target);&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 89:&lt;/span&gt; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 90:&lt;/span&gt; };&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 91:&lt;/span&gt; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 92:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 93:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; MediaElement
GetUnusedEffectGenerator()&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 94:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 95:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (AvailableSoundEffectGenerators.Count
&amp;gt; 0)&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 96:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; AvailableSoundEffectGenerators.Dequeue();&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 97:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 98:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 99:&lt;/span&gt; MediaElement
Result = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; MediaElement();&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 100:&lt;/span&gt; InitializeTarget(Root,
Result);&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 101:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; Result;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 102:&lt;/span&gt; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 103:&lt;/span&gt; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 104:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 105:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; PlayEffect()&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 106:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 107:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;lock&lt;/span&gt; (PendingEffects)&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 108:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 109:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (PendingEffects.Count
== 0)&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 110:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;return&lt;/span&gt;;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 111:&lt;/span&gt; QueuedEffect
Effect = PendingEffects.Dequeue();&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 112:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (DownloadedEffects.ContainsKey(Effect.MediaName))&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 113:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 114:&lt;/span&gt; MediaElement
TargetElement = &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 115:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;switch&lt;/span&gt; (Effect.Target)&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 116:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 117:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;case&lt;/span&gt; TargetType.BackgroundMusic:&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 118:&lt;/span&gt; {
TargetElement = BackgroundLoop; &lt;span style="color: #0000ff"&gt;break&lt;/span&gt;; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 119:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;case&lt;/span&gt; TargetType.SoundEffect:&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 120:&lt;/span&gt; {
TargetElement = GetUnusedEffectGenerator(); &lt;span style="color: #0000ff"&gt;break&lt;/span&gt;;
}&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 121:&lt;/span&gt; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 122:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (Effect.StartedCallback
!= &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 123:&lt;/span&gt; PendingStartupCallbacks.Add(TargetElement,
Effect.StartedCallback);&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 124:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (Effect.CompletedCallback
!= &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 125:&lt;/span&gt; PendingCompletionCallbacks.Add(TargetElement,
Effect.CompletedCallback);&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 126:&lt;/span&gt; TargetElement.SetSource(DownloadedEffects[Effect.MediaName]);&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 127:&lt;/span&gt; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 128:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 129:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 130:&lt;/span&gt; PendingEffects.Enqueue(Effect);&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 131:&lt;/span&gt; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 132:&lt;/span&gt; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 133:&lt;/span&gt; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 134:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 135:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; PlaySound(TargetType
target, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; mediaName, Action startedCallback,
Action completedCallback)&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 136:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 137:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (target
== TargetType.BackgroundMusic)&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 138:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (BackgroundLoop.CurrentState
!= MediaElementState.Stopped)&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 139:&lt;/span&gt; BackgroundLoop.Stop();&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 140:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 141:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (mediaName
!= String.Empty)&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 142:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 143:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;lock&lt;/span&gt; (PendingEffects)&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 144:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 145:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!DownloadedEffects.ContainsKey(mediaName))&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 146:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 147:&lt;/span&gt; PendingDownloads.Enqueue(mediaName);&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 148:&lt;/span&gt; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 149:&lt;/span&gt; PendingEffects.Enqueue(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; QueuedEffect&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 150:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 151:&lt;/span&gt; MediaName
= mediaName,&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 152:&lt;/span&gt; Target
= target,&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 153:&lt;/span&gt; StartedCallback
= startedCallback,&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 154:&lt;/span&gt; CompletedCallback
= completedCallback&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 155:&lt;/span&gt; });&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 156:&lt;/span&gt; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 157:&lt;/span&gt; DownloadEffects();&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 158:&lt;/span&gt; PlayEffect();&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 159:&lt;/span&gt; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 160:&lt;/span&gt; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 161:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 162:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; SetBackgroundLoop(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; mediaName)&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 163:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 164:&lt;/span&gt; PlaySound(TargetType.BackgroundMusic,
mediaName, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;);&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 165:&lt;/span&gt; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 166:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 167:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; PlaySoundEffect(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; effectName)&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 168:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 169:&lt;/span&gt; PlaySound(TargetType.SoundEffect,
effectName, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;);&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 170:&lt;/span&gt; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 171:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 172:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; PlaySoundEffect(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; effectName,
Action startedCallback, Action completedCallback)&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 173:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 174:&lt;/span&gt; PlaySound(TargetType.SoundEffect,
effectName, startedCallback, completedCallback);&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 175:&lt;/span&gt; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 176:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 177:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; PreloadMedia(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; mediaName)&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 178:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 179:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!DownloadedEffects.ContainsKey(mediaName))&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 180:&lt;/span&gt; {&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 181:&lt;/span&gt; PendingDownloads.Enqueue(mediaName);&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 182:&lt;/span&gt; DownloadEffects();&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 183:&lt;/span&gt; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 184:&lt;/span&gt; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 185:&lt;/span&gt; }&lt;/pre&gt;
&lt;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, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 186:&lt;/span&gt; }&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=ce802397-894c-4772-994b-5d5ba4df3fda" /&gt;</description>
      <comments>http://www.mindfusioncorp.com/weblog/CommentView,guid,ce802397-894c-4772-994b-5d5ba4df3fda.aspx</comments>
      <category>.NET</category>
      <category>Games</category>
      <category>General</category>
      <category>Media</category>
      <category>Silverlight</category>
      <category>Tips and Tricks</category>
    </item>
    <item>
      <trackback:ping>http://www.mindfusioncorp.com/weblog/Trackback.aspx?guid=008ffecc-14c3-44bc-86c2-e7feecf4f94d</trackback:ping>
      <pingback:server>http://www.mindfusioncorp.com/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mindfusioncorp.com/weblog/PermaLink,guid,008ffecc-14c3-44bc-86c2-e7feecf4f94d.aspx</pingback:target>
      <dc:creator>Keith Rome</dc:creator>
      <wfw:comment>http://www.mindfusioncorp.com/weblog/CommentView,guid,008ffecc-14c3-44bc-86c2-e7feecf4f94d.aspx</wfw:comment>
      <wfw:commentRss>http://www.mindfusioncorp.com/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=008ffecc-14c3-44bc-86c2-e7feecf4f94d</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
As a follow-up to the previous post, I have entered Gem Blaster into a game development
contest held by the <a href="http://www.devx.com/RIA/Door/35735">Microsoft RIA Development
Center Portal</a> web site. I am happy to say that it has made it into the Finalists
group of 6 games that are being showcased for the next few weeks on the RIA web site:
</p>
        <p>
          <a title="http://www.devx.com/RIA/Door/37728" href="http://www.devx.com/RIA/Door/37728">http://www.devx.com/RIA/Door/37728</a>
        </p>
        <p>
The final judging is done based on popularity among visitors there. They basically
track number of visits to each game, as well as how long people stay there, whether
they come back and revisit, etc. So if you like it, please pass the link around to
your friends and ask them to check it out too.
</p>
        <img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=008ffecc-14c3-44bc-86c2-e7feecf4f94d" />
      </body>
      <title>Gem Blaster entered into &amp;quot;RIA Run&amp;quot; contest</title>
      <guid isPermaLink="false">http://www.mindfusioncorp.com/weblog/PermaLink,guid,008ffecc-14c3-44bc-86c2-e7feecf4f94d.aspx</guid>
      <link>http://www.mindfusioncorp.com/weblog/2008/06/01/GemBlasterEnteredIntoQuotRIARunquotContest.aspx</link>
      <pubDate>Sun, 01 Jun 2008 05:30:38 GMT</pubDate>
      <description>&lt;p&gt;
As a follow-up to the previous post, I have entered Gem Blaster into a game development
contest held by the &lt;a href="http://www.devx.com/RIA/Door/35735"&gt;Microsoft RIA Development
Center Portal&lt;/a&gt; web site. I am happy to say that it has made it into the Finalists
group of 6 games that are being showcased for the next few weeks on the RIA web site:
&lt;/p&gt;
&lt;p&gt;
&lt;a title="http://www.devx.com/RIA/Door/37728" href="http://www.devx.com/RIA/Door/37728"&gt;http://www.devx.com/RIA/Door/37728&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
The final judging is done based on popularity among visitors there. They basically
track number of visits to each game, as well as how long people stay there, whether
they come back and revisit, etc. So if you like it, please pass the link around to
your friends and ask them to check it out too.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=008ffecc-14c3-44bc-86c2-e7feecf4f94d" /&gt;</description>
      <comments>http://www.mindfusioncorp.com/weblog/CommentView,guid,008ffecc-14c3-44bc-86c2-e7feecf4f94d.aspx</comments>
      <category>Games</category>
      <category>General</category>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.mindfusioncorp.com/weblog/Trackback.aspx?guid=837ea3df-c41c-45b4-9dce-24fbae8f03ff</trackback:ping>
      <pingback:server>http://www.mindfusioncorp.com/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mindfusioncorp.com/weblog/PermaLink,guid,837ea3df-c41c-45b4-9dce-24fbae8f03ff.aspx</pingback:target>
      <dc:creator>Keith Rome</dc:creator>
      <wfw:comment>http://www.mindfusioncorp.com/weblog/CommentView,guid,837ea3df-c41c-45b4-9dce-24fbae8f03ff.aspx</wfw:comment>
      <wfw:commentRss>http://www.mindfusioncorp.com/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=837ea3df-c41c-45b4-9dce-24fbae8f03ff</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I finally got around to updating my Gem Blaster game from Silverlight 1.1 alpha to
the 2.0 beta bits. Since there were very heavy changes to the control model and other
aspects of the managed runtime, I had to rewrite a lot of the original code (this
was fully expected by the way). While I was in there, I also took the opportunity
to add a number of other new features such as a simple sound FX engine, a self-playing
"demo mode", and a bunch of other improvements.
</p>
        <p>
I intend to update CodePlex soon with the new source code, but for now you can try
out the game here (embedded below). It is hosted on the Silverlight Streaming service,
so feel free to pass the link around (it won't kill *my* servers). If you like, you
can also directly embed the game using the following embeddable HTML snippet:
</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">
          <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">&lt;iframe 
    src=<span style="color: #006080">"http://silverlight.services.live.com/invoke/5683/GemBlasterV2/iframe.html"</span> scrolling=<span style="color: #006080">"no"</span> frameborder=<span style="color: #006080">"0"</span> style=<span style="color: #006080">"width:800px;
height:625px"</span>&gt; &lt;/iframe&gt;</pre>
        </div>
        <p>
 
</p>
        <p>
          <iframe style="width: 700px; height: 547px" src="http://silverlight.services.live.com/invoke/5683/GemBlasterV2/iframe.html" frameborder="0" scrolling="no">
          </iframe>
        </p>
        <p>
Now that this project has been updated for Silverlight 2, I can move on to my next
game project idea which (I am hoping) should really push the runtime to its limits
:)
</p>
        <img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=837ea3df-c41c-45b4-9dce-24fbae8f03ff" />
      </body>
      <title>Gem Blaster updated and enhanced for Silverlight 2</title>
      <guid isPermaLink="false">http://www.mindfusioncorp.com/weblog/PermaLink,guid,837ea3df-c41c-45b4-9dce-24fbae8f03ff.aspx</guid>
      <link>http://www.mindfusioncorp.com/weblog/2008/05/13/GemBlasterUpdatedAndEnhancedForSilverlight2.aspx</link>
      <pubDate>Tue, 13 May 2008 21:37:56 GMT</pubDate>
      <description>&lt;p&gt;
I finally got around to updating my Gem Blaster game from Silverlight 1.1 alpha to
the 2.0 beta bits. Since there were very heavy changes to the control model and other
aspects of the managed runtime, I had to rewrite a lot of the original code (this
was fully expected by the way). While I was in there, I also took the opportunity
to add a number of other new features such as a simple sound FX engine, a self-playing
"demo mode", and a bunch of other improvements.
&lt;/p&gt;
&lt;p&gt;
I intend to update CodePlex soon with the new source code, but for now you can try
out the game here (embedded below). It is hosted on the Silverlight Streaming service,
so feel free to pass the link around (it won't kill *my* servers). If you like, you
can also directly embed the game using the following embeddable HTML snippet:
&lt;/p&gt;
&lt;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"&gt;&lt;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"&gt;&amp;lt;iframe 
    src=&lt;span style="color: #006080"&gt;"http://silverlight.services.live.com/invoke/5683/GemBlasterV2/iframe.html"&lt;/span&gt; scrolling=&lt;span style="color: #006080"&gt;"no"&lt;/span&gt; frameborder=&lt;span style="color: #006080"&gt;"0"&lt;/span&gt; style=&lt;span style="color: #006080"&gt;"width:800px;
height:625px"&lt;/span&gt;&amp;gt; &amp;lt;/iframe&amp;gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;iframe style="width: 700px; height: 547px" src="http://silverlight.services.live.com/invoke/5683/GemBlasterV2/iframe.html" frameborder="0" scrolling="no"&gt;
&lt;/iframe&gt;
&lt;/p&gt;
&lt;p&gt;
Now that this project has been updated for Silverlight 2, I can move on to my next
game project idea which (I am hoping) should really push the runtime to its limits
:)
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=837ea3df-c41c-45b4-9dce-24fbae8f03ff" /&gt;</description>
      <comments>http://www.mindfusioncorp.com/weblog/CommentView,guid,837ea3df-c41c-45b4-9dce-24fbae8f03ff.aspx</comments>
      <category>.NET</category>
      <category>Games</category>
      <category>General</category>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.mindfusioncorp.com/weblog/Trackback.aspx?guid=be21a35a-d4fb-48b8-9a91-833d10556a44</trackback:ping>
      <pingback:server>http://www.mindfusioncorp.com/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mindfusioncorp.com/weblog/PermaLink,guid,be21a35a-d4fb-48b8-9a91-833d10556a44.aspx</pingback:target>
      <dc:creator>Keith Rome</dc:creator>
      <wfw:comment>http://www.mindfusioncorp.com/weblog/CommentView,guid,be21a35a-d4fb-48b8-9a91-833d10556a44.aspx</wfw:comment>
      <wfw:commentRss>http://www.mindfusioncorp.com/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=be21a35a-d4fb-48b8-9a91-833d10556a44</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
This year I will be heading to <a href="http://visitmix.com/2008/default.aspx">MIX
in Vegas</a> along with thousands of other UX enthusiasts. I have always had a deep
interest in all things related to User Experience, and for the past couple years have
wished I could attend a MIX event, and finally this year I get to go!
</p>
        <p>
          <a href="http://visitmix.com/2008/default.aspx">
            <img style="border-right: 0px; border-top: 0px; margin: 0px 20px 0px 0px; border-left: 0px; border-bottom: 0px" height="186" alt="blings_9_25_d[1]" src="http://www.mindfusioncorp.com/weblog/content/binary/HeadingtoMIXthisyear_12AAC/blings_9_25_d1.jpg" width="136" align="left" border="0" />
          </a>
        </p>
        <p>
What will I be doing at MIX? Well I will certainly be soaking up any and all information
related to <a href="http://silverlight.net/default.aspx">Silverlight</a> and <a href="http://msdn2.microsoft.com/en-us/netframework/aa663326.aspx">WPF</a>.
I will also stick my head into some of the designer-oriented sessions. It's a good
thing to see how the other half lives. In between sessions I am hoping to meet all
kinds of people who are also passionate about UX. And of course this is Vegas, so
I am sure I will lose a few dollars in a casino at some point and drink more booze
than is healthy.
</p>
        <p>
Joining me will be a number of <a href="http://www.wintellect.com/">Wintellectuals</a> including <a href="http://www.wintellect.com/cs/blogs/sporter/default.aspx">Steve
Porter</a>, <a href="http://www.wintellect.com/TechnicalBioDetail.aspx?Tech=25">Sergio
Loscialo</a>, <a href="http://www.r2musings.com/">Rik Robinson</a>, <a href="http://www.wintellect.com/ManagmentBioDetail.aspx?Mgmt=11">Sara
Faatz</a>, and <a href="http://toddmichellesadie.spaces.live.com/default.aspx">Todd
Fine</a>. I know of a number of other local Atlanta folks will be making the trip
as well: <a href="http://ideakitchn.com/blogs/sean/default.aspx">Sean Gerety</a>, <a href="http://blogs.msdn.com/dougturn/">Doug
Turnure</a>, and <a href="http://adoguy.com/">Shawn Wildermuth</a> to name a few.
Are you going too? If so, let me know and we can get together for a cup of coffee
or a beer.
</p>
        <img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=be21a35a-d4fb-48b8-9a91-833d10556a44" />
      </body>
      <title>Heading to MIX this year</title>
      <guid isPermaLink="false">http://www.mindfusioncorp.com/weblog/PermaLink,guid,be21a35a-d4fb-48b8-9a91-833d10556a44.aspx</guid>
      <link>http://www.mindfusioncorp.com/weblog/2008/02/28/HeadingToMIXThisYear.aspx</link>
      <pubDate>Thu, 28 Feb 2008 02:11:59 GMT</pubDate>
      <description>&lt;p&gt;
This year I will be heading to &lt;a href="http://visitmix.com/2008/default.aspx"&gt;MIX
in Vegas&lt;/a&gt; along with thousands of other UX enthusiasts. I have always had a deep
interest in all things related to User Experience, and for the past couple years have
wished I could attend a MIX event, and finally this year I get to go!
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://visitmix.com/2008/default.aspx"&gt;&lt;img style="border-right: 0px; border-top: 0px; margin: 0px 20px 0px 0px; border-left: 0px; border-bottom: 0px" height="186" alt="blings_9_25_d[1]" src="http://www.mindfusioncorp.com/weblog/content/binary/HeadingtoMIXthisyear_12AAC/blings_9_25_d1.jpg" width="136" align="left" border="0"&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
What will I be doing at MIX? Well I will certainly be soaking up any and all information
related to &lt;a href="http://silverlight.net/default.aspx"&gt;Silverlight&lt;/a&gt; and &lt;a href="http://msdn2.microsoft.com/en-us/netframework/aa663326.aspx"&gt;WPF&lt;/a&gt;.
I will also stick my head into some of the designer-oriented sessions. It's a good
thing to see how the other half lives. In between sessions I am hoping to meet all
kinds of people who are also passionate about UX. And of course this is Vegas, so
I am sure I will lose a few dollars in a casino at some point and drink more booze
than is healthy.
&lt;/p&gt;
&lt;p&gt;
Joining me will be a number of &lt;a href="http://www.wintellect.com/"&gt;Wintellectuals&lt;/a&gt; including &lt;a href="http://www.wintellect.com/cs/blogs/sporter/default.aspx"&gt;Steve
Porter&lt;/a&gt;, &lt;a href="http://www.wintellect.com/TechnicalBioDetail.aspx?Tech=25"&gt;Sergio
Loscialo&lt;/a&gt;, &lt;a href="http://www.r2musings.com/"&gt;Rik Robinson&lt;/a&gt;, &lt;a href="http://www.wintellect.com/ManagmentBioDetail.aspx?Mgmt=11"&gt;Sara
Faatz&lt;/a&gt;, and &lt;a href="http://toddmichellesadie.spaces.live.com/default.aspx"&gt;Todd
Fine&lt;/a&gt;. I know of a number of other local Atlanta folks will be making the trip
as well: &lt;a href="http://ideakitchn.com/blogs/sean/default.aspx"&gt;Sean Gerety&lt;/a&gt;, &lt;a href="http://blogs.msdn.com/dougturn/"&gt;Doug
Turnure&lt;/a&gt;, and &lt;a href="http://adoguy.com/"&gt;Shawn Wildermuth&lt;/a&gt; to name a few.
Are you going too? If so, let me know and we can get together for a cup of coffee
or a beer.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=be21a35a-d4fb-48b8-9a91-833d10556a44" /&gt;</description>
      <comments>http://www.mindfusioncorp.com/weblog/CommentView,guid,be21a35a-d4fb-48b8-9a91-833d10556a44.aspx</comments>
      <category>.NET</category>
      <category>Events</category>
      <category>General</category>
      <category>Silverlight</category>
      <category>WPF</category>
    </item>
    <item>
      <trackback:ping>http://www.mindfusioncorp.com/weblog/Trackback.aspx?guid=0e94b645-01f4-4e4e-b3d3-0add3b39cc0d</trackback:ping>
      <pingback:server>http://www.mindfusioncorp.com/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mindfusioncorp.com/weblog/PermaLink,guid,0e94b645-01f4-4e4e-b3d3-0add3b39cc0d.aspx</pingback:target>
      <dc:creator>Keith Rome</dc:creator>
      <wfw:comment>http://www.mindfusioncorp.com/weblog/CommentView,guid,0e94b645-01f4-4e4e-b3d3-0add3b39cc0d.aspx</wfw:comment>
      <wfw:commentRss>http://www.mindfusioncorp.com/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=0e94b645-01f4-4e4e-b3d3-0add3b39cc0d</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I have uploaded my slides and associated source code that was demonstrated, for the
benefit of those who were not able to attend my session, or for those who have asked
for copies of the code and slides.
</p>
        <p>
I understand that these will be made available from the Alabama Code Camp web site,
but I am also making them available for download from my server as well: <a title="http://www.mindfusioncorp.com/weblog/content/binary/AlabamaCC6-Silverlight-KeithRome.zip" href="http://www.mindfusioncorp.com/weblog/content/binary/AlabamaCC6-Silverlight-KeithRome.zip">http://www.mindfusioncorp.com/weblog/content/binary/AlabamaCC6-Silverlight-KeithRome.zip</a></p>
        <img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=0e94b645-01f4-4e4e-b3d3-0add3b39cc0d" />
      </body>
      <title>Slides and Code from Alabama Code Camp 6</title>
      <guid isPermaLink="false">http://www.mindfusioncorp.com/weblog/PermaLink,guid,0e94b645-01f4-4e4e-b3d3-0add3b39cc0d.aspx</guid>
      <link>http://www.mindfusioncorp.com/weblog/2008/02/25/SlidesAndCodeFromAlabamaCodeCamp6.aspx</link>
      <pubDate>Mon, 25 Feb 2008 00:20:18 GMT</pubDate>
      <description>&lt;p&gt;
I have uploaded my slides and associated source code that was demonstrated, for the
benefit of those who were not able to attend my session, or for those who have asked
for copies of the code and slides.
&lt;/p&gt;
&lt;p&gt;
I understand that these will be made available from the Alabama Code Camp web site,
but I am also making them available for download from my server as well: &lt;a title="http://www.mindfusioncorp.com/weblog/content/binary/AlabamaCC6-Silverlight-KeithRome.zip" href="http://www.mindfusioncorp.com/weblog/content/binary/AlabamaCC6-Silverlight-KeithRome.zip"&gt;http://www.mindfusioncorp.com/weblog/content/binary/AlabamaCC6-Silverlight-KeithRome.zip&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=0e94b645-01f4-4e4e-b3d3-0add3b39cc0d" /&gt;</description>
      <comments>http://www.mindfusioncorp.com/weblog/CommentView,guid,0e94b645-01f4-4e4e-b3d3-0add3b39cc0d.aspx</comments>
      <category>.NET</category>
      <category>Events</category>
      <category>General</category>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.mindfusioncorp.com/weblog/Trackback.aspx?guid=f97bd6f4-2663-41a2-b79f-1c831de93ff2</trackback:ping>
      <pingback:server>http://www.mindfusioncorp.com/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mindfusioncorp.com/weblog/PermaLink,guid,f97bd6f4-2663-41a2-b79f-1c831de93ff2.aspx</pingback:target>
      <dc:creator>Keith Rome</dc:creator>
      <wfw:comment>http://www.mindfusioncorp.com/weblog/CommentView,guid,f97bd6f4-2663-41a2-b79f-1c831de93ff2.aspx</wfw:comment>
      <wfw:commentRss>http://www.mindfusioncorp.com/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=f97bd6f4-2663-41a2-b79f-1c831de93ff2</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I am packing my bags and heading out to Huntsville AL tonight. In the morning I will
be kicking off the Silverlight Track at the <a href="http://www.alabamacodecamp.com/">Alabama
Code Camp</a> with a presentation titled "Tapping into the power of Silverlight 1.0".
My goal with this presentation is to show that although 2.0 will indeed be a phenomenal
release of the Silverlight platform, the currently shipping version is still very
powerful and offers a tremendous amount of value.
</p>
        <p>
If you are planning on attending this Code Camp event, please stop by and listen in!
</p>
        <img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=f97bd6f4-2663-41a2-b79f-1c831de93ff2" />
      </body>
      <title>Heading to Alabama Code Camp 6</title>
      <guid isPermaLink="false">http://www.mindfusioncorp.com/weblog/PermaLink,guid,f97bd6f4-2663-41a2-b79f-1c831de93ff2.aspx</guid>
      <link>http://www.mindfusioncorp.com/weblog/2008/02/22/HeadingToAlabamaCodeCamp6.aspx</link>
      <pubDate>Fri, 22 Feb 2008 16:15:08 GMT</pubDate>
      <description>&lt;p&gt;
I am packing my bags and heading out to Huntsville AL tonight. In the morning I will
be kicking off the Silverlight Track at the &lt;a href="http://www.alabamacodecamp.com/"&gt;Alabama
Code Camp&lt;/a&gt; with a presentation titled "Tapping into the power of Silverlight 1.0".
My goal with this presentation is to show that although 2.0 will indeed be a phenomenal
release of the Silverlight platform, the currently shipping version is still very
powerful and offers a tremendous amount of value.
&lt;/p&gt;
&lt;p&gt;
If you are planning on attending this Code Camp event, please stop by and listen in!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=f97bd6f4-2663-41a2-b79f-1c831de93ff2" /&gt;</description>
      <comments>http://www.mindfusioncorp.com/weblog/CommentView,guid,f97bd6f4-2663-41a2-b79f-1c831de93ff2.aspx</comments>
      <category>.NET</category>
      <category>Events</category>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.mindfusioncorp.com/weblog/Trackback.aspx?guid=9f0adeec-0abc-4e4f-95e7-3a3a03ecacbb</trackback:ping>
      <pingback:server>http://www.mindfusioncorp.com/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mindfusioncorp.com/weblog/PermaLink,guid,9f0adeec-0abc-4e4f-95e7-3a3a03ecacbb.aspx</pingback:target>
      <dc:creator>Keith Rome</dc:creator>
      <wfw:comment>http://www.mindfusioncorp.com/weblog/CommentView,guid,9f0adeec-0abc-4e4f-95e7-3a3a03ecacbb.aspx</wfw:comment>
      <wfw:commentRss>http://www.mindfusioncorp.com/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=9f0adeec-0abc-4e4f-95e7-3a3a03ecacbb</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Last fall I showed off a new game that I had built using Silverlight 1.1 at a few
User Group meetings across the southeast. I showed the internal "guts" of the puzzle
game, and I think people generally thought it was a really cool project. I promised
that I would make the code available, but never actually got around to publishing
it.
</p>
        <p>
Until tonight.
</p>
        <p>
Gem Blaster is now (finally!) published to CodePlex at <a title="http://www.codeplex.com/gemblaster" href="http://www.codeplex.com/gemblaster">http://www.codeplex.com/gemblaster</a></p>
        <p>
Full source code is available there.
</p>
        <p>
Also, if you just want to play the game (after all, it IS a game, and somewhat addictive
too), I have a "live demo" posted to the Wintellect server here: <a title="http://demo.wintellect.com/gemblaster/default.html" href="http://demo.wintellect.com/gemblaster/default.html">http://demo.wintellect.com/gemblaster/default.html</a></p>
        <p>
          <a href="http://demo.wintellect.com/gemblaster/default.html">
            <img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="278" alt="image" src="http://www.mindfusioncorp.com/weblog/content/binary/SourceCodeforGemBlasterfinallypublishedt_28/image.png" width="355" border="0" />
          </a>
        </p>
        <p>
Enjoy!
</p>
        <img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=9f0adeec-0abc-4e4f-95e7-3a3a03ecacbb" />
      </body>
      <title>Source Code for Gem Blaster finally published to CodePlex</title>
      <guid isPermaLink="false">http://www.mindfusioncorp.com/weblog/PermaLink,guid,9f0adeec-0abc-4e4f-95e7-3a3a03ecacbb.aspx</guid>
      <link>http://www.mindfusioncorp.com/weblog/2008/01/31/SourceCodeForGemBlasterFinallyPublishedToCodePlex.aspx</link>
      <pubDate>Thu, 31 Jan 2008 05:00:56 GMT</pubDate>
      <description>&lt;p&gt;
Last fall I showed off a new game that I had built using Silverlight 1.1 at a few
User Group meetings across the southeast. I showed the internal "guts" of the puzzle
game, and I think people generally thought it was a really cool project. I promised
that I would make the code available, but never actually got around to publishing
it.
&lt;/p&gt;
&lt;p&gt;
Until tonight.
&lt;/p&gt;
&lt;p&gt;
Gem Blaster is now (finally!) published to CodePlex at &lt;a title="http://www.codeplex.com/gemblaster" href="http://www.codeplex.com/gemblaster"&gt;http://www.codeplex.com/gemblaster&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Full source code is available there.
&lt;/p&gt;
&lt;p&gt;
Also, if you just want to play the game (after all, it IS a game, and somewhat addictive
too), I have a "live demo" posted to the Wintellect server here: &lt;a title="http://demo.wintellect.com/gemblaster/default.html" href="http://demo.wintellect.com/gemblaster/default.html"&gt;http://demo.wintellect.com/gemblaster/default.html&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://demo.wintellect.com/gemblaster/default.html"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="278" alt="image" src="http://www.mindfusioncorp.com/weblog/content/binary/SourceCodeforGemBlasterfinallypublishedt_28/image.png" width="355" border="0"&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
Enjoy!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=9f0adeec-0abc-4e4f-95e7-3a3a03ecacbb" /&gt;</description>
      <comments>http://www.mindfusioncorp.com/weblog/CommentView,guid,9f0adeec-0abc-4e4f-95e7-3a3a03ecacbb.aspx</comments>
      <category>.NET</category>
      <category>Games</category>
      <category>General</category>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.mindfusioncorp.com/weblog/Trackback.aspx?guid=f0a81bc2-0d28-42cc-9436-4ed8bad5279d</trackback:ping>
      <pingback:server>http://www.mindfusioncorp.com/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mindfusioncorp.com/weblog/PermaLink,guid,f0a81bc2-0d28-42cc-9436-4ed8bad5279d.aspx</pingback:target>
      <dc:creator>Keith Rome</dc:creator>
      <wfw:comment>http://www.mindfusioncorp.com/weblog/CommentView,guid,f0a81bc2-0d28-42cc-9436-4ed8bad5279d.aspx</wfw:comment>
      <wfw:commentRss>http://www.mindfusioncorp.com/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=f0a81bc2-0d28-42cc-9436-4ed8bad5279d</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Yes, you read that right. Silverlight 1.0 - <em>as in unmanaged JavaScript</em> -
and 3D.
</p>
        <p>
Last week I was reminded of the <a href="http://www.codeplex.com/FarseerPhysics">FarSeer
Physics engine for XNA and Silverlight 2.0</a>. I have a strange fascination for 3D
software - stemming back from the years when I was a beta tester and plugin developer
for <a href="http://www.caligari.com/default.asp">Caligari trueSpace 3D</a> - so I
decided to poke around in the source code from CodePlex to see what they were doing.
Turns out it was just mostly linear algebra and some simple mechanics - things I remembered
working with many years ago before the age of managed runtimes and rich visual APIs.
Back then we had to do all the heavy lifting with highly optimized C++ routines and
drawing directly to an HWND. But things are different now, and what seemed incredibly
hard in years past really didn't seem all that hard anymore.
</p>
        <p>
So I was inspired I guess.
</p>
        <p>
I know I could have started with the FarSeer code, and built upon that using C# and
targeting the managed runtime. But oh no - that was too easy! I figured that if it
can be done using simple trig and a solid model design, I bet I could make it work
in JavaScript. After all, JavaScript's Math intrinsic object supports Sin() and Cos(),
extensible objects, and arrays - and at the end of the day, that's all one really
needs in order to create a 3D runtime. Sure, it involves a fair amount of matrix operations
and dot-products and cross-products, but all those things can be learned by reading
up on <a href="http://en.wikipedia.org/wiki/Vector_%28spatial%29">Wikipedia</a> these
days (or <a href="http://www.mathreference.com/">mathreference.com</a>).
</p>
        <p>
So with that, I set out to create an unmanaged 3D visualization engine for Silverlight...
</p>
        <p>
I am making the code freely available and have already published out to CodePlex here: <a title="http://www.codeplex.com/polygraph3d" href="http://www.codeplex.com/polygraph3d">http://www.codeplex.com/polygraph3d</a></p>
        <p>
My efforts so far are looking pretty good (I think). Over the course of about 8 hours
of coding and testing, I have the basics working. I can create a 3-dimensional <a href="http://en.wikipedia.org/wiki/Polyhedron">polyhedron</a> (a
mesh if you will), and I can display the object in a Silverlight Canvas. I can apply
scaling, rotations, and positioning of the polyhedra, and I can also build complex
objects using polyhedron groups, each of which has its own local scaling/rotation/position
transforms. It also supports a movable camera and performs rudimentary perspective
correction as well as small optimizations for backface-culling. It currently only
supports simple brushes for the object faces - I would like to implement a real texture
mapping system, but that will require some very creative use of image skewing to pull
it off.
</p>
        <p>
I have <a href="http://demo.wintellect.com/polygraph3d/default.html">a test page</a> up
that demos a simple 3D cube that you can move around the virtual viewport space...
</p>
        <p>
          <a href="http://demo.wintellect.com/polygraph3d/default.html">
            <img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="217" alt="image" src="http://www.mindfusioncorp.com/weblog/content/binary/PolyGraph3DMaking3DhappenwithSilverlig.0_13C6D/image.png" width="288" border="0" />
          </a>
        </p>
        <p>
For sure, it is a very simple demo. Clicking the red, green, and blue axis bars will
move the cube around. The "spin" button introduces a gradual rotation around the Y
axis... but since my rotation transform code is currently broken, the effect isn't
quite what I had in mind. Hopefully I will figure that particular bug out soon.
</p>
        <p>
One major hurdle I encountered was the fact that Silverlight does not let you draw
directly on a Canvas, nor does it let you create your own controls. This posed a problem
since I wanted to display things that simply could not be expressed using 2D XAML.
I "solved" this problem by performing all of the mathematics needed to project the
3D scene into a 2D viewport, and then I use the vertex data from the projected mesh
to build a series of 2D Path elements. It was indeed a dirty trick - but hey, sometimes
you just have to make do with the capabilities of the platform.
</p>
        <img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=f0a81bc2-0d28-42cc-9436-4ed8bad5279d" />
      </body>
      <title>PolyGraph3D: Making 3D happen with Silverlight 1.0!</title>
      <guid isPermaLink="false">http://www.mindfusioncorp.com/weblog/PermaLink,guid,f0a81bc2-0d28-42cc-9436-4ed8bad5279d.aspx</guid>
      <link>http://www.mindfusioncorp.com/weblog/2008/01/31/PolyGraph3DMaking3DHappenWithSilverlight10.aspx</link>
      <pubDate>Thu, 31 Jan 2008 03:33:45 GMT</pubDate>
      <description>&lt;p&gt;
Yes, you read that right. Silverlight 1.0 - &lt;em&gt;as in unmanaged JavaScript&lt;/em&gt; -
and 3D.
&lt;/p&gt;
&lt;p&gt;
Last week I was reminded of the &lt;a href="http://www.codeplex.com/FarseerPhysics"&gt;FarSeer
Physics engine for XNA and Silverlight 2.0&lt;/a&gt;. I have a strange fascination for 3D
software - stemming back from the years when I was a beta tester and plugin developer
for &lt;a href="http://www.caligari.com/default.asp"&gt;Caligari trueSpace 3D&lt;/a&gt; - so I
decided to poke around in the source code from CodePlex to see what they were doing.
Turns out it was just mostly linear algebra and some simple mechanics - things I remembered
working with many years ago before the age of managed runtimes and rich visual APIs.
Back then we had to do all the heavy lifting with highly optimized C++ routines and
drawing directly to an HWND. But things are different now, and what seemed incredibly
hard in years past really didn't seem all that hard anymore.
&lt;/p&gt;
&lt;p&gt;
So I was inspired I guess.
&lt;/p&gt;
&lt;p&gt;
I know I could have started with the FarSeer code, and built upon that using C# and
targeting the managed runtime. But oh no - that was too easy! I figured that if it
can be done using simple trig and a solid model design, I bet I could make it work
in JavaScript. After all, JavaScript's Math intrinsic object supports Sin() and Cos(),
extensible objects, and arrays - and at the end of the day, that's all one really
needs in order to create a 3D runtime. Sure, it involves a fair amount of matrix operations
and dot-products and cross-products, but all those things can be learned by reading
up on &lt;a href="http://en.wikipedia.org/wiki/Vector_%28spatial%29"&gt;Wikipedia&lt;/a&gt; these
days (or &lt;a href="http://www.mathreference.com/"&gt;mathreference.com&lt;/a&gt;).
&lt;/p&gt;
&lt;p&gt;
So with that, I set out to create an unmanaged 3D visualization engine for Silverlight...
&lt;/p&gt;
&lt;p&gt;
I am making the code freely available and have already published out to CodePlex here: &lt;a title="http://www.codeplex.com/polygraph3d" href="http://www.codeplex.com/polygraph3d"&gt;http://www.codeplex.com/polygraph3d&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
My efforts so far are looking pretty good (I think). Over the course of about 8 hours
of coding and testing, I have the basics working. I can create a 3-dimensional &lt;a href="http://en.wikipedia.org/wiki/Polyhedron"&gt;polyhedron&lt;/a&gt; (a
mesh if you will), and I can display the object in a Silverlight Canvas. I can apply
scaling, rotations, and positioning of the polyhedra, and I can also build complex
objects using polyhedron groups, each of which has its own local scaling/rotation/position
transforms. It also supports a movable camera and performs rudimentary perspective
correction as well as small optimizations for backface-culling. It currently only
supports simple brushes for the object faces - I would like to implement a real texture
mapping system, but that will require some very creative use of image skewing to pull
it off.
&lt;/p&gt;
&lt;p&gt;
I have &lt;a href="http://demo.wintellect.com/polygraph3d/default.html"&gt;a test page&lt;/a&gt; up
that demos a simple 3D cube that you can move around the virtual viewport space...
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://demo.wintellect.com/polygraph3d/default.html"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="217" alt="image" src="http://www.mindfusioncorp.com/weblog/content/binary/PolyGraph3DMaking3DhappenwithSilverlig.0_13C6D/image.png" width="288" border="0"&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
For sure, it is a very simple demo. Clicking the red, green, and blue axis bars will
move the cube around. The "spin" button introduces a gradual rotation around the Y
axis... but since my rotation transform code is currently broken, the effect isn't
quite what I had in mind. Hopefully I will figure that particular bug out soon.
&lt;/p&gt;
&lt;p&gt;
One major hurdle I encountered was the fact that Silverlight does not let you draw
directly on a Canvas, nor does it let you create your own controls. This posed a problem
since I wanted to display things that simply could not be expressed using 2D XAML.
I "solved" this problem by performing all of the mathematics needed to project the
3D scene into a 2D viewport, and then I use the vertex data from the projected mesh
to build a series of 2D Path elements. It was indeed a dirty trick - but hey, sometimes
you just have to make do with the capabilities of the platform.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=f0a81bc2-0d28-42cc-9436-4ed8bad5279d" /&gt;</description>
      <comments>http://www.mindfusioncorp.com/weblog/CommentView,guid,f0a81bc2-0d28-42cc-9436-4ed8bad5279d.aspx</comments>
      <category>.NET</category>
      <category>General</category>
      <category>Silverlight</category>
      <category>Web 2.0</category>
    </item>
    <item>
      <trackback:ping>http://www.mindfusioncorp.com/weblog/Trackback.aspx?guid=edd0108a-1195-4773-a84b-1c2fb2504d6f</trackback:ping>
      <pingback:server>http://www.mindfusioncorp.com/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mindfusioncorp.com/weblog/PermaLink,guid,edd0108a-1195-4773-a84b-1c2fb2504d6f.aspx</pingback:target>
      <dc:creator>Keith Rome</dc:creator>
      <wfw:comment>http://www.mindfusioncorp.com/weblog/CommentView,guid,edd0108a-1195-4773-a84b-1c2fb2504d6f.aspx</wfw:comment>
      <wfw:commentRss>http://www.mindfusioncorp.com/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=edd0108a-1195-4773-a84b-1c2fb2504d6f</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
To work with an "attached" property in Silverlight (such as Left and Top and ZIndex),
we must normally use the pair of accessor methods GetValue() and SetValue().
</p>
        <p>
This is because these properties are not defined for the object that actually uses
them, but they are instead defined by another object that <em>contains</em> them.
In the case of the Left and Top properties, this would be the containing Canvas. So
in order to position an object, we often find that we must write code that resembles
this:
</p>
        <blockquote>
          <p>
            <font face="Courier New">var LeftPosition = MyXamlElement.GetValue("Canvas.Left");</font>
          </p>
          <p>
            <font face="Courier New">LeftPosition += 100.0;</font>
          </p>
          <p>
            <font face="Courier New">MyXamlElement.SetValue("Canvas.Left", LeftPosition);</font>
          </p>
        </blockquote>
        <p>
This works just dandy, but I often forget that there is an easier shorthand way to
work with these attached properties. It turns out that the default indexer for all
Xaml objects is implemented through those very same accessor methods. This means that
we can write the code from above as such:
</p>
        <blockquote>
          <p>
            <font face="Courier New">var LeftPosition = MyXamlElement["Canvas.Left"];</font>
          </p>
          <p>
            <font face="Courier New">LeftPosition += 100.0;</font>
          </p>
          <p>
            <font face="Courier New">MyXamlElement["Canvas.Left"] = Left Position;</font>
          </p>
        </blockquote>
        <p>
This is considerably more readable and even saves a few bytes of JavaScript code,
which cuts down on code bloat - even if only slightly. Of course if I really wanted
to reduce my code as much as possible, I could have reduced the above snippet even
further to this last version:
</p>
        <blockquote>
          <p>
            <font face="Courier New">MyXamlElement["Canvas.Left"] += 100.0;</font>
          </p>
        </blockquote>
        <p>
And that's about as condensed as it gets.
</p>
        <img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=edd0108a-1195-4773-a84b-1c2fb2504d6f" />
      </body>
      <title>Attached Properties in Silverlight</title>
      <guid isPermaLink="false">http://www.mindfusioncorp.com/weblog/PermaLink,guid,edd0108a-1195-4773-a84b-1c2fb2504d6f.aspx</guid>
      <link>http://www.mindfusioncorp.com/weblog/2008/01/11/AttachedPropertiesInSilverlight.aspx</link>
      <pubDate>Fri, 11 Jan 2008 03:15:59 GMT</pubDate>
      <description>&lt;p&gt;
To work with an "attached" property in Silverlight (such as Left and Top and ZIndex),
we must normally use the pair of accessor methods GetValue() and SetValue().
&lt;/p&gt;
&lt;p&gt;
This is because these properties are not defined for the object that actually uses
them, but they are instead defined by another object that &lt;em&gt;contains&lt;/em&gt; them.
In the case of the Left and Top properties, this would be the containing Canvas. So
in order to position an object, we often find that we must write code that resembles
this:
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
&lt;font face="Courier New"&gt;var LeftPosition = MyXamlElement.GetValue("Canvas.Left");&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;LeftPosition += 100.0;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;MyXamlElement.SetValue("Canvas.Left", LeftPosition);&lt;/font&gt;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
This works just dandy, but I often forget that there is an easier shorthand way to
work with these attached properties. It turns out that the default indexer for all
Xaml objects is implemented through those very same accessor methods. This means that
we can write the code from above as such:
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
&lt;font face="Courier New"&gt;var LeftPosition = MyXamlElement["Canvas.Left"];&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;LeftPosition += 100.0;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;MyXamlElement["Canvas.Left"] = Left Position;&lt;/font&gt;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
This is considerably more readable and even saves a few bytes of JavaScript code,
which cuts down on code bloat - even if only slightly. Of course if I really wanted
to reduce my code as much as possible, I could have reduced the above snippet even
further to this last version:
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
&lt;font face="Courier New"&gt;MyXamlElement["Canvas.Left"] += 100.0;&lt;/font&gt;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
And that's about as condensed as it gets.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=edd0108a-1195-4773-a84b-1c2fb2504d6f" /&gt;</description>
      <comments>http://www.mindfusioncorp.com/weblog/CommentView,guid,edd0108a-1195-4773-a84b-1c2fb2504d6f.aspx</comments>
      <category>General</category>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.mindfusioncorp.com/weblog/Trackback.aspx?guid=0b7336ef-f3af-4366-b376-4b99a3dbfc56</trackback:ping>
      <pingback:server>http://www.mindfusioncorp.com/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mindfusioncorp.com/weblog/PermaLink,guid,0b7336ef-f3af-4366-b376-4b99a3dbfc56.aspx</pingback:target>
      <dc:creator>Keith Rome</dc:creator>
      <wfw:comment>http://www.mindfusioncorp.com/weblog/CommentView,guid,0b7336ef-f3af-4366-b376-4b99a3dbfc56.aspx</wfw:comment>
      <wfw:commentRss>http://www.mindfusioncorp.com/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=0b7336ef-f3af-4366-b376-4b99a3dbfc56</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I ran into a small, but dastardly quirk in Silverlight today. I haven't seen it mentioned
out there so figured I would post this in case someone else might suffer from the
same problem someday...
</p>
        <p>
If you have a MediaElement being used to display video, chances are pretty good that
you also have what is known as a "scrub bar". or at least some buttons used to jump
forward or backward in the video timeline. The documentation says that you can accomplish
this by interacting with the Position property of the MediaElement. The Position property
is of type TimeSpan, which is documented as being immutable except for the Seconds
property, which is read/write. In other words, the only way to change the current
playback position of a playing media element is to set Position.Seconds to the location
you wish to jump to.
</p>
        <p>
The only thing is - this actually doesn't work if you take the documentation at face
value. This bit of code doesn't work as you might think it would:
</p>
        <blockquote>
          <p>
            <font face="Courier New" size="3">MyVideo.Position.Seconds = MyVideo.Position.Seconds
+ 10.0;</font>
          </p>
        </blockquote>
        <p>
In fact, that code has no effect at all. No error message, but also no change to the
position.
</p>
        <p>
The secret here is that while the TimeSpan is indeed modifiable through the Seconds
property, the MediaElement doesn't really care about it unless you reassign the Position
property itself. To compound this, there is no way to create your own TimeSpan from
code in Silverlight 1.0, so the only option we have is to take an existing one. Here
is the code to change the current position (which actually works):
</p>
        <blockquote>
          <p>
            <font face="Courier New" size="3">var pos = MyVideo.Position;</font>
          </p>
          <p>
            <font face="Courier New" size="3">pos.Seconds = pos.Seconds + 10.0;</font>
          </p>
          <p>
            <font face="Courier New" size="3">MyVideo.Position = pos;</font>
          </p>
        </blockquote>
        <p>
HTH
</p>
        <img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=0b7336ef-f3af-4366-b376-4b99a3dbfc56" />
      </body>
      <title>Performing Seek operations in Silverlight on a MediaElement</title>
      <guid isPermaLink="false">http://www.mindfusioncorp.com/weblog/PermaLink,guid,0b7336ef-f3af-4366-b376-4b99a3dbfc56.aspx</guid>
      <link>http://www.mindfusioncorp.com/weblog/2008/01/07/PerformingSeekOperationsInSilverlightOnAMediaElement.aspx</link>
      <pubDate>Mon, 07 Jan 2008 20:09:59 GMT</pubDate>
      <description>&lt;p&gt;
I ran into a small, but dastardly quirk in Silverlight today. I haven't seen it mentioned
out there so figured I would post this in case someone else might suffer from the
same problem someday...
&lt;/p&gt;
&lt;p&gt;
If you have a MediaElement being used to display video, chances are pretty good that
you also have what is known as a "scrub bar". or at least some buttons used to jump
forward or backward in the video timeline. The documentation says that you can accomplish
this by interacting with the Position property of the MediaElement. The Position property
is of type TimeSpan, which is documented as being immutable except for the Seconds
property, which is read/write. In other words, the only way to change the current
playback position of a playing media element is to set Position.Seconds to the location
you wish to jump to.
&lt;/p&gt;
&lt;p&gt;
The only thing is - this actually doesn't work if you take the documentation at face
value. This bit of code doesn't work as you might think it would:
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
&lt;font face="Courier New" size=3&gt;MyVideo.Position.Seconds = MyVideo.Position.Seconds
+ 10.0;&lt;/font&gt;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
In fact, that code has no effect at all. No error message, but also no change to the
position.
&lt;/p&gt;
&lt;p&gt;
The secret here is that while the TimeSpan is indeed modifiable through the Seconds
property, the MediaElement doesn't really care about it unless you reassign the Position
property itself. To compound this, there is no way to create your own TimeSpan from
code in Silverlight 1.0, so the only option we have is to take an existing one. Here
is the code to change the current position (which actually works):
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
&lt;font face="Courier New" size=3&gt;var pos = MyVideo.Position;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New" size=3&gt;pos.Seconds = pos.Seconds + 10.0;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New" size=3&gt;MyVideo.Position = pos;&lt;/font&gt;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
HTH
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=0b7336ef-f3af-4366-b376-4b99a3dbfc56" /&gt;</description>
      <comments>http://www.mindfusioncorp.com/weblog/CommentView,guid,0b7336ef-f3af-4366-b376-4b99a3dbfc56.aspx</comments>
      <category>General</category>
      <category>Silverlight</category>
      <category>Tips and Tricks</category>
    </item>
    <item>
      <trackback:ping>http://www.mindfusioncorp.com/weblog/Trackback.aspx?guid=9672e524-aca5-4887-ae32-39b920b186eb</trackback:ping>
      <pingback:server>http://www.mindfusioncorp.com/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mindfusioncorp.com/weblog/PermaLink,guid,9672e524-aca5-4887-ae32-39b920b186eb.aspx</pingback:target>
      <dc:creator>Keith Rome</dc:creator>
      <wfw:comment>http://www.mindfusioncorp.com/weblog/CommentView,guid,9672e524-aca5-4887-ae32-39b920b186eb.aspx</wfw:comment>
      <wfw:commentRss>http://www.mindfusioncorp.com/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=9672e524-aca5-4887-ae32-39b920b186eb</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I have not yet found a workaround for this problem.
</p>
        <p>
The setup is simple: Create two Canvas elements. In one canvas, place a MediaElement.
Point the media element to a valid video source. It doesn't matter if it is set to
AutoPlay or not (but if using manual play, then you will need to initiate playback
in some manner after loading).
</p>
        <p>
Now once that video playback has begun (it doesn't matter how), if you remove the
MediaElement from the original canvas using Children.Remove() and then add it to the
other canvas using Children.Add(), then the playback position will reset and will
start playing from the beginning.
</p>
        <p>
I would possibly expect this behavior if the MediaElement has the AutoPlay property
enabled, but this also happens when AutoPlay is false. Basically, as long as the media
is active, it is restarted if you relocate the element to another parent control.
I am guessing this is a bug in the MediaElement's OnLoad implementation that is not
respecting the AutoPlay setting if the media is currently being played, and is internally
calling Stop() and Start().
</p>
        <img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=9672e524-aca5-4887-ae32-39b920b186eb" />
      </body>
      <title>Silverlight Bug: MediaElements will restart if their containment lineage changes</title>
      <guid isPermaLink="false">http://www.mindfusioncorp.com/weblog/PermaLink,guid,9672e524-aca5-4887-ae32-39b920b186eb.aspx</guid>
      <link>http://www.mindfusioncorp.com/weblog/2007/12/01/SilverlightBugMediaElementsWillRestartIfTheirContainmentLineageChanges.aspx</link>
      <pubDate>Sat, 01 Dec 2007 05:24:02 GMT</pubDate>
      <description>&lt;p&gt;
I have not yet found a workaround for this problem.
&lt;/p&gt;
&lt;p&gt;
The setup is simple: Create two Canvas elements. In one canvas, place a MediaElement.
Point the media element to a valid video source. It doesn't matter if it is set to
AutoPlay or not (but if using manual play, then you will need to initiate playback
in some manner after loading).
&lt;/p&gt;
&lt;p&gt;
Now once that video playback has begun (it doesn't matter how), if you remove the
MediaElement from the original canvas using Children.Remove() and then add it to the
other canvas using Children.Add(), then the playback position will reset and will
start playing from the beginning.
&lt;/p&gt;
&lt;p&gt;
I would possibly expect this behavior if the MediaElement has the AutoPlay property
enabled, but this also happens when AutoPlay is false. Basically, as long as the media
is active, it is restarted if you relocate the element to another parent control.
I am guessing this is a bug in the MediaElement's OnLoad implementation that is not
respecting the AutoPlay setting if the media is currently being played, and is internally
calling Stop() and Start().
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=9672e524-aca5-4887-ae32-39b920b186eb" /&gt;</description>
      <comments>http://www.mindfusioncorp.com/weblog/CommentView,guid,9672e524-aca5-4887-ae32-39b920b186eb.aspx</comments>
      <category>.NET</category>
      <category>General</category>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.mindfusioncorp.com/weblog/Trackback.aspx?guid=4f8bb2fc-43be-4898-ba71-b2402162a612</trackback:ping>
      <pingback:server>http://www.mindfusioncorp.com/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mindfusioncorp.com/weblog/PermaLink,guid,4f8bb2fc-43be-4898-ba71-b2402162a612.aspx</pingback:target>
      <dc:creator>Keith Rome</dc:creator>
      <wfw:comment>http://www.mindfusioncorp.com/weblog/CommentView,guid,4f8bb2fc-43be-4898-ba71-b2402162a612.aspx</wfw:comment>
      <wfw:commentRss>http://www.mindfusioncorp.com/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=4f8bb2fc-43be-4898-ba71-b2402162a612</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I ran into this nasty little bug today... it is not easy to reproduce, but when it
happens it is very annoying to debug.
</p>
        <p>
First, this bug only occurs when you are using a ZIP file to package your external
resources and using a Silverlight Downloader object to bring the package to the browser,
and subsequently using Image.SetSource() to provide the image files to the visual
elements.
</p>
        <p>
Second, it's not really a <em>bug in functionality</em> exactly, but more of a nuisance
to the viewer. You see, the images get displayed correctly, but Silverlight throws
extra error messages.
</p>
        <p>
The problem occurs when you reuse a single image resource from a downloaded zip archive
for multiple Image elements. And it only happens when the two images are assigned
to the same resource consecutively. Example:
</p>
        <p>
          <code>
            <b>function</b>
            <b> downloadComplete(sender, eventArgs)</b>
            <br />
            <b>{</b>
            <br />
            <b>  // this one is OK</b>
            <br />
            <b>  sender.GetHost().FindName(“Image1”).SetSource(sender, “picture.png”);</b>
            <br />
            <b>  // this one fails</b>
            <br />
            <b>  sender.GetHost().FindName(“Image2”).SetSource(sender, “picture.png”);</b>
            <br />
            <b>}</b>
          </code>
        </p>
        <p>
This is using Silverlight 1.0, but I assume the same issue also happens in 1.1.
</p>
        <p>
The problem appears to be related to referencing the same resource twice consecutively.
If you reference another resource from the Downloader between the two calls to SetSource(),
then the problem goes away. Also, if you simply don't reuse the same resource like
this, then it can be avoided.
</p>
        <p>
          <em>
            <font color="#ff0000">UPDATE January 2008: My previous "fix" of referencing another
resource in between uses of the same resource does not seem to always work. In addition,
some Silverlight installations (not all!) are also raising spurious ImageError 4001
messages. The only complete fix I have found is to implement a custom error handler,
and ignore those ImageErrors:</font>
          </em>
        </p>
        <p>
          <code>
            <strong>function </strong>handleError(sender, errorArgs) 
<br /><b>{</b><br /><strong>  </strong>if (errorArgs.errorType == "ImageError" &amp;&amp; errorArgs.errorCode
== 3002)<br />
    {<br />
      // This error is raised sporadically by SetSource<br />
      return;<br />
    }<br />
    if (errorArgs.errorType == "ImageError" &amp;&amp; errorArgs.errorCode
== 4001)<br />
    {<br />
      // This error is raised sporadically by SetSource<br />
      return;<br />
    }<br />
  Silverlight.default_error_handler(sender, errorArgs); 
<br /><b>}</b></code>
        </p>
        <img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=4f8bb2fc-43be-4898-ba71-b2402162a612" />
      </body>
      <title>Silverlight Bug: Using a packaged image source for multiple Image elements</title>
      <guid isPermaLink="false">http://www.mindfusioncorp.com/weblog/PermaLink,guid,4f8bb2fc-43be-4898-ba71-b2402162a612.aspx</guid>
      <link>http://www.mindfusioncorp.com/weblog/2007/12/01/SilverlightBugUsingAPackagedImageSourceForMultipleImageElements.aspx</link>
      <pubDate>Sat, 01 Dec 2007 05:15:55 GMT</pubDate>
      <description>&lt;p&gt;
I ran into this nasty little bug today... it is not easy to reproduce, but when it
happens it is very annoying to debug.
&lt;/p&gt;
&lt;p&gt;
First, this bug only occurs when you are using a ZIP file to package your external
resources and using a Silverlight Downloader object to bring the package to the browser,
and subsequently using Image.SetSource() to provide the image files to the visual
elements.
&lt;/p&gt;
&lt;p&gt;
Second, it's not really a &lt;em&gt;bug in functionality&lt;/em&gt; exactly, but more of a nuisance
to the viewer. You see, the images get displayed correctly, but Silverlight throws
extra error messages.
&lt;/p&gt;
&lt;p&gt;
The problem occurs when you reuse a single image resource from a downloaded zip archive
for multiple Image elements. And it only happens when the two images are assigned
to the same resource consecutively. Example:
&lt;/p&gt;
&lt;p&gt;
&lt;code&gt;&lt;b&gt;function&lt;/b&gt;&lt;b&gt; downloadComplete(sender, eventArgs)&lt;/b&gt; 
&lt;br&gt;
&lt;b&gt;{&lt;/b&gt; 
&lt;br&gt;
&lt;b&gt;&amp;nbsp; // this one is OK&lt;/b&gt; 
&lt;br&gt;
&lt;b&gt;&amp;nbsp; sender.GetHost().FindName(“Image1”).SetSource(sender, “picture.png”);&lt;/b&gt; 
&lt;br&gt;
&lt;b&gt;&amp;nbsp; // this one fails&lt;/b&gt; 
&lt;br&gt;
&lt;b&gt;&amp;nbsp; sender.GetHost().FindName(“Image2”).SetSource(sender, “picture.png”);&lt;/b&gt; 
&lt;br&gt;
&lt;b&gt;}&lt;/b&gt;&lt;/code&gt; 
&lt;p&gt;
This is using Silverlight 1.0, but I assume the same issue also happens in 1.1.
&lt;/p&gt;
&lt;p&gt;
The problem appears to be related to referencing the same resource twice consecutively.
If you reference another resource from the Downloader between the two calls to SetSource(),
then the problem goes away. Also, if you simply don't reuse the same resource like
this, then it can be avoided.
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;&lt;font color=#ff0000&gt;UPDATE January 2008: My previous "fix" of referencing another
resource in between uses of the same resource does not seem to always work. In addition,
some Silverlight installations (not all!) are also raising spurious ImageError 4001
messages. The only complete fix I have found is to implement a custom error handler,
and ignore those ImageErrors:&lt;/font&gt;&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;code&gt;&lt;strong&gt;function &lt;/strong&gt;handleError(sender, errorArgs) 
&lt;br&gt;
&lt;b&gt;{&lt;/b&gt; 
&lt;br&gt;
&lt;strong&gt;&amp;nbsp; &lt;/strong&gt;if (errorArgs.errorType == "ImageError" &amp;amp;&amp;amp; errorArgs.errorCode
== 3002)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // This error is raised sporadically by SetSource&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (errorArgs.errorType == "ImageError" &amp;amp;&amp;amp; errorArgs.errorCode
== 4001)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // This error is raised sporadically by SetSource&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
&amp;nbsp;&amp;nbsp;Silverlight.default_error_handler(sender, errorArgs); 
&lt;br&gt;
&lt;b&gt;}&lt;/b&gt;&lt;/code&gt; 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=4f8bb2fc-43be-4898-ba71-b2402162a612" /&gt;</description>
      <comments>http://www.mindfusioncorp.com/weblog/CommentView,guid,4f8bb2fc-43be-4898-ba71-b2402162a612.aspx</comments>
      <category>.NET</category>
      <category>General</category>
      <category>Silverlight</category>
      <category>Tips and Tricks</category>
    </item>
    <item>
      <trackback:ping>http://www.mindfusioncorp.com/weblog/Trackback.aspx?guid=d62d55f9-70e0-4936-8353-486b65bbdd72</trackback:ping>
      <pingback:server>http://www.mindfusioncorp.com/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mindfusioncorp.com/weblog/PermaLink,guid,d62d55f9-70e0-4936-8353-486b65bbdd72.aspx</pingback:target>
      <dc:creator>Keith Rome</dc:creator>
      <wfw:comment>http://www.mindfusioncorp.com/weblog/CommentView,guid,d62d55f9-70e0-4936-8353-486b65bbdd72.aspx</wfw:comment>
      <wfw:commentRss>http://www.mindfusioncorp.com/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=d62d55f9-70e0-4936-8353-486b65bbdd72</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
While it probably will not get as much attention as a Visual Studio or Windows Service
Pack release, the Expression Team blog announced that there is an <a href="http://blogs.msdn.com/expression/archive/2007/10/17/expression-design-service-pack-1-is-now-available.aspx" target="_blank">SP
now available for Expression Design</a> that solves some very nagging issues with
the RTM version of the product. These problems mostly impacted those of us using Design
and Blend with Silverlight, most were a nuisance and had workarounds, but this update
really improves the "flow" of creating a Silverlight or WPF UI.
</p>
        <p>
Some of the "big" fixes from my perspective:
</p>
        <ul>
          <li>
Gradient Midpoints are now exported (glass fanatics across the globe rejoiced). This
was one of my pet peeves with gradients - you could use Midpoints to create truly
spectacular glass and glow effects in Design - but they would end up more along the
lines of "craptacular" when exported to XAML. The workaround wasn't 100% equivalent,
and was fairly annoying (convert midpoints to new gradient stops before exporting).</li>
          <li>
Exporting to XAML will now emit the correct (forward) slash character in image paths
for Silverlight exports. This was an annoying problem when Silverlight 1.0 was sent
to RTM and no longer supported the backslash.</li>
          <li>
Text exported as TextBlocks instead of Paths. Thatsa verra niiice!</li>
        </ul>
        <p>
One thing that hasn't been addressed that still bugs me is how the exporter handles
layers: Each layer becomes a canvas stacked, each stacked on top of the other. This
isn't inherently troublesome, except that the canvases all start at 0,0 and fill the
workspace... which basically means that only the topmost canvas will recieve mouse
events by default. It would be better if the exported canvases were only as large
as they needed to be, and positioned accordingly.
</p>
        <p>
Then again, I guess I could always file a bug/suggestion report that would be more
likely to be seen by the Expression Team...
</p>
        <img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=d62d55f9-70e0-4936-8353-486b65bbdd72" />
      </body>
      <title>Expression Design Service Pack 1</title>
      <guid isPermaLink="false">http://www.mindfusioncorp.com/weblog/PermaLink,guid,d62d55f9-70e0-4936-8353-486b65bbdd72.aspx</guid>
      <link>http://www.mindfusioncorp.com/weblog/2007/10/18/ExpressionDesignServicePack1.aspx</link>
      <pubDate>Thu, 18 Oct 2007 23:23:12 GMT</pubDate>
      <description>&lt;p&gt;
While it probably will not get as much attention as a Visual Studio or Windows Service
Pack release, the Expression Team blog announced that there is an &lt;a href="http://blogs.msdn.com/expression/archive/2007/10/17/expression-design-service-pack-1-is-now-available.aspx" target="_blank"&gt;SP
now available for Expression Design&lt;/a&gt; that solves some very nagging issues with
the RTM version of the product. These problems mostly impacted those of us using Design
and Blend with Silverlight, most were a nuisance and had workarounds, but this update
really improves the "flow" of creating a Silverlight or WPF UI.
&lt;/p&gt;
&lt;p&gt;
Some of the "big" fixes from my perspective:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Gradient Midpoints are now exported (glass fanatics across the globe rejoiced). This
was one of my pet peeves with gradients - you could use Midpoints to create truly
spectacular glass and glow effects in Design - but they would end up more along the
lines of "craptacular" when exported to XAML. The workaround wasn't 100% equivalent,
and was fairly annoying (convert midpoints to new gradient stops before exporting).&lt;/li&gt;
&lt;li&gt;
Exporting to XAML will now emit the correct (forward) slash character in image paths
for Silverlight exports. This was an annoying problem when Silverlight 1.0 was sent
to RTM and no longer supported the backslash.&lt;/li&gt;
&lt;li&gt;
Text exported as TextBlocks instead of Paths. Thatsa verra niiice!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
One thing that hasn't been addressed that still bugs me is how the exporter handles
layers: Each layer becomes a canvas stacked, each stacked on top of the other. This
isn't inherently troublesome, except that the canvases all start at 0,0 and fill the
workspace... which basically means that only the topmost canvas will recieve mouse
events by default. It would be better if the exported canvases were only as large
as they needed to be, and positioned accordingly.
&lt;/p&gt;
&lt;p&gt;
Then again, I guess I could always file a bug/suggestion report that would be more
likely to be seen by the Expression Team...
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=d62d55f9-70e0-4936-8353-486b65bbdd72" /&gt;</description>
      <comments>http://www.mindfusioncorp.com/weblog/CommentView,guid,d62d55f9-70e0-4936-8353-486b65bbdd72.aspx</comments>
      <category>.NET</category>
      <category>General</category>
      <category>Silverlight</category>
      <category>WPF</category>
    </item>
    <item>
      <trackback:ping>http://www.mindfusioncorp.com/weblog/Trackback.aspx?guid=6b36aa50-8e18-4a13-96e1-2305314d6fa7</trackback:ping>
      <pingback:server>http://www.mindfusioncorp.com/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mindfusioncorp.com/weblog/PermaLink,guid,6b36aa50-8e18-4a13-96e1-2305314d6fa7.aspx</pingback:target>
      <dc:creator>Keith Rome</dc:creator>
      <wfw:comment>http://www.mindfusioncorp.com/weblog/CommentView,guid,6b36aa50-8e18-4a13-96e1-2305314d6fa7.aspx</wfw:comment>
      <wfw:commentRss>http://www.mindfusioncorp.com/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=6b36aa50-8e18-4a13-96e1-2305314d6fa7</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
John Robbins, the wizard of debugging, is looking for suggestions for the <a href="http://www.devscovery.com/" target="_blank">Devscovery
2008</a> Keynotes. To encourage submissions, he is offering a FREE conference pass
to the person with the best idea. Full price for such a pass is $900, which is a bargain
in itself, but FREE is even BETTER!
</p>
        <p>
The spring Devscovery will be in New York, and the fall Devscovery will be held in
Redmond - the winner will get to choose which event they prefer to attend. Having
attended the fall Redmond conference this year, I HIGHLY recommend it! Even if I weren't
a <a href="http://www.wintellect.com/" target="_blank">Wintellect</a> employee, I
would still be comfortable claiming that this is hands-down the best way to spend
your training time and budget.
</p>
        <p>
To submit a keynote idea, please either <a href="http://www.wintellect.com/cs/blogs/jrobbins/archive/2007/10/17/what-keynote-do-you-want-to-see-devscovery.aspx" target="_blank">comment
on John's post here</a> or email your suggestion directly to him. You can submit as
many ideas as you like.
</p>
        <img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=6b36aa50-8e18-4a13-96e1-2305314d6fa7" />
      </body>
      <title>Win a free pass to Devscovery 2008!</title>
      <guid isPermaLink="false">http://www.mindfusioncorp.com/weblog/PermaLink,guid,6b36aa50-8e18-4a13-96e1-2305314d6fa7.aspx</guid>
      <link>http://www.mindfusioncorp.com/weblog/2007/10/18/WinAFreePassToDevscovery2008.aspx</link>
      <pubDate>Thu, 18 Oct 2007 02:16:43 GMT</pubDate>
      <description>&lt;p&gt;
John Robbins, the wizard of debugging, is looking for suggestions for the &lt;a href="http://www.devscovery.com/" target="_blank"&gt;Devscovery
2008&lt;/a&gt; Keynotes. To encourage submissions, he is offering a FREE conference pass
to the person with the best idea. Full price for such a pass is $900, which is a bargain
in itself, but FREE is even BETTER!
&lt;/p&gt;
&lt;p&gt;
The spring Devscovery will be in New York, and the fall Devscovery will be held in
Redmond - the winner will get to choose which event they prefer to attend. Having
attended the fall Redmond conference this year, I HIGHLY recommend it! Even if I weren't
a &lt;a href="http://www.wintellect.com/" target="_blank"&gt;Wintellect&lt;/a&gt; employee, I
would still be comfortable claiming that this is hands-down the best way to spend
your training time and budget.
&lt;/p&gt;
&lt;p&gt;
To submit a keynote idea, please either &lt;a href="http://www.wintellect.com/cs/blogs/jrobbins/archive/2007/10/17/what-keynote-do-you-want-to-see-devscovery.aspx" target="_blank"&gt;comment
on John's post here&lt;/a&gt; or email your suggestion directly to him. You can submit as
many ideas as you like.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=6b36aa50-8e18-4a13-96e1-2305314d6fa7" /&gt;</description>
      <comments>http://www.mindfusioncorp.com/weblog/CommentView,guid,6b36aa50-8e18-4a13-96e1-2305314d6fa7.aspx</comments>
      <category>.NET</category>
      <category>Events</category>
      <category>General</category>
      <category>Silverlight</category>
      <category>WPF</category>
    </item>
    <item>
      <trackback:ping>http://www.mindfusioncorp.com/weblog/Trackback.aspx?guid=89704d6e-be42-4ffa-a84c-09e11ca08b2c</trackback:ping>
      <pingback:server>http://www.mindfusioncorp.com/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mindfusioncorp.com/weblog/PermaLink,guid,89704d6e-be42-4ffa-a84c-09e11ca08b2c.aspx</pingback:target>
      <dc:creator>Keith Rome</dc:creator>
      <wfw:comment>http://www.mindfusioncorp.com/weblog/CommentView,guid,89704d6e-be42-4ffa-a84c-09e11ca08b2c.aspx</wfw:comment>
      <wfw:commentRss>http://www.mindfusioncorp.com/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=89704d6e-be42-4ffa-a84c-09e11ca08b2c</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Steve Porter and myself are driving up to Charlotte tonight to present on Silverlight
at the <a href="http://www.developersguild.org/" target="_blank">Developers Guild</a> meeting.
Steve will be giving an overview of Silverlight features and development, and of course
I will be deconstructing my newest Silverlight game - Gem Blaster!
</p>
        <p>
If you remember Popper!, this is the next generation of that game engine, upgraded
to work with the newer Alpha 1.1 Refresh, and with better graphics and gameplay. You
can also go directly here to play the game: <a title="http://www.mindfusioncorp.com/gemblaster/" href="http://www.mindfusioncorp.com/gemblaster/">http://www.mindfusioncorp.com/gemblaster/</a></p>
        <p>
          <em>
            <strong>EDIT: The game has been moved to the Wintellect servers at: </strong>
          </em>
          <a href="http://www.wintellect.com/gemblaster/">
            <em>
              <strong>http://www.wintellect.com/gemblaster/</strong>
            </em>
          </a>
        </p>
        <p>
          <em>
            <strong>I am also working on getting the source code published to CodePlex, but
it has taken a while due to my very busy work schedule.</strong>
          </em>
        </p>
        <img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=89704d6e-be42-4ffa-a84c-09e11ca08b2c" />
      </body>
      <title>Speaking in Charlotte tonight</title>
      <guid isPermaLink="false">http://www.mindfusioncorp.com/weblog/PermaLink,guid,89704d6e-be42-4ffa-a84c-09e11ca08b2c.aspx</guid>
      <link>http://www.mindfusioncorp.com/weblog/2007/08/28/SpeakingInCharlotteTonight.aspx</link>
      <pubDate>Tue, 28 Aug 2007 15:14:12 GMT</pubDate>
      <description>&lt;p&gt;
Steve Porter and myself are driving up to Charlotte tonight to present on Silverlight
at the &lt;a href="http://www.developersguild.org/" target=_blank&gt;Developers Guild&lt;/a&gt; meeting.
Steve will be giving an overview of Silverlight features and development, and of course
I will be deconstructing my newest Silverlight game - Gem Blaster!
&lt;/p&gt;
&lt;p&gt;
If you remember Popper!, this is the next generation of that game engine, upgraded
to work with the newer Alpha 1.1 Refresh, and with better graphics and gameplay. You
can also go directly here to play the game: &lt;a title=http://www.mindfusioncorp.com/gemblaster/ href="http://www.mindfusioncorp.com/gemblaster/"&gt;http://www.mindfusioncorp.com/gemblaster/&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;&lt;strong&gt;EDIT: The game has been moved to the Wintellect servers at: &lt;/strong&gt;&lt;/em&gt;&lt;a href="http://www.wintellect.com/gemblaster/"&gt;&lt;em&gt;&lt;strong&gt;http://www.wintellect.com/gemblaster/&lt;/strong&gt;&lt;/em&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;&lt;strong&gt;I am also working on getting the source code published to CodePlex, but
it has taken a while due to my very busy work schedule.&lt;/strong&gt;&lt;/em&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=89704d6e-be42-4ffa-a84c-09e11ca08b2c" /&gt;</description>
      <comments>http://www.mindfusioncorp.com/weblog/CommentView,guid,89704d6e-be42-4ffa-a84c-09e11ca08b2c.aspx</comments>
      <category>.NET</category>
      <category>Events</category>
      <category>General</category>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.mindfusioncorp.com/weblog/Trackback.aspx?guid=fdb5fc22-059b-43c3-98d9-e8b4170b94b0</trackback:ping>
      <pingback:server>http://www.mindfusioncorp.com/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mindfusioncorp.com/weblog/PermaLink,guid,fdb5fc22-059b-43c3-98d9-e8b4170b94b0.aspx</pingback:target>
      <dc:creator>Keith Rome</dc:creator>
      <wfw:comment>http://www.mindfusioncorp.com/weblog/CommentView,guid,fdb5fc22-059b-43c3-98d9-e8b4170b94b0.aspx</wfw:comment>
      <wfw:commentRss>http://www.mindfusioncorp.com/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=fdb5fc22-059b-43c3-98d9-e8b4170b94b0</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Using the August CTP of Expression Blend 2? Worried about the lack of a registration
key and that ever-decreasing "remaining days" counter at startup?
</p>
        <p>
The Expression team has released a new refresh build to address that. This build is
supposed to not expire until January 2008. It also has a refreshed Silverlight template
that creates projects compatible with the Alpha 1.1 refresh that shipped earlier this
month. You can go <a title="Blend 2 August CTP Refresh" href="http://www.microsoft.com/expression/products/download.aspx?key=blend2preview" target="_blank">here
to find out more</a>.
</p>
        <p>
Too bad they didn't get in a quick fix for the clipped menus bug too...
</p>
        <img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=fdb5fc22-059b-43c3-98d9-e8b4170b94b0" />
      </body>
      <title>Blend 2 August CTP Refresh</title>
      <guid isPermaLink="false">http://www.mindfusioncorp.com/weblog/PermaLink,guid,fdb5fc22-059b-43c3-98d9-e8b4170b94b0.aspx</guid>
      <link>http://www.mindfusioncorp.com/weblog/2007/08/15/Blend2AugustCTPRefresh.aspx</link>
      <pubDate>Wed, 15 Aug 2007 14:05:39 GMT</pubDate>
      <description>&lt;p&gt;
Using the August CTP of Expression Blend 2? Worried about the lack of a registration
key and that ever-decreasing "remaining days" counter at startup?
&lt;/p&gt;
&lt;p&gt;
The Expression team has released a new refresh build to address that. This build is
supposed to not expire until January 2008. It also has a refreshed Silverlight template
that creates projects compatible with the Alpha 1.1 refresh that shipped earlier this
month. You can go &lt;a title="Blend 2 August CTP Refresh" href="http://www.microsoft.com/expression/products/download.aspx?key=blend2preview" target="_blank"&gt;here
to find out more&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
Too bad they didn't get in a quick fix for the clipped menus bug too...
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=fdb5fc22-059b-43c3-98d9-e8b4170b94b0" /&gt;</description>
      <comments>http://www.mindfusioncorp.com/weblog/CommentView,guid,fdb5fc22-059b-43c3-98d9-e8b4170b94b0.aspx</comments>
      <category>.NET</category>
      <category>General</category>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.mindfusioncorp.com/weblog/Trackback.aspx?guid=d37b340a-b353-4464-8aa5-d5b57f4daa10</trackback:ping>
      <pingback:server>http://www.mindfusioncorp.com/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mindfusioncorp.com/weblog/PermaLink,guid,d37b340a-b353-4464-8aa5-d5b57f4daa10.aspx</pingback:target>
      <dc:creator>Keith Rome</dc:creator>
      <wfw:comment>http://www.mindfusioncorp.com/weblog/CommentView,guid,d37b340a-b353-4464-8aa5-d5b57f4daa10.aspx</wfw:comment>
      <wfw:commentRss>http://www.mindfusioncorp.com/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=d37b340a-b353-4464-8aa5-d5b57f4daa10</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Here is a second Silverlight demo you may or may not have seen already... this one
is from a former colleage, <a title="John West" href="http://johnwest.spaces.live.com/default.aspx" target="_blank">John
West</a>. AirportWait (<a title="http://www.airportwait.com/" href="http://www.airportwait.com/" target="_blank">http://www.airportwait.com/</a>)
is a website that provides congestion data for the various checkpoints in your local
airport (where provided). It basically lets you get an idea of just how early you
should plan on getting to that gate in order to make your flight. Silverlight is being
used to create the polar (circular) charts.
</p>
        <p>
          <a href="http://www.mindfusioncorp.com/weblog/content/binary/AirportWaitSilverlightDemo_10881/image03.png" atomicselection="true">
            <img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="196" src="http://www.mindfusioncorp.com/weblog/content/binary/AirportWaitSilverlightDemo_10881/image0_thumb1.png" width="430" border="0" />
          </a>
        </p>
        <p>
Check it out!
</p>
        <img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=d37b340a-b353-4464-8aa5-d5b57f4daa10" />
      </body>
      <title>AirportWait (Silverlight Demo)</title>
      <guid isPermaLink="false">http://www.mindfusioncorp.com/weblog/PermaLink,guid,d37b340a-b353-4464-8aa5-d5b57f4daa10.aspx</guid>
      <link>http://www.mindfusioncorp.com/weblog/2007/08/08/AirportWaitSilverlightDemo.aspx</link>
      <pubDate>Wed, 08 Aug 2007 22:48:16 GMT</pubDate>
      <description>&lt;p&gt;
Here is a second Silverlight demo you may or may not have seen already... this one
is from a former colleage, &lt;a title="John West" href="http://johnwest.spaces.live.com/default.aspx" target="_blank"&gt;John
West&lt;/a&gt;. AirportWait (&lt;a title="http://www.airportwait.com/" href="http://www.airportwait.com/" target="_blank"&gt;http://www.airportwait.com/&lt;/a&gt;)
is a website that provides congestion data for the various checkpoints in your local
airport (where provided). It basically lets you get an idea of just how early you
should plan on getting to that gate in order to make your flight. Silverlight is being
used to create the polar (circular)&amp;nbsp;charts.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.mindfusioncorp.com/weblog/content/binary/AirportWaitSilverlightDemo_10881/image03.png" atomicselection="true"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="196" src="http://www.mindfusioncorp.com/weblog/content/binary/AirportWaitSilverlightDemo_10881/image0_thumb1.png" width="430" border="0"&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
Check it out!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=d37b340a-b353-4464-8aa5-d5b57f4daa10" /&gt;</description>
      <comments>http://www.mindfusioncorp.com/weblog/CommentView,guid,d37b340a-b353-4464-8aa5-d5b57f4daa10.aspx</comments>
      <category>.NET</category>
      <category>General</category>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.mindfusioncorp.com/weblog/Trackback.aspx?guid=5f84a9f0-daef-451d-9e5f-6bf817e64e9c</trackback:ping>
      <pingback:server>http://www.mindfusioncorp.com/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mindfusioncorp.com/weblog/PermaLink,guid,5f84a9f0-daef-451d-9e5f-6bf817e64e9c.aspx</pingback:target>
      <dc:creator>Keith Rome</dc:creator>
      <wfw:comment>http://www.mindfusioncorp.com/weblog/CommentView,guid,5f84a9f0-daef-451d-9e5f-6bf817e64e9c.aspx</wfw:comment>
      <wfw:commentRss>http://www.mindfusioncorp.com/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=5f84a9f0-daef-451d-9e5f-6bf817e64e9c</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Jeff Prosise just published a <a title="Introducing SilverLife" href="http://www.wintellect.com/cs/blogs/jprosise/archive/2007/08/08/introducing-silverlife.aspx" target="_blank">new
code sample</a> to his Wintellect blog to show his Silverlight adaptation of
the classic Game of Life, which he calls "<a title="SilverLife" href="http://www.wintellect.com/silverlife/" target="_blank">SilverLife</a>".
</p>
        <p>
It's a really cool demo of Silverlight capabilities and programming model, and pretty
fun to play with as well. Best of all, he has the source code available to download
as well so you can see exactly how things are being done under the hood.
</p>
        <p>
Go check it out!
</p>
        <p>
          <a href="http://www.mindfusioncorp.com/weblog/content/binary/SilverLifeSilverlightDemoposted_F36C/image03.png" atomicselection="true">
            <img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="347" src="http://www.mindfusioncorp.com/weblog/content/binary/SilverLifeSilverlightDemoposted_F36C/image0_thumb1.png" width="294" border="0" />
          </a>
        </p>
        <img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=5f84a9f0-daef-451d-9e5f-6bf817e64e9c" />
      </body>
      <title>SilverLife (Silverlight Demo) posted</title>
      <guid isPermaLink="false">http://www.mindfusioncorp.com/weblog/PermaLink,guid,5f84a9f0-daef-451d-9e5f-6bf817e64e9c.aspx</guid>
      <link>http://www.mindfusioncorp.com/weblog/2007/08/08/SilverLifeSilverlightDemoPosted.aspx</link>
      <pubDate>Wed, 08 Aug 2007 21:19:14 GMT</pubDate>
      <description>&lt;p&gt;
Jeff Prosise just published a &lt;a title="Introducing SilverLife" href="http://www.wintellect.com/cs/blogs/jprosise/archive/2007/08/08/introducing-silverlife.aspx" target="_blank"&gt;new
code sample&lt;/a&gt; to&amp;nbsp;his Wintellect blog to show his Silverlight adaptation of
the classic Game of Life, which he calls "&lt;a title="SilverLife" href="http://www.wintellect.com/silverlife/" target="_blank"&gt;SilverLife&lt;/a&gt;".
&lt;/p&gt;
&lt;p&gt;
It's a really cool demo of Silverlight capabilities and programming model, and pretty
fun to play with as well. Best of all, he has the source code available to download
as well so you can see exactly how things are being done under the hood.
&lt;/p&gt;
&lt;p&gt;
Go check it out!
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.mindfusioncorp.com/weblog/content/binary/SilverLifeSilverlightDemoposted_F36C/image03.png" atomicselection="true"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="347" src="http://www.mindfusioncorp.com/weblog/content/binary/SilverLifeSilverlightDemoposted_F36C/image0_thumb1.png" width="294" border="0"&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=5f84a9f0-daef-451d-9e5f-6bf817e64e9c" /&gt;</description>
      <comments>http://www.mindfusioncorp.com/weblog/CommentView,guid,5f84a9f0-daef-451d-9e5f-6bf817e64e9c.aspx</comments>
      <category>.NET</category>
      <category>General</category>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.mindfusioncorp.com/weblog/Trackback.aspx?guid=6a776eeb-8caa-4e90-800e-d05db67598b1</trackback:ping>
      <pingback:server>http://www.mindfusioncorp.com/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mindfusioncorp.com/weblog/PermaLink,guid,6a776eeb-8caa-4e90-800e-d05db67598b1.aspx</pingback:target>
      <dc:creator>Keith Rome</dc:creator>
      <wfw:comment>http://www.mindfusioncorp.com/weblog/CommentView,guid,6a776eeb-8caa-4e90-800e-d05db67598b1.aspx</wfw:comment>
      <wfw:commentRss>http://www.mindfusioncorp.com/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=6a776eeb-8caa-4e90-800e-d05db67598b1</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Popper! is a simple Silverlight puzzle game. I wrote it as an exercise of my own skill
with the platform, but then decided it was a rather fun (at least for a little while...)
little game, so I am sharing it with the rest of the developer community. Popper!
is written against Silverlight 1.1 alpha, and is mostly in C#, although the initial
splash screen is done using unmanaged javaScript (yes, on purpose).
</p>
        <p>
I will be walking through the innards of Popper! at the <a title="Atlanta Cutting Edge .NET" href="http://www.atlantace.com/" target="_blank">Atlanta
Cutting Edge .NET User Group</a> meeting tonight. So if you will be attending, then
come check it out. Or if you just want to kill some time at "work" today... then play
with it a little and let me know how it goes (good or bad)...
</p>
        <p>
          <a title="Popper!" href="http://www.mindfusioncorp.com/popper/" target="_blank">http://www.mindfusioncorp.com/popper/</a>
        </p>
        <p>
I know of one minor bug so far: if you try to click around while a set of bubbles
is in the process of "popping", then an error is raised internally, and the game pretty
much stops working. I just haven't had the time to get that bug addressed yet.
</p>
        <p>
          <a href="http://www.mindfusioncorp.com/weblog/content/binary/Popper_25A4/image04.png" atomicselection="true">
            <img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="235" src="http://www.mindfusioncorp.com/weblog/content/binary/Popper_25A4/image0_thumb2.png" width="379" border="0" />
          </a>
        </p>
        <p>
I intend to post the source for this sometime after this month's meeting. Pretty much
that equates to "when I have time to do it".
</p>
        <img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=6a776eeb-8caa-4e90-800e-d05db67598b1" />
      </body>
      <title>Popper!</title>
      <guid isPermaLink="false">http://www.mindfusioncorp.com/weblog/PermaLink,guid,6a776eeb-8caa-4e90-800e-d05db67598b1.aspx</guid>
      <link>http://www.mindfusioncorp.com/weblog/2007/07/02/Popper.aspx</link>
      <pubDate>Mon, 02 Jul 2007 06:40:42 GMT</pubDate>
      <description>&lt;p&gt;
Popper! is a simple Silverlight puzzle game. I wrote it as an exercise of my own skill
with the platform, but then decided it was a rather fun (at least for a little while...)
little game, so I am sharing it with the rest of the developer community. Popper!
is written against Silverlight 1.1 alpha, and is mostly in C#, although the initial
splash screen is done using unmanaged javaScript (yes, on purpose).
&lt;/p&gt;
&lt;p&gt;
I will be&amp;nbsp;walking through the innards of Popper!&amp;nbsp;at the &lt;a title="Atlanta Cutting Edge .NET" href="http://www.atlantace.com/" target="_blank"&gt;Atlanta
Cutting Edge .NET User Group&lt;/a&gt; meeting tonight. So if you will be attending, then
come check it out. Or if you just want to kill some time at "work" today... then play
with it a little and let me know how it goes (good or bad)...
&lt;/p&gt;
&lt;p&gt;
&lt;a title="Popper!" href="http://www.mindfusioncorp.com/popper/" target="_blank"&gt;http://www.mindfusioncorp.com/popper/&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
I know of one minor bug so far: if you try to click around while a set of bubbles
is in the process of "popping", then an error is raised internally, and the game pretty
much stops working. I just haven't had the time to get that bug addressed yet.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.mindfusioncorp.com/weblog/content/binary/Popper_25A4/image04.png" atomicselection="true"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="235" src="http://www.mindfusioncorp.com/weblog/content/binary/Popper_25A4/image0_thumb2.png" width="379" border="0"&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
I intend to post the source for this sometime after this month's meeting. Pretty much
that equates to "when I have time to do it".
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=6a776eeb-8caa-4e90-800e-d05db67598b1" /&gt;</description>
      <comments>http://www.mindfusioncorp.com/weblog/CommentView,guid,6a776eeb-8caa-4e90-800e-d05db67598b1.aspx</comments>
      <category>.NET</category>
      <category>Events</category>
      <category>General</category>
      <category>Silverlight</category>
      <category>Web 2.0</category>
      <category>WPF</category>
    </item>
    <item>
      <trackback:ping>http://www.mindfusioncorp.com/weblog/Trackback.aspx?guid=15d7ab03-1ca0-4728-bdba-3640657e6d19</trackback:ping>
      <pingback:server>http://www.mindfusioncorp.com/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mindfusioncorp.com/weblog/PermaLink,guid,15d7ab03-1ca0-4728-bdba-3640657e6d19.aspx</pingback:target>
      <dc:creator>Keith Rome</dc:creator>
      <wfw:comment>http://www.mindfusioncorp.com/weblog/CommentView,guid,15d7ab03-1ca0-4728-bdba-3640657e6d19.aspx</wfw:comment>
      <wfw:commentRss>http://www.mindfusioncorp.com/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=15d7ab03-1ca0-4728-bdba-3640657e6d19</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <em>
            <strong>UPDATE 10/25/2007:</strong> Updated this sample to function correctly
with the Silverlight 1.0 release. The main changes necessary were the typical 0.9
to 1.0 changes (remove "Sys.", isWindowless now takes a string and not a boolean,
event handlers no longer string based), and I also had to explicitly set the z-index
of the INPUT element. Thank you Erik for bringing it to my attention.</em>
        </p>
        <p>
 
</p>
        <p>
I have seen a lot of questions and confusion regarding capturing input when using
Silverlight. There are no Button, TextBox, or other similar controls to work with.
I see many folks asking for help with building their own directly within Silverlight
- and bless their hearts, that is a daunting task indeed! The UI model currently does
not offer basic input capture features such as "focus" or "tabbing", or even control-level
keystroke capture. So folks tend to start building those basic services first, before
they ever even get to writing code and xaml to support that simple textbox they need.
</p>
        <p>
If you read that first paragraph and thought "thats crazy, it shouldn't be that hard!",
then I would agree with you. Fortunately, there is a FAR easier and more robust way
to achieve the same thing. In fact, its something that is not new to Silverlight at
all, it's been with us for years. I am of course talking about the tried-and-true
html &lt;input&gt; tag.
</p>
        <p>
One of the most overlooked aspects of Silverlight is that it is a component, not a
platform. Your browser is the platform. It can do a lot of stuff, if you just ask
it to. Nobody wants an entire site as a single Silverlight canvas, just like nobody
wants an entire site as a Flash canvas (unless possibly it is a mini-game or rich
media application)... Flash designers realized this fact years ago. And as a component,
a <em>part</em> of the solution if you will, Silverlight can play nicely with it's
neighbors. With just a little bit of effort and sprinkling a very minimal amount of
javascript pixie dust, we can get a Silverlight applet talking to the rest of
our html DOM. And that's exactly what I am going to show in this topic...
</p>
        <p>
          <em>
            <strong>You can download the code demonstrated in this article here (<a href="http://www.mindfusioncorp.com/weblog/content/binary/QuickTip-TextboxesInSilverlight.zip">QuickTip-TextboxesInSilverlight.zip</a>).</strong>
          </em>
        </p>
        <p>
First of all, I am doing this with Silverlight 1.0 beta (the javascript one), as I
think the 1.1 alpha is far too likely to change, and this technique <em>should</em> work
with either. That, and I am lazy and don't want to come back and revisit this post
later to correct the code...
</p>
        <p>
Secondly, I am using the current CTP builds of Visual Studio Orcas and Blend 2 (the
May 2007 bits), both with the Silverlight extensions. If you are using something else,
then your mileage may vary.
</p>
        <p>
          <em>
            <strong>UPDATE 10/25/2007:</strong> Code updated for VS2008 beta2 and the RTM
version of Silverlight 1.0.</em>
        </p>
        <p>
Now on to the code... to be sure we are on the same page, I am creating a new project
from scratch...
</p>
        <p>
First, Create a new project in Blend. Select the Silverlight 1.0 (JavaScript) project
type. It does not matter what you name the project, but for this example I went with
"TextboxesInSilverlight".
</p>
        <p>
          <a href="http://www.mindfusioncorp.com/weblog/content/binary/QuickTipInputControlsinSilverlight_E5E5/image06.png" atomicselection="true">
            <img style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="142" src="http://www.mindfusioncorp.com/weblog/content/binary/QuickTipInputControlsinSilverlight_E5E5/image0_thumb4.png" width="419" border="0" />
          </a>
        </p>
        <p>
Switch to XAML view and replace the default canvas with this markup:<font color="#0000ff" size="2"><br /></font></p>
        <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
          <p>
            <font color="#0000ff" size="2">
              <font face="Courier New" color="#ff0000">
                <font color="#0000ff">&lt;</font>
                <font color="#a52a2a">Canvas</font>
                <br />
 xmlns<font color="#0000ff">=</font><font color="#000000">"</font></font>
              <a href="http://schemas.microsoft.com/client/2007">
                <font face="Courier New" color="#0000ff">http://schemas.microsoft.com/client/2007</font>
              </a>
              <font face="Courier New" color="#ff0000">
                <font color="#000000">"</font>
                <br />
 xmlns:x<font color="#0000ff">=</font><font color="#000000">"</font></font>
              <a href="http://schemas.microsoft.com/winfx/2006/xaml">
                <font face="Courier New" color="#0000ff">http://schemas.microsoft.com/winfx/2006/xaml</font>
              </a>
              <font face="Courier New" color="#ff0000">
                <font color="#000000">"</font>
                <br />
 Width<font color="#0000ff">=<font color="#000000">"</font>252</font><font color="#000000">"</font> Height<font color="#0000ff">=<font color="#000000">"</font>272</font><font color="#000000">"</font><br />
 Background<font color="#0000ff">=<font color="#000000">"</font>#FFFF2121</font><font color="#000000">"</font><br />
 <font color="#0000ff">&gt;</font><br />
  <font color="#0000ff">&lt;</font><font color="#a52a2a">TextBlock</font> Width<font color="#0000ff">=<font color="#000000">"</font>64</font><font color="#000000">"</font> Height<font color="#0000ff">=<font color="#000000">"</font>24</font><font color="#000000">"</font> Canvas.Left<font color="#0000ff">=<font color="#000000">"</font>8</font><font color="#000000">"</font> Canvas.Top<font color="#0000ff">=<font color="#000000">"</font>8</font><font color="#000000">"</font><br />
             Text<font color="#0000ff">=<font color="#000000">"</font>Opacity</font><font color="#000000">"</font> TextWrapping<font color="#0000ff">=<font color="#000000">"</font>Wrap<font color="#000000">"</font>/&gt;</font><br />
  <font color="#0000ff">&lt;</font><font color="#a52a2a">Ellipse</font> Opacity<font color="#0000ff">=<font color="#000000">"</font>1</font><font color="#000000">"</font> Fill<font color="#0000ff">=<font color="#000000">"</font>#FF0406FF</font><font color="#000000">"</font> Stroke<font color="#0000ff">=<font color="#000000">"</font>#FF000000</font><font color="#000000">"</font><br />
           x:Name<font color="#0000ff">=<font color="#000000">"</font>TheCircle</font><font color="#000000">"</font> Width<font color="#0000ff">=<font color="#000000">"</font>180</font><font color="#000000">"</font> Height<font color="#0000ff">=<font color="#000000">"</font>180</font><font color="#000000">"</font> <br />
           Canvas.Left<font color="#0000ff">=<font color="#000000">"</font>36</font><font color="#000000">"</font> Canvas.Top<font color="#0000ff">=<font color="#000000">"</font>64<font color="#000000">"</font>/&gt;</font><br /><font color="#0000ff">&lt;/</font><font color="#a52a2a">Canvas</font><font color="#0000ff">&gt;</font></font>
            </font>
          </p>
        </blockquote>
        <p>
This will create a simple red canvas, with a blue circle.
</p>
        <p>
At this point, I generally switch over to Visual Studio Orcas since Blend does not
have Intellisense nor does it really know how to deal with JavaScript. You can do
this easily by right-clicking a project item (such as the xaml file) and selecting
"Edit in Visual Studio".
</p>
        <p>
          <a href="http://www.mindfusioncorp.com/weblog/content/binary/QuickTipInputControlsinSilverlight_E5E5/image011.png" atomicselection="true">
            <img style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="214" src="http://www.mindfusioncorp.com/weblog/content/binary/QuickTipInputControlsinSilverlight_E5E5/image0_thumb7.png" width="217" border="0" />
          </a>
        </p>
        <p>
Next, we need to do one small housekeeping chore to make sure that our Silverlight
canvas plays nicely - specifically, we need to ask it to operate "windowless", which
will allow other dhtml elements to overlay it, Open the Default.html.js file, and
modify the call to Silverlight.createObjectEx(). We want to add the parameter for
isWindowless...
</p>
        <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
          <p>
            <font face="Courier New"> Silverlight.createObjectEx({<br />
  source: <font color="#a52a2a">"Scene.xaml"</font>,<br />
  parentElement: document.getElementById(<font color="#a52a2a">"</font><font color="#a52a2a">SilverlightControlHost</font><font color="#a52a2a">"</font>),<br />
  id: <font color="#a52a2a">"SilverlightControl"</font>,<br />
  properties: {<br />
   width: <font color="#a52a2a">"100%"</font>,<br />
   height: <font color="#a52a2a">"100%"</font>,<br />
   version: <font color="#a52a2a">"0.9"</font>,<br />
   isWindowless: <font color="#a52a2a">"true"</font><br />
  },<br />
  events: {<br />
   onLoad: sceneLoaded<br />
  }<br />
 });</font>
            <br />
          </p>
        </blockquote>
        <p>
To make things a bit more "clean", we will create the input element directly from
code, however it's always good to control visual styling with CSS. Therefore, open
up the Default.html, and alter the &lt;style&gt; tag to match the following: 
</p>
        <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
          <p>
            <font face="Courier New"> <font color="#0000ff">&lt;</font><font color="#a52a2a">style</font><font color="#ff0000">type</font><font color="#0000ff">="text/css"&gt;</font><br />
  <font color="#a52a2a">div</font>, <font color="#a52a2a">body</font>, <font color="#a52a2a">input</font><br />
  {<br />
   <font color="#ff0000">margin</font>: <font color="#0000ff">0</font>;<br />
   <font color="#ff0000">padding</font>: <font color="#0000ff">0</font>;<br />
  }<br />
  <font color="#a52a2a">#opacity</font><br />
  {<br />
   <font color="#ff0000">margin</font>: -<font color="#0000ff">272px
0 0 75px</font>;<br />
   <font color="#ff0000">z-index<font color="#000000">:</font></font><font color="#000000"><font color="#0000ff">100</font>;</font><br />
  }<br />
  <font color="#a52a2a">.silverlightHost</font><br />
  {<br />
   <font color="#ff0000">margin</font>: <font color="#0000ff">40px
auto auto auto</font>;<br />
   <font color="#ff0000">height</font>: <font color="#0000ff">272px</font>;<br />
   <font color="#ff0000">width</font>: <font color="#0000ff">252px</font>;<br />
  }<br />
 &lt;/<font color="#a52a2a">style</font>&gt;</font>
          </p>
        </blockquote>
        <p>
This will handle the placement and sizing of the silverlight container &lt;div&gt;
as well as the input control itself. The negative margin is not a typo - this is used
to pull the input control "on top" of the silverlight canvas. We could have also used
absolute positioning, but that is much more brittle, relative positioning FTW. Also,
notice the use of "auto" margins for the main Silverlight Host &lt;div&gt;. This is
how you can center content without resorting to using &lt;center&gt; or &lt;table&gt;...
if you take nothing away from this post, at least remember that one trick. 
</p>
        <p>
The last thing we must do is wire the whole thing up. This can be done in many places,
in many ways. I consider this particular TextBox to be an extension of the Xaml "scene",
so I will add my code to the TextboxesInSilverlight.Scene class which was created
for us by the Blend project template. This is not the only place you could do this
kind of code, but I found that in this particular example it made the most sense.
Had I been building a dialog for a game engine, I might have this code in a seperate
script file that manages my game mechanics (but thats another article...). 
</p>
        <p>
First, we need to capture a global reference to the Scene object that is created (this
object is instantiated by the createSilverlight() function of the Default.html.js
script file we edited in a previous step). The purpose of capturing this reference
is that we will need it later in an event handler. This will allow our html &lt;input&gt;
control to communicate back with the silverlight content. This is easier done than
said. Open the Scene.xaml.js file. Just before the definition of the TextboxesInSilverlight.Scene.prototype
(look up javascript prototype for what this is if you are interested, but that discussion
is out of scope for this article), add a line of code to declare the global reference: 
</p>
        <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
          <p>
            <font face="Courier New">
              <font color="#0000ff">var</font> globalScene = <font color="#0000ff">null</font>; </font>
          </p>
        </blockquote>
        <p>
Now we will create a callback function that will be used to create our JavaScript
object and initialize it: 
</p>
        <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
          <pre>
            <font color="#0000ff">function</font> sceneLoaded(control,
userContext, rootElement)<br />
{<br />
    globalScene = <font color="#0000ff">new</font> TextboxesInSilverlight.Scene();<br />
    globalScene.handleLoad(control, userContext, rootElement);<br />
}; </pre>
        </blockquote>
        <p>
Now, the idea for this example is that the value of the text box will determine the
"Opacity" Xaml property of the Ellipse shape in our markup. In order for the event
handler we are about to add to be able to do this, we will capture a reference to
the circle object (technically we can wait and use findName() later during the event
handler, but I prefer to capture it only once - its just my style of coding). Add
this line to the handleLoad function: 
</p>
        <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
          <p>
            <font face="Courier New">
              <font color="#0000ff">this</font>.circle = control.content.findName(<font color="#a52a2a">"TheCircle"</font>);</font>
          </p>
        </blockquote>
        <p>
Next, we will create the input control and add it to the DHTML document. We will add
it directly to the same &lt;div&gt; that Silverlight has injected itself into, and
therefore any layout or positioning that affects the Silverlight canvas will also
affect our &lt;input&gt; box. Add this code to the end of the handleLoad function: 
</p>
        <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
          <p>
            <font face="Courier New">
              <font color="#0000ff">var</font> opacityEdit = window.document.createElement(<font color="#a52a2a">"input"</font>);<br />
opacityEdit.type = <font color="#a52a2a">"text"</font>;<br />
opacityEdit.id = <font color="#a52a2a">"opacity"</font>;<br />
opacityEdit.name = <font color="#a52a2a">"opacity"</font>;<br />
opacityEdit.value = <font color="#a52a2a">"1.0"</font></font>;
</p>
        </blockquote>
        <p>
We are almost done - only two more steps and then we can fire this thing up! First,
we need to add an event handler to react to changes in the value property of the input
control. Add this code to the very end of the handleLoad function: 
</p>
        <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
          <p>
            <font face="Courier New">opacityEdit.onpropertychange = <font color="#0000ff">function</font>()<br />
    {<br />
        <font color="#0000ff">if</font> (<font color="#0000ff">event</font>.propertyName
== <font color="#a52a2a">"value"</font>)<br />
        {<br />
            globalScene.circle.Opacity
= <font color="#0000ff">event</font>.srcElement.value;<br />
        }<br />
    }</font>
          </p>
        </blockquote>
        <p>
This effectively creates an anonymous function to handle property change events on
the &lt;input&gt; control, which in turn updates the Opacity property of the circle
shape. Cool, huh? 
</p>
        <p>
The last thing to do is finally add the new &lt;input&gt; element to the page, otherwise
all the work until this point will have had no discernable impact at all... add this
one last line to the handleLoad function: 
</p>
        <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
          <p>
            <font face="Courier New">
              <font color="#0000ff">this</font>.control.parentElement.appendChild(opacityEdit);</font>
          </p>
        </blockquote>
        <p>
At this point, your Scene.xaml.js file should look like this: 
</p>
        <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
          <p>
            <font face="Courier New">
              <font color="#0000ff">if</font> (!window.TextboxesInSilverlight)<br />
 window.TextboxesInSilverlight = {};</font>
          </p>
          <p>
            <font face="Courier New">TextboxesInSilverlight.Scene = <font color="#0000ff">function</font>() 
<br />
{<br />
}</font>
          </p>
          <p>
            <font face="Courier New">
              <font color="#0000ff">var</font> globalScene = <font color="#0000ff">null</font>;</font>
          </p>
          <p>
            <font face="Courier New">
              <font color="#0000ff">function</font> sceneLoaded(control,
userContext, rootElement)<br />
{<br />
    globalScene = <font color="#0000ff">new</font> TextboxesInSilverlight.Scene();<br />
    globalScene.handleLoad(control, userContext, rootElement);<br />
}</font>
          </p>
          <p>
            <font face="Courier New">TextboxesInSilverlight.Scene.prototype =<br />
{<br />
 handleLoad: <font color="#0000ff">function</font>(control, userContext, rootElement) 
<br />
 {<br />
  <font color="#0000ff">this</font>.control = control;<br />
  <br />
  <font color="#0000ff">this</font>.circle = control.content.findName<font color="#a52a2a">("TheCircle"</font>);<br />
  <br />
  <font color="#0000ff">var</font> opacityEdit = window.document.createElement(<font color="#a52a2a">"input"</font>);<br />
  opacityEdit.type = <font color="#a52a2a">"text"</font>;<br />
  opacityEdit.id = <font color="#a52a2a">"opacity"</font>;<br />
  opacityEdit.name = <font color="#a52a2a">"opacity"</font>;<br />
  opacityEdit.value = <font color="#a52a2a">"1.0"</font>;<br />
  opacityEdit.onpropertychange = <font color="#0000ff">function</font>()<br />
    {<br />
      <font color="#0000ff">if</font> (<font color="#0000ff">event</font>.propertyName
== <font color="#a52a2a">"value"</font>)<br />
      {<br />
        globalScene.circle.Opacity = <font color="#0000ff">event</font>.srcElement.value;<br />
      }<br />
    }<br />
  </font>
            <font face="Courier New">
              <font color="#0000ff">this</font>.control.parentElement.appendChild(opacityEdit);<br />
 } <br />
}</font>
          </p>
        </blockquote>
        <p>
        </p>
        <p>
If the typo gods favor you, then you should be able to use F5 to run the page and
see it all working together: 
</p>
        <p>
          <a href="http://www.mindfusioncorp.com/weblog/content/binary/QuickTipInputControlsinSilverlight_E5E5/image015.png" atomicselection="true">
            <img style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="240" src="http://www.mindfusioncorp.com/weblog/content/binary/QuickTipInputControlsinSilverlight_E5E5/image0_thumb9.png" width="228" border="0" />
          </a>
          <a href="http://www.mindfusioncorp.com/weblog/content/binary/QuickTipInputControlsinSilverlight_E5E5/image017.png" atomicselection="true">
            <img style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="240" src="http://www.mindfusioncorp.com/weblog/content/binary/QuickTipInputControlsinSilverlight_E5E5/image016.png" width="226" border="0" />
          </a>
        </p>
        <p>
Notice the positioning of the input textboxes, and the interaction of them with the
underlying Silverlight canvas. This is just a simple example, but can be a very powerful
way to "plug in" Silverlight into the surrounding DHTML. 
</p>
        <img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=15d7ab03-1ca0-4728-bdba-3640657e6d19" />
      </body>
      <title>Quick Tip - Input Controls in Silverlight</title>
      <guid isPermaLink="false">http://www.mindfusioncorp.com/weblog/PermaLink,guid,15d7ab03-1ca0-4728-bdba-3640657e6d19.aspx</guid>
      <link>http://www.mindfusioncorp.com/weblog/2007/06/14/QuickTipInputControlsInSilverlight.aspx</link>
      <pubDate>Thu, 14 Jun 2007 20:25:05 GMT</pubDate>
      <description>&lt;p&gt;
&lt;em&gt;&lt;strong&gt;UPDATE 10/25/2007:&lt;/strong&gt; Updated this sample to function correctly
with the Silverlight 1.0 release. The main changes necessary were the typical 0.9
to 1.0 changes (remove "Sys.", isWindowless now takes a string and not a boolean,
event handlers no longer string based), and I also had to explicitly set the z-index
of the INPUT element. Thank you Erik for bringing it to my attention.&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
I have seen a lot of questions and confusion regarding capturing input when using
Silverlight. There are no Button, TextBox, or other similar controls to work with.
I see many folks asking for help with building their own directly within Silverlight
- and bless their hearts, that is a daunting task indeed! The UI model currently does
not offer basic input capture features such as "focus" or "tabbing", or even control-level
keystroke capture. So folks tend to start building those basic services first, before
they ever even get to writing code and xaml to support that simple textbox they need.
&lt;/p&gt;
&lt;p&gt;
If you read that first paragraph and thought "thats crazy, it shouldn't be that hard!",
then I would agree with you. Fortunately, there is a FAR easier and more robust way
to achieve the same thing. In fact, its something that is not new to Silverlight at
all, it's been with us for years. I am of course talking about the tried-and-true
html &amp;lt;input&amp;gt; tag.
&lt;/p&gt;
&lt;p&gt;
One of the most overlooked aspects of Silverlight is that it is a component, not a
platform. Your browser is the platform. It can do a lot of stuff, if you just ask
it to. Nobody wants an entire site as a single Silverlight canvas, just like nobody
wants an entire site as a Flash canvas (unless possibly it is a mini-game or rich
media application)... Flash designers realized this fact years ago. And as a component,
a &lt;em&gt;part&lt;/em&gt; of the solution if you will, Silverlight can play nicely with it's
neighbors. With just a little bit of effort and sprinkling a very minimal amount of
javascript pixie dust, we can&amp;nbsp;get a Silverlight applet talking to the rest of
our html DOM. And that's exactly what I am going to show in this topic...
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;&lt;strong&gt;You can download the code demonstrated in this article here (&lt;a href="http://www.mindfusioncorp.com/weblog/content/binary/QuickTip-TextboxesInSilverlight.zip"&gt;QuickTip-TextboxesInSilverlight.zip&lt;/a&gt;).&lt;/strong&gt;&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
First of all, I am doing this with Silverlight 1.0 beta (the javascript one), as I
think the 1.1 alpha is far too likely to change, and this technique &lt;em&gt;should&lt;/em&gt; work
with either. That, and I am lazy and don't want to come back and revisit this post
later to correct the code...
&lt;/p&gt;
&lt;p&gt;
Secondly, I am using the current CTP builds of Visual Studio Orcas and Blend 2 (the
May 2007 bits), both with the Silverlight extensions. If you are using something else,
then your mileage may vary.
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;&lt;strong&gt;UPDATE 10/25/2007:&lt;/strong&gt; Code updated for VS2008 beta2 and the RTM
version of Silverlight 1.0.&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
Now on to the code... to be sure we are on the same page, I am creating a new project
from scratch...
&lt;/p&gt;
&lt;p&gt;
First, Create a new project in Blend. Select the Silverlight 1.0 (JavaScript) project
type. It does not matter what you name the project, but for this example I went with
"TextboxesInSilverlight".
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.mindfusioncorp.com/weblog/content/binary/QuickTipInputControlsinSilverlight_E5E5/image06.png" atomicselection="true"&gt;&lt;img style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=142 src="http://www.mindfusioncorp.com/weblog/content/binary/QuickTipInputControlsinSilverlight_E5E5/image0_thumb4.png" width=419 border=0&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
Switch to XAML view and replace the default canvas with this markup:&lt;font color=#0000ff size=2&gt;
&lt;br&gt;
&lt;/font&gt;
&lt;/p&gt;
&lt;blockquote dir=ltr style="MARGIN-RIGHT: 0px"&gt; 
&lt;p&gt;
&lt;font color=#0000ff size=2&gt;&lt;font face="Courier New" color=#ff0000&gt;&lt;font color=#0000ff&gt;&amp;lt;&lt;/font&gt;&lt;font color=#a52a2a&gt;Canvas&lt;/font&gt;
&lt;br&gt;
&amp;nbsp;xmlns&lt;font color=#0000ff&gt;=&lt;/font&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;/font&gt;&lt;a href="http://schemas.microsoft.com/client/2007"&gt;&lt;font face="Courier New" color=#0000ff&gt;http://schemas.microsoft.com/client/2007&lt;/font&gt;&lt;/a&gt;&lt;font face="Courier New" color=#ff0000&gt;&lt;font color=#000000&gt;"&lt;/font&gt;
&lt;br&gt;
&amp;nbsp;xmlns:x&lt;font color=#0000ff&gt;=&lt;/font&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;/font&gt;&lt;a href="http://schemas.microsoft.com/winfx/2006/xaml"&gt;&lt;font face="Courier New" color=#0000ff&gt;http://schemas.microsoft.com/winfx/2006/xaml&lt;/font&gt;&lt;/a&gt;&lt;font face="Courier New" color=#ff0000&gt;&lt;font color=#000000&gt;"&lt;/font&gt;
&lt;br&gt;
&amp;nbsp;Width&lt;font color=#0000ff&gt;=&lt;font color=#000000&gt;"&lt;/font&gt;252&lt;/font&gt;&lt;font color=#000000&gt;"&lt;/font&gt; Height&lt;font color=#0000ff&gt;=&lt;font color=#000000&gt;"&lt;/font&gt;272&lt;/font&gt;&lt;font color=#000000&gt;"&lt;/font&gt;
&lt;br&gt;
&amp;nbsp;Background&lt;font color=#0000ff&gt;=&lt;font color=#000000&gt;"&lt;/font&gt;#FFFF2121&lt;/font&gt;&lt;font color=#000000&gt;"&lt;/font&gt;
&lt;br&gt;
&amp;nbsp;&lt;font color=#0000ff&gt;&amp;gt;&lt;/font&gt;
&lt;br&gt;
&amp;nbsp; &lt;font color=#0000ff&gt;&amp;lt;&lt;/font&gt;&lt;font color=#a52a2a&gt;TextBlock&lt;/font&gt; Width&lt;font color=#0000ff&gt;=&lt;font color=#000000&gt;"&lt;/font&gt;64&lt;/font&gt;&lt;font color=#000000&gt;"&lt;/font&gt; Height&lt;font color=#0000ff&gt;=&lt;font color=#000000&gt;"&lt;/font&gt;24&lt;/font&gt;&lt;font color=#000000&gt;"&lt;/font&gt; Canvas.Left&lt;font color=#0000ff&gt;=&lt;font color=#000000&gt;"&lt;/font&gt;8&lt;/font&gt;&lt;font color=#000000&gt;"&lt;/font&gt; Canvas.Top&lt;font color=#0000ff&gt;=&lt;font color=#000000&gt;"&lt;/font&gt;8&lt;/font&gt;&lt;font color=#000000&gt;"&lt;/font&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Text&lt;font color=#0000ff&gt;=&lt;font color=#000000&gt;"&lt;/font&gt;Opacity&lt;/font&gt;&lt;font color=#000000&gt;"&lt;/font&gt; TextWrapping&lt;font color=#0000ff&gt;=&lt;font color=#000000&gt;"&lt;/font&gt;Wrap&lt;font color=#000000&gt;"&lt;/font&gt;/&amp;gt;&lt;/font&gt;
&lt;br&gt;
&amp;nbsp; &lt;font color=#0000ff&gt;&amp;lt;&lt;/font&gt;&lt;font color=#a52a2a&gt;Ellipse&lt;/font&gt; Opacity&lt;font color=#0000ff&gt;=&lt;font color=#000000&gt;"&lt;/font&gt;1&lt;/font&gt;&lt;font color=#000000&gt;"&lt;/font&gt; Fill&lt;font color=#0000ff&gt;=&lt;font color=#000000&gt;"&lt;/font&gt;#FF0406FF&lt;/font&gt;&lt;font color=#000000&gt;"&lt;/font&gt; Stroke&lt;font color=#0000ff&gt;=&lt;font color=#000000&gt;"&lt;/font&gt;#FF000000&lt;/font&gt;&lt;font color=#000000&gt;"&lt;/font&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;x:Name&lt;font color=#0000ff&gt;=&lt;font color=#000000&gt;"&lt;/font&gt;TheCircle&lt;/font&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&amp;nbsp;Width&lt;font color=#0000ff&gt;=&lt;font color=#000000&gt;"&lt;/font&gt;180&lt;/font&gt;&lt;font color=#000000&gt;"&lt;/font&gt; Height&lt;font color=#0000ff&gt;=&lt;font color=#000000&gt;"&lt;/font&gt;180&lt;/font&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Canvas.Left&lt;font color=#0000ff&gt;=&lt;font color=#000000&gt;"&lt;/font&gt;36&lt;/font&gt;&lt;font color=#000000&gt;"&lt;/font&gt; Canvas.Top&lt;font color=#0000ff&gt;=&lt;font color=#000000&gt;"&lt;/font&gt;64&lt;font color=#000000&gt;"&lt;/font&gt;/&amp;gt;&lt;/font&gt;
&lt;br&gt;
&lt;font color=#0000ff&gt;&amp;lt;/&lt;/font&gt;&lt;font color=#a52a2a&gt;Canvas&lt;/font&gt;&lt;font color=#0000ff&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/blockquote&gt;&gt; 
&lt;p&gt;
This will create a simple red canvas, with a blue circle.
&lt;/p&gt;
&lt;p&gt;
At this point, I generally switch over to Visual Studio Orcas since Blend does not
have Intellisense nor does it really know how to deal with JavaScript. You can do
this easily by right-clicking a project item (such as the xaml file) and selecting
"Edit in Visual Studio".
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.mindfusioncorp.com/weblog/content/binary/QuickTipInputControlsinSilverlight_E5E5/image011.png" atomicselection="true"&gt;&lt;img style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=214 src="http://www.mindfusioncorp.com/weblog/content/binary/QuickTipInputControlsinSilverlight_E5E5/image0_thumb7.png" width=217 border=0&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
Next, we need to do one small housekeeping chore to make sure that our Silverlight
canvas plays nicely - specifically, we need to ask it to operate "windowless", which
will allow other dhtml elements to overlay it, Open the Default.html.js file, and
modify the call to Silverlight.createObjectEx(). We want to add the parameter for
isWindowless...
&lt;/p&gt;
&lt;blockquote dir=ltr style="MARGIN-RIGHT: 0px"&gt; 
&lt;p&gt;
&lt;font face="Courier New"&gt;&amp;nbsp;Silverlight.createObjectEx({&lt;br&gt;
&amp;nbsp;&amp;nbsp;source: &lt;font color=#a52a2a&gt;"Scene.xaml"&lt;/font&gt;,&lt;br&gt;
&amp;nbsp;&amp;nbsp;parentElement: document.getElementById(&lt;font color=#a52a2a&gt;"&lt;/font&gt;&lt;font color=#a52a2a&gt;SilverlightControlHost&lt;/font&gt;&lt;font color=#a52a2a&gt;"&lt;/font&gt;),&lt;br&gt;
&amp;nbsp;&amp;nbsp;id: &lt;font color=#a52a2a&gt;"SilverlightControl"&lt;/font&gt;,&lt;br&gt;
&amp;nbsp;&amp;nbsp;properties: {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;width: &lt;font color=#a52a2a&gt;"100%"&lt;/font&gt;,&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;height: &lt;font color=#a52a2a&gt;"100%"&lt;/font&gt;,&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;version: &lt;font color=#a52a2a&gt;"0.9"&lt;/font&gt;,&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;isWindowless: &lt;font color=#a52a2a&gt;"true"&lt;/font&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;},&lt;br&gt;
&amp;nbsp;&amp;nbsp;events: {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;onLoad: sceneLoaded&lt;br&gt;
&amp;nbsp;&amp;nbsp;}&lt;br&gt;
&amp;nbsp;});&lt;/font&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
To make things a bit more "clean", we will create the input element directly from
code, however it's always good to control visual styling with CSS. Therefore, open
up the Default.html, and alter the &amp;lt;style&amp;gt; tag to match the following: &lt;blockquote dir=ltr style="MARGIN-RIGHT: 0px"&gt; 
&lt;p&gt;
&lt;font face="Courier New"&gt;&amp;nbsp;&lt;font color=#0000ff&gt;&amp;lt;&lt;/font&gt;&lt;font color=#a52a2a&gt;style&lt;/font&gt; &lt;font color=#ff0000&gt;type&lt;/font&gt;&lt;font color=#0000ff&gt;="text/css"&amp;gt;&lt;/font&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&lt;font color=#a52a2a&gt;div&lt;/font&gt;, &lt;font color=#a52a2a&gt;body&lt;/font&gt;, &lt;font color=#a52a2a&gt;input&lt;/font&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=#ff0000&gt;margin&lt;/font&gt;: &lt;font color=#0000ff&gt;0&lt;/font&gt;;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=#ff0000&gt;padding&lt;/font&gt;: &lt;font color=#0000ff&gt;0&lt;/font&gt;;&lt;br&gt;
&amp;nbsp;&amp;nbsp;}&lt;br&gt;
&amp;nbsp;&amp;nbsp;&lt;font color=#a52a2a&gt;#opacity&lt;/font&gt; 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=#ff0000&gt;margin&lt;/font&gt;: -&lt;font color=#0000ff&gt;272px 0
0 75px&lt;/font&gt;;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=#ff0000&gt;z-index&lt;font color=#000000&gt;:&lt;/font&gt;&lt;/font&gt;&lt;font color=#000000&gt; &lt;font color=#0000ff&gt;100&lt;/font&gt;;&lt;/font&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;}&lt;br&gt;
&amp;nbsp;&amp;nbsp;&lt;font color=#a52a2a&gt;.silverlightHost&lt;/font&gt; 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=#ff0000&gt;margin&lt;/font&gt;: &lt;font color=#0000ff&gt;40px auto
auto auto&lt;/font&gt;;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=#ff0000&gt;height&lt;/font&gt;: &lt;font color=#0000ff&gt;272px&lt;/font&gt;;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=#ff0000&gt;width&lt;/font&gt;: &lt;font color=#0000ff&gt;252px&lt;/font&gt;;&lt;br&gt;
&amp;nbsp;&amp;nbsp;}&lt;br&gt;
&amp;nbsp;&amp;lt;/&lt;font color=#a52a2a&gt;style&lt;/font&gt;&amp;gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
This will handle the placement and sizing of the silverlight container &amp;lt;div&amp;gt;
as well as the input control itself. The negative margin is not a typo - this is used
to pull the input control "on top" of the silverlight canvas. We could have also used
absolute positioning, but that is much more brittle, relative positioning FTW. Also,
notice the use of "auto" margins for the main Silverlight Host &amp;lt;div&amp;gt;. This is
how you can center content without resorting to using &amp;lt;center&amp;gt; or &amp;lt;table&amp;gt;...
if you take nothing away from this post, at least remember that one trick. 
&lt;p&gt;
The last thing we must do is wire the whole thing up. This can be done in many places,
in many ways. I consider this particular TextBox to be an extension of the Xaml "scene",
so I will add my code to the TextboxesInSilverlight.Scene class which was created
for us by the Blend project template. This is not the only place you could do this
kind of code, but I found that in this particular example it made the most sense.
Had I been building a dialog for a game engine, I might have this code in a seperate
script file that manages my game mechanics (but thats another article...). 
&lt;p&gt;
First, we need to capture a global reference to the Scene object that is created (this
object is instantiated by the createSilverlight() function of the Default.html.js
script file we edited in a previous step). The purpose of capturing this reference
is that we will need it later in an event handler. This will allow our html &amp;lt;input&amp;gt;
control to communicate back with the silverlight content. This is easier done than
said. Open the Scene.xaml.js file. Just before the definition of the TextboxesInSilverlight.Scene.prototype
(look up javascript prototype for what this is if you are interested, but that discussion
is out of scope for this article), add a line of code to declare the global reference: &lt;blockquote dir=ltr style="MARGIN-RIGHT: 0px"&gt; 
&lt;p&gt;
&lt;font face="Courier New"&gt;&lt;font color=#0000ff&gt;var&lt;/font&gt; globalScene = &lt;font color=#0000ff&gt;null&lt;/font&gt;; &lt;/font&gt;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
Now we will create a callback function that will be used to create our JavaScript
object and initialize it: &lt;blockquote dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;pre&gt;&lt;font color=#0000ff&gt;function&lt;/font&gt; sceneLoaded(control,
userContext, rootElement)&lt;br&gt;
{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; globalScene = &lt;font color=#0000ff&gt;new&lt;/font&gt; TextboxesInSilverlight.Scene();&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; globalScene.handleLoad(control, userContext, rootElement);&lt;br&gt;
}; &lt;/pre&gt;&lt;/blockquote&gt; 
&lt;p&gt;
Now, the idea for this example is that the value of the text box will determine the
"Opacity" Xaml property of the Ellipse shape in our markup. In order for the event
handler we are about to add to be able to do this, we will capture a reference to
the circle object (technically we can wait and use findName() later during the event
handler, but I prefer to capture it only once - its just my style of coding). Add
this line to the handleLoad function: &lt;blockquote dir=ltr style="MARGIN-RIGHT: 0px"&gt; 
&lt;p&gt;
&lt;font face="Courier New"&gt;&lt;font color=#0000ff&gt;this&lt;/font&gt;.circle = control.content.findName(&lt;font color=#a52a2a&gt;"TheCircle"&lt;/font&gt;);&lt;/font&gt; 
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
Next, we will create the input control and add it to the DHTML document. We will add
it directly to the same &amp;lt;div&amp;gt; that Silverlight has injected itself into, and
therefore any layout or positioning that affects the Silverlight canvas will also
affect our &amp;lt;input&amp;gt; box. Add this code to the end of the handleLoad function: &lt;blockquote dir=ltr style="MARGIN-RIGHT: 0px"&gt; 
&lt;p&gt;
&lt;font face="Courier New"&gt;&lt;font color=#0000ff&gt;var&lt;/font&gt; opacityEdit = window.document.createElement(&lt;font color=#a52a2a&gt;"input"&lt;/font&gt;);&lt;br&gt;
opacityEdit.type = &lt;font color=#a52a2a&gt;"text"&lt;/font&gt;;&lt;br&gt;
opacityEdit.id = &lt;font color=#a52a2a&gt;"opacity"&lt;/font&gt;;&lt;br&gt;
opacityEdit.name = &lt;font color=#a52a2a&gt;"opacity"&lt;/font&gt;;&lt;br&gt;
opacityEdit.value = &lt;font color=#a52a2a&gt;"1.0"&lt;/font&gt;&lt;/font&gt;;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
We are almost done - only two more steps and then we can fire this thing up! First,
we need to add an event handler to react to changes in the value property of the input
control. Add this code to the very end of the handleLoad function: &lt;blockquote dir=ltr style="MARGIN-RIGHT: 0px"&gt; 
&lt;p&gt;
&lt;font face="Courier New"&gt;opacityEdit.onpropertychange = &lt;font color=#0000ff&gt;function&lt;/font&gt;()&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color=#0000ff&gt;if&lt;/font&gt; (&lt;font color=#0000ff&gt;event&lt;/font&gt;.propertyName
== &lt;font color=#a52a2a&gt;"value"&lt;/font&gt;)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; globalScene.circle.Opacity
= &lt;font color=#0000ff&gt;event&lt;/font&gt;.srcElement.value;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/font&gt; 
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
This effectively creates an anonymous function to handle property change events on
the &amp;lt;input&amp;gt; control, which in turn updates the Opacity property of the circle
shape. Cool, huh? 
&lt;p&gt;
The last thing to do is finally add the new &amp;lt;input&amp;gt; element to the page, otherwise
all the work until this point will have had no discernable impact at all... add this
one last line to the handleLoad function: &lt;blockquote dir=ltr style="MARGIN-RIGHT: 0px"&gt; 
&lt;p&gt;
&lt;font face="Courier New"&gt;&lt;font color=#0000ff&gt;this&lt;/font&gt;.control.parentElement.appendChild(opacityEdit);&lt;/font&gt; 
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
At this point, your Scene.xaml.js file should look like this: &lt;blockquote dir=ltr style="MARGIN-RIGHT: 0px"&gt; 
&lt;p&gt;
&lt;font face="Courier New"&gt;&lt;font color=#0000ff&gt;if&lt;/font&gt; (!window.TextboxesInSilverlight)&lt;br&gt;
&amp;nbsp;window.TextboxesInSilverlight = {};&lt;/font&gt; 
&lt;p&gt;
&lt;font face="Courier New"&gt;TextboxesInSilverlight.Scene = &lt;font color=#0000ff&gt;function&lt;/font&gt;() 
&lt;br&gt;
{&lt;br&gt;
}&lt;/font&gt; 
&lt;p&gt;
&lt;font face="Courier New"&gt;&lt;font color=#0000ff&gt;var&lt;/font&gt; globalScene = &lt;font color=#0000ff&gt;null&lt;/font&gt;;&lt;/font&gt; 
&lt;p&gt;
&lt;font face="Courier New"&gt;&lt;font color=#0000ff&gt;function&lt;/font&gt; sceneLoaded(control,
userContext, rootElement)&lt;br&gt;
{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; globalScene = &lt;font color=#0000ff&gt;new&lt;/font&gt; TextboxesInSilverlight.Scene();&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; globalScene.handleLoad(control, userContext, rootElement);&lt;br&gt;
}&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;TextboxesInSilverlight.Scene.prototype =&lt;br&gt;
{&lt;br&gt;
&amp;nbsp;handleLoad: &lt;font color=#0000ff&gt;function&lt;/font&gt;(control, userContext, rootElement) 
&lt;br&gt;
&amp;nbsp;{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&lt;font color=#0000ff&gt;this&lt;/font&gt;.control = control;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&lt;font color=#0000ff&gt;this&lt;/font&gt;.circle = control.content.findName&lt;font color=#a52a2a&gt;("TheCircle"&lt;/font&gt;);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&lt;font color=#0000ff&gt;var&lt;/font&gt; opacityEdit = window.document.createElement(&lt;font color=#a52a2a&gt;"input"&lt;/font&gt;);&lt;br&gt;
&amp;nbsp;&amp;nbsp;opacityEdit.type = &lt;font color=#a52a2a&gt;"text"&lt;/font&gt;;&lt;br&gt;
&amp;nbsp;&amp;nbsp;opacityEdit.id = &lt;font color=#a52a2a&gt;"opacity"&lt;/font&gt;;&lt;br&gt;
&amp;nbsp;&amp;nbsp;opacityEdit.name = &lt;font color=#a52a2a&gt;"opacity"&lt;/font&gt;;&lt;br&gt;
&amp;nbsp;&amp;nbsp;opacityEdit.value = &lt;font color=#a52a2a&gt;"1.0"&lt;/font&gt;;&lt;br&gt;
&amp;nbsp;&amp;nbsp;opacityEdit.onpropertychange = &lt;font color=#0000ff&gt;function&lt;/font&gt;()&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=#0000ff&gt;if&lt;/font&gt; (&lt;font color=#0000ff&gt;event&lt;/font&gt;.propertyName
== &lt;font color=#a52a2a&gt;"value"&lt;/font&gt;)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;globalScene.circle.Opacity = &lt;font color=#0000ff&gt;event&lt;/font&gt;.srcElement.value;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;font color=#0000ff&gt;this&lt;/font&gt;.control.parentElement.appendChild(opacityEdit);&lt;br&gt;
&amp;nbsp;}&amp;nbsp;&lt;br&gt;
}&lt;/font&gt;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
&lt;p&gt;
If the typo gods favor you, then you should be able to use F5 to run the page and
see it all working together: 
&lt;p&gt;
&lt;a href="http://www.mindfusioncorp.com/weblog/content/binary/QuickTipInputControlsinSilverlight_E5E5/image015.png" atomicselection="true"&gt;&lt;img style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=240 src="http://www.mindfusioncorp.com/weblog/content/binary/QuickTipInputControlsinSilverlight_E5E5/image0_thumb9.png" width=228 border=0&gt;&lt;/a&gt; &lt;a href="http://www.mindfusioncorp.com/weblog/content/binary/QuickTipInputControlsinSilverlight_E5E5/image017.png" atomicselection="true"&gt;&lt;img style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=240 src="http://www.mindfusioncorp.com/weblog/content/binary/QuickTipInputControlsinSilverlight_E5E5/image016.png" width=226 border=0&gt;&lt;/a&gt; 
&lt;p&gt;
Notice the positioning of the input textboxes, and the interaction of them with the
underlying Silverlight canvas. This is just a simple example, but can be a very powerful
way to "plug in"&amp;nbsp;Silverlight&amp;nbsp;into the surrounding&amp;nbsp;DHTML. 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=15d7ab03-1ca0-4728-bdba-3640657e6d19" /&gt;</description>
      <comments>http://www.mindfusioncorp.com/weblog/CommentView,guid,15d7ab03-1ca0-4728-bdba-3640657e6d19.aspx</comments>
      <category>.NET</category>
      <category>General</category>
      <category>Silverlight</category>
      <category>Tips and Tricks</category>
      <category>Web 2.0</category>
    </item>
    <item>
      <trackback:ping>http://www.mindfusioncorp.com/weblog/Trackback.aspx?guid=92aaf646-bcf9-4a05-91f0-9ac12749ab1f</trackback:ping>
      <pingback:server>http://www.mindfusioncorp.com/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mindfusioncorp.com/weblog/PermaLink,guid,92aaf646-bcf9-4a05-91f0-9ac12749ab1f.aspx</pingback:target>
      <dc:creator>Keith Rome</dc:creator>
      <wfw:comment>http://www.mindfusioncorp.com/weblog/CommentView,guid,92aaf646-bcf9-4a05-91f0-9ac12749ab1f.aspx</wfw:comment>
      <wfw:commentRss>http://www.mindfusioncorp.com/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=92aaf646-bcf9-4a05-91f0-9ac12749ab1f</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
It has been a good while since this industry has had a significant shake-up, where
the world as we know it changes almost overnight, and our skills and practices are
all made obsolete. We generally seem to have one every few years or so, and according
to my calculations, it has been about 7 or 8 years since the last one.
</p>
        <p>
I am sure there were other events, but the first I can recall was the introduction
of Object Oriented programming in the 80's. This paradigm shift left multitudes of
mainframe COBOL and RPG analysts behind, forever to toil in a world of green on black
terminal displays. Then in the early and mid 90's there was an explosion of "client-server"
and "N-Tier" applications in the business world. These were all the rage, and
again the flock was divided. Many OOP purists were left in the dust, trying to fend
off the "younger kids" that embraced the 3GL and 4GL tools of the day. But as luck
would have it, only a few years later the terms "client-server" and "N-Tier" took
a back seat to the newest technology explosion - the age of the Web. Right or Wrong,
everyone wanted to be on the web. Try as they might, the n-tier supporters could not
withstand this assault. To this day, there remains a contingent of developers that
cling to the world before the web - in the Microsoft kingdom, we call them "Windows
Forms Programmers", or perhaps the slightly more dignified "Smart Client Developers".
But the significant majority of development work admittedly goes into Web applications.
</p>
        <p>
So for the last few generations of the industry, roughly every five to seven years,
we experienced a wholesale disruption in the status quo. Things are no longer what
we thought they were. Skills become unmarketable. Management becomes confused. Projects
get scrapped. We have to retool - retool or else go the way of the Do-Do Bird (extinct).
</p>
        <p>
The only problem is - it has been about eight years now since the last paradigm shift
(I do not count .NET as a paradigm shift - it is simply a consolidation and improvement
on ideas and methods already in place). It has been eight years, and I fear that
we are long overdue. More than that though - I feel that perhaps, just perhaps, the
paradigm shift has already begun - and that I can't see it due to my own Myopia. And
what if the shift has already passed me by, and I have missed it entirely?
</p>
        <p>
In conclusion, I think the shift is just now underway. I have smelled the crispness
in the air that precedes a thunderstorm. I think the industry is about to change again,
in a very significant way, and I hope to be a small part of it yet again. But
in order to accept and participate in a significant change, a person must adapt to
the new way of things. To that end I have begun the arduous task of retooling and
rebranding myself. This will not be the first time, nor likely the last. As a as/400
specialist, converted to PC technician, converted to Delphi developer, converted to
DBA, converted to Web Developer, and finally to .NET windows/web developer, I can
say that I have definately been through this process before, and it does not scare
me. What scares me is the thought of <em>not</em> adapting.
</p>
        <p>
Some of the people I know and trust feel that they too have "seen the light". Some
have their own theories about where to be when the music stops playing. My good friend <a href="http://devcow.com/blogs/jdattis/default.aspx" target="_blank">Scooter</a> seems
to think that Sharepoint is the entire future. I don't necessarily agree with that.
I have heard similar theories about the grand direction of things from others as well
("Linux is the future!", "Everything will be AJAX!", "OMGZ It's all going to
Pocket PC format!") - most of which I cannot find reason with either. Everyone
seems to agree that the winds are changing, only nobody appears to agree on the
direction. But I have my own ideas and theories and will once again be betting the
next half-decade or longer of my career on that insight. It hasn't let me down in
the past - I trust it will not let me down this time either.
</p>
        <img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=92aaf646-bcf9-4a05-91f0-9ac12749ab1f" />
      </body>
      <title>A storm is brewing</title>
      <guid isPermaLink="false">http://www.mindfusioncorp.com/weblog/PermaLink,guid,92aaf646-bcf9-4a05-91f0-9ac12749ab1f.aspx</guid>
      <link>http://www.mindfusioncorp.com/weblog/2007/04/30/AStormIsBrewing.aspx</link>
      <pubDate>Mon, 30 Apr 2007 20:29:00 GMT</pubDate>
      <description>&lt;p&gt;
It has been a good while since this industry has had a significant shake-up, where
the world as we know it changes almost overnight, and our skills and practices are
all made obsolete. We generally seem to have one every few years or so, and according
to my calculations, it has been about 7 or 8 years since the last one.
&lt;/p&gt;
&lt;p&gt;
I am sure there were other events, but the first I can recall was the introduction
of Object Oriented programming in the 80's. This paradigm shift left multitudes of
mainframe COBOL and RPG analysts behind, forever to toil in a world of green on black
terminal displays. Then in the early and mid 90's there was an explosion of "client-server"
and "N-Tier"&amp;nbsp;applications in the business world. These were all the rage, and
again the flock was divided. Many OOP purists were left in the dust, trying to fend
off the "younger kids" that embraced the 3GL and 4GL tools of the day. But as luck
would have it, only a few years later the terms "client-server" and "N-Tier" took
a back seat to the newest technology explosion - the age of the Web. Right or Wrong,
everyone wanted to be on the web. Try as they might, the n-tier supporters could not
withstand this assault. To this day, there remains a contingent of developers that
cling to the world before the web - in the Microsoft kingdom, we call them "Windows
Forms Programmers", or perhaps the slightly more dignified "Smart Client Developers".
But the significant majority of development work admittedly goes into Web applications.
&lt;/p&gt;
&lt;p&gt;
So for the last few generations of the industry, roughly every five to seven years,
we experienced a wholesale disruption in the status quo. Things are no longer what
we thought they were. Skills become unmarketable. Management becomes confused. Projects
get scrapped. We have to retool - retool or else go the way of the Do-Do Bird (extinct).
&lt;/p&gt;
&lt;p&gt;
The only problem is - it has been about eight years now since the last paradigm shift
(I do not count .NET as a paradigm shift - it is simply a consolidation and improvement
on ideas and methods already in place). It has been&amp;nbsp;eight years, and I fear that
we are long overdue. More than that though - I feel that perhaps, just perhaps, the
paradigm shift has already begun - and that I can't see it due to my own Myopia. And
what if the shift has already passed me by, and I have missed it entirely?
&lt;/p&gt;
&lt;p&gt;
In conclusion, I think the shift is just now underway. I have smelled the crispness
in the air that precedes a thunderstorm. I think the industry is about to change again,
in a very significant way, and&amp;nbsp;I hope to be a small part of it yet again. But
in order to accept and participate in a significant change, a person must adapt to
the new way of things. To that end I have begun the arduous task of retooling and
rebranding myself. This will not be the first time, nor likely the last. As a&amp;nbsp;as/400
specialist, converted to PC technician, converted to Delphi developer, converted to
DBA, converted to Web Developer, and finally to .NET windows/web developer, I can
say that I have definately been through this process before, and it does not scare
me. What scares me is the thought of &lt;em&gt;not&lt;/em&gt; adapting.
&lt;/p&gt;
&lt;p&gt;
Some of the people I know and trust feel that they too have "seen the light". Some
have their own theories about where to be when the music stops playing. My good friend &lt;a href="http://devcow.com/blogs/jdattis/default.aspx" target="_blank"&gt;Scooter&lt;/a&gt; seems
to think that Sharepoint is the entire future. I don't necessarily agree with that.
I have heard similar theories about the grand direction of things from others as well
("Linux&amp;nbsp;is the future!", "Everything will be AJAX!", "OMGZ It's all going to
Pocket PC format!")&amp;nbsp;- most of which I cannot find reason with either. Everyone
seems to agree that the winds are changing,&amp;nbsp;only nobody appears to agree on the
direction. But I have my own ideas and theories and will once again be betting the
next half-decade or longer of my career on that insight. It hasn't let me down in
the past - I trust it will not let me down this time either.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=92aaf646-bcf9-4a05-91f0-9ac12749ab1f" /&gt;</description>
      <comments>http://www.mindfusioncorp.com/weblog/CommentView,guid,92aaf646-bcf9-4a05-91f0-9ac12749ab1f.aspx</comments>
      <category>.NET</category>
      <category>General</category>
      <category>Silverlight</category>
      <category>Web 2.0</category>
      <category>WPF</category>
    </item>
    <item>
      <trackback:ping>http://www.mindfusioncorp.com/weblog/Trackback.aspx?guid=4f3d067c-66d2-4182-81fb-c3d297a97148</trackback:ping>
      <pingback:server>http://www.mindfusioncorp.com/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mindfusioncorp.com/weblog/PermaLink,guid,4f3d067c-66d2-4182-81fb-c3d297a97148.aspx</pingback:target>
      <dc:creator>Keith Rome</dc:creator>
      <wfw:comment>http://www.mindfusioncorp.com/weblog/CommentView,guid,4f3d067c-66d2-4182-81fb-c3d297a97148.aspx</wfw:comment>
      <wfw:commentRss>http://www.mindfusioncorp.com/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=4f3d067c-66d2-4182-81fb-c3d297a97148</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
        </p>
        <p>
          <a href="http://blogs.msdn.com/somasegar/archive/2007/04/15/silverlight-the-next-generation-web-media-experiences.aspx">Soma
tells us</a> that WPF/E has finally recieved a more inspiring name. The announcement
was made at the National Association of Broadcasters (NAB) conference in Vegas.
</p>
        <p>
What's the new name? <a href="http://www.microsoft.com/silverlight/" target="_blank">Silverlight</a>.
They even have a slick logo for it:
</p>
        <p>
          <a href="http://www.mindfusioncorp.com/weblog/content/binary/WPFEGetsaName_D4D7/image02.png" atomicselection="true">
            <img style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="102" src="http://www.mindfusioncorp.com/weblog/content/binary/WPFEGetsaName_D4D7/image0_thumb.png" width="92" border="0" />
          </a>
        </p>
        <p>
You can also <a href="http://blogs.msdn.com/lokeuei/archive/2007/04/16/microsoft-announces-silverlight.aspx" target="_blank">see
how it stacks up against Flash here</a>.
</p>
        <img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=4f3d067c-66d2-4182-81fb-c3d297a97148" />
      </body>
      <title>WPF/E Gets a Name</title>
      <guid isPermaLink="false">http://www.mindfusioncorp.com/weblog/PermaLink,guid,4f3d067c-66d2-4182-81fb-c3d297a97148.aspx</guid>
      <link>http://www.mindfusioncorp.com/weblog/2007/04/16/WPFEGetsAName.aspx</link>
      <pubDate>Mon, 16 Apr 2007 19:09:06 GMT</pubDate>
      <description>&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://blogs.msdn.com/somasegar/archive/2007/04/15/silverlight-the-next-generation-web-media-experiences.aspx"&gt;Soma
tells us&lt;/a&gt; that WPF/E has finally recieved a more inspiring name. The announcement
was made at the National Association of Broadcasters (NAB) conference in Vegas.
&lt;/p&gt;
&lt;p&gt;
What's the new name? &lt;a href="http://www.microsoft.com/silverlight/" target=_blank&gt;Silverlight&lt;/a&gt;.
They even have a slick logo for it:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.mindfusioncorp.com/weblog/content/binary/WPFEGetsaName_D4D7/image02.png" atomicselection="true"&gt;&lt;img style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=102 src="http://www.mindfusioncorp.com/weblog/content/binary/WPFEGetsaName_D4D7/image0_thumb.png" width=92 border=0&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
You can also &lt;a href="http://blogs.msdn.com/lokeuei/archive/2007/04/16/microsoft-announces-silverlight.aspx" target=_blank&gt;see
how it stacks up against Flash here&lt;/a&gt;.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.mindfusioncorp.com/weblog/aggbug.ashx?id=4f3d067c-66d2-4182-81fb-c3d297a97148" /&gt;</description>
      <comments>http://www.mindfusioncorp.com/weblog/CommentView,guid,4f3d067c-66d2-4182-81fb-c3d297a97148.aspx</comments>
      <category>.NET</category>
      <category>Silverlight</category>
      <category>Web 2.0</category>
      <category>WPF</category>
    </item>
  </channel>
</rss>