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

<channel>
	<title>Tracelight.ch - Leuchtspur im Internet &#187; Information Technology</title>
	<atom:link href="http://www.tracelight.ch/category/informationtechnology/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tracelight.ch</link>
	<description></description>
	<lastBuildDate>Sun, 04 Dec 2011 10:48:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>What about your personal information?</title>
		<link>http://www.tracelight.ch/2011/01/01/what-about-your-personal-information/</link>
		<comments>http://www.tracelight.ch/2011/01/01/what-about-your-personal-information/#comments</comments>
		<pubDate>Sat, 01 Jan 2011 18:12:50 +0000</pubDate>
		<dc:creator>Daniel Marbach</dc:creator>
				<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Personal Information]]></category>
		<category><![CDATA[Social Security]]></category>

		<guid isPermaLink="false">http://www.tracelight.ch/?p=684</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><object width="480" height="293"><param name="movie" value="http://www.youtube.com/v/PcdEojQrIpQ&#038;hl=en_US&#038;feature=player_embedded&#038;version=3"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.youtube.com/v/PcdEojQrIpQ&#038;hl=en_US&#038;feature=player_embedded&#038;version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="480" height="293"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tracelight.ch/2011/01/01/what-about-your-personal-information/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>StarCraft Bot in F#</title>
		<link>http://www.tracelight.ch/2010/03/21/starcraft-bot-in-f/</link>
		<comments>http://www.tracelight.ch/2010/03/21/starcraft-bot-in-f/#comments</comments>
		<pubDate>Sun, 21 Mar 2010 19:29:49 +0000</pubDate>
		<dc:creator>Daniel Marbach</dc:creator>
				<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.tracelight.ch/?p=665</guid>
		<description><![CDATA[Shure you remember the game StarCraft! I know the game is really old but still played in the community. Ever wondered how to write a StarCraft bot (especially in F#)? Go check out this link: StarCraft Bot in F#]]></description>
			<content:encoded><![CDATA[<p>Shure you remember the game StarCraft! I know the game is really old but still played in the community. Ever wondered how to write a StarCraft bot (especially in F#)? Go check out this link:</p>
<p><a href="http://blogs.msdn.com/chrsmith/archive/2010/03/18/writing-a-starcraft-bot-in-f.aspx">StarCraft Bot in F#</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tracelight.ch/2010/03/21/starcraft-bot-in-f/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stop the internet printers</title>
		<link>http://www.tracelight.ch/2009/05/04/stop-the-internet-printers/</link>
		<comments>http://www.tracelight.ch/2009/05/04/stop-the-internet-printers/#comments</comments>
		<pubDate>Mon, 04 May 2009 20:36:29 +0000</pubDate>
		<dc:creator>Daniel Marbach</dc:creator>
				<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Css]]></category>
		<category><![CDATA[Politician]]></category>
		<category><![CDATA[Protect Site]]></category>

		<guid isPermaLink="false">http://www.tracelight.ch/?p=643</guid>
		<description><![CDATA[I found this really cool website: http://www.politiker-stopp.de/ The idea behind this page is to protest against politicians which are making new laws without understand the ways and meanings of the internet. The site claims that politicians often don’t know how to use computers so their only seeing websites as imprints of their employees. Therefore the [...]]]></description>
			<content:encoded><![CDATA[<p>I found this really cool website:</p>
<p><a title="http://www.politiker-stopp.de/" href="http://www.politiker-stopp.de/">http://www.politiker-stopp.de/</a></p>
<p>The idea behind this page is to protest against politicians which are making new laws without understand the ways and meanings of the internet. The site claims that politicians often don’t know how to use computers so their only seeing websites as imprints of their employees. Therefore the site suggests to introduce the following CSS code into your site:</p>
<pre class="brush: css; ">

&lt;style&gt;
#print {display:none;} @media print {
 a,abbr,acronym,address,applet,area,b,base,basefont,
bdo,big,blockquote,br,button,caption,center,cite,code,
col,colgroup,dd,del,dfn,dir,div,dl,dt,em,fieldset,font,
form,frame,frameset,h1,h2,h3,h4,h5,h6,hr,i,iframe,img,
input,ins,isindex,kbd,label,legend,li,link,map,menu,meta,
noframes,noscript,object,ol,optgroup,option,p,param,pre,
q,s,samp,select,small,span,strike,strong,sub,sup,table,
tbody,td,textarea,tfoot,th,thead,title,tr,tt,u,ul,var {display:none;}
#print,#print img {
left:0;top:0;padding:0;margin:0;height:250mm;width:170mm;display:block !important;}
}
&lt;/style&gt;&lt;div id=&quot;print&quot;&gt;
&lt;img src=&quot;http://www.politiker-stopp.de/gfx/politiker-stopp-print.png&quot; /&gt;
&lt;/div&gt;
</pre>
<p>This is a really cool idea although completly useless <img src='http://www.tracelight.ch/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Have fun by protecting your sites.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tracelight.ch/2009/05/04/stop-the-internet-printers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Part II: Mimic SynchronizationContext behaviour on .NET CF</title>
		<link>http://www.tracelight.ch/2009/02/15/part-ii-mimic-synchronizationcontext-behaviour-on-net-cf/</link>
		<comments>http://www.tracelight.ch/2009/02/15/part-ii-mimic-synchronizationcontext-behaviour-on-net-cf/#comments</comments>
		<pubDate>Sun, 15 Feb 2009 20:18:34 +0000</pubDate>
		<dc:creator>Daniel Marbach</dc:creator>
				<category><![CDATA[Mobile Development]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[CF]]></category>
		<category><![CDATA[Compact Framework]]></category>
		<category><![CDATA[Delegate]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[SendOrPostCallback]]></category>
		<category><![CDATA[SynchronizationContext]]></category>

		<guid isPermaLink="false">http://www.tracelight.ch/2009/02/15/part-ii-mimic-synchronizationcontext-behaviour-on-net-cf/</guid>
		<description><![CDATA[I just posted the second part of the article Part I: Mimic SynchronizationContext behaviour on .NET CF on planetgeek.ch! On the article I try to show how the basic behavior of the SynchronizationContext can be achieved on the .NET compact framework platform. Please refer to the article under: http://www.planetgeek.ch/2009/02/15/part-ii-mimic-synchronizationcontext-behaviour-on-net-cf/]]></description>
			<content:encoded><![CDATA[<p>I just posted the second part of the article <em>Part I: Mimic SynchronizationContext behaviour on .NET CF</em> on planetgeek.ch! On the article I try to show how the basic behavior of the SynchronizationContext can be achieved on the .NET compact framework platform. Please refer to the article under:</p>
<p><a title="http://www.planetgeek.ch/2009/02/15/part-ii-mimic-synchronizationcontext-behaviour-on-net-cf/" href="http://www.planetgeek.ch/2009/02/15/part-ii-mimic-synchronizationcontext-behaviour-on-net-cf/">http://www.planetgeek.ch/2009/02/15/part-ii-mimic-synchronizationcontext-behaviour-on-net-cf/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tracelight.ch/2009/02/15/part-ii-mimic-synchronizationcontext-behaviour-on-net-cf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LaCie LaCinema Black Max</title>
		<link>http://www.tracelight.ch/2009/02/10/lacie-lacinema-black-max/</link>
		<comments>http://www.tracelight.ch/2009/02/10/lacie-lacinema-black-max/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 17:18:38 +0000</pubDate>
		<dc:creator>Daniel Marbach</dc:creator>
				<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[A110]]></category>
		<category><![CDATA[Black Max]]></category>
		<category><![CDATA[codecs]]></category>
		<category><![CDATA[Lacie]]></category>
		<category><![CDATA[LaCinema]]></category>
		<category><![CDATA[media]]></category>
		<category><![CDATA[Media Box]]></category>
		<category><![CDATA[Popcorn Hour]]></category>

		<guid isPermaLink="false">http://www.tracelight.ch/2009/02/10/lacie-lacinema-black-max/</guid>
		<description><![CDATA[I must admit that I’m not an owner of the LaCie LaCinema Black Max but I’m a proud owner of the popcorn hour A110. The popcorn hour A110 is a small media box which plays almost every video and audio format on the market. The media box includes portal services for youtube, google video, shoutcast [...]]]></description>
			<content:encoded><![CDATA[<p>I must admit that I’m not an owner of the LaCie LaCinema Black Max but I’m a proud owner of the <a href="http://www.popcornhour.com/onlinestore/" target="_blank">popcorn hour A110</a>. The <a href="http://www.popcornhour.com/onlinestore/" target="_blank">popcorn hour A110</a> is a small media box which plays almost every video and audio format on the market. The media box includes portal services for youtube, google video, shoutcast and many more platforms. Although I’m very pleased with this box I want to present to you the latest news about LaCie LaCinema Black Max.</p>
<p>The LaCinema Black Max is shipped with the video codecs for MPEG-1, MPEG-2, MPEG-4, DIVX, XVID, H.264, MKV and WMV9 HD and is able to play video material up to 1.920 x 1.080p. VOB- or IFO structures without protection can be played directly on the media box without converting. The LaCinema Black Max is also able to upscale videos with less resolution up to 1080i.</p>
<p>The most exciting feature of the LaCinema is the integrated DVB-T module. The DVB-T module contains an integrated program guide which allows to use the black max as a video recorder with time shifting.</p>
<p>LaCinema supports the following audio codecs: MP3, WMA, AAC, OGG, AC3, MP4 and WAV. Pictures in the format JPEG, PNG, GIF, BMP and TIF can be directly viewed on the screen via the integrated photo viewer.</p>
<p>Unfortunately the integrated DVB-T module makes the LaCinema quite an expensive product. The current list prices for the LaCinema with 500 GB hard disk are about 650 swiss francs. This makes the LaCinema about 200 swiss francs more expensive than the <a href="http://www.popcornhour.com/onlinestore/" target="_blank">popcorn hour A110</a> with integrated samsung F1 hard disk with 1 TB disk space.</p>
<p>But for those who want an all-in-one player and recorder which supports the latest and greatest high definition codecs the LaCinema Black Max is a “must buy”!</p>
<p>Here are some pictures (copyright by <a href="http://www.lacie.com" target="_blank">Lacie</a>):</p>
<table cellspacing="0" cellpadding="2" width="446" border="0">
<tbody>
<tr>
<td valign="top" width="223"><a href="http://www.tracelight.ch/wp-content/uploads/2009/02/lacinemablackmax-1.jpg"><img title="lacinemaBlackMax_1" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="142" alt="lacinemaBlackMax_1" src="http://www.tracelight.ch/wp-content/uploads/2009/02/lacinemablackmax-1-thumb.jpg" width="200" border="0" /></a> </td>
<td valign="top" width="221"><a href="http://www.tracelight.ch/wp-content/uploads/2009/02/lacinemablackmax-2.jpg"><img title="lacinemaBlackMax_2" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="142" alt="lacinemaBlackMax_2" src="http://www.tracelight.ch/wp-content/uploads/2009/02/lacinemablackmax-2-thumb.jpg" width="200" border="0" /></a> </td>
</tr>
<tr>
<td valign="top" width="223"><a href="http://www.tracelight.ch/wp-content/uploads/2009/02/lacinemablackmax-3.jpg"><img title="lacinemaBlackMax_3" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="142" alt="lacinemaBlackMax_3" src="http://www.tracelight.ch/wp-content/uploads/2009/02/lacinemablackmax-3-thumb.jpg" width="200" border="0" /></a> </td>
<td valign="top" width="221"><a href="http://www.tracelight.ch/wp-content/uploads/2009/02/lacinemablackmax-4.jpg"><img title="lacinemaBlackMax_4" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="142" alt="lacinemaBlackMax_4" src="http://www.tracelight.ch/wp-content/uploads/2009/02/lacinemablackmax-4-thumb.jpg" width="200" border="0" /></a> </td>
</tr>
<tr>
<td valign="top" width="223"><a href="http://www.tracelight.ch/wp-content/uploads/2009/02/lacinemablackmax-5.jpg"><img title="lacinemaBlackMax_5" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="142" alt="lacinemaBlackMax_5" src="http://www.tracelight.ch/wp-content/uploads/2009/02/lacinemablackmax-5-thumb.jpg" width="200" border="0" /></a> </td>
<td valign="top" width="221">&#160;</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.tracelight.ch/2009/02/10/lacie-lacinema-black-max/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>planetgeek.ch to the rescue</title>
		<link>http://www.tracelight.ch/2009/02/09/planetgeekch-to-the-rescue/</link>
		<comments>http://www.tracelight.ch/2009/02/09/planetgeekch-to-the-rescue/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 20:53:25 +0000</pubDate>
		<dc:creator>Daniel Marbach</dc:creator>
				<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[planetgeek]]></category>

		<guid isPermaLink="false">http://www.tracelight.ch/2009/02/09/planetgeekch-to-the-rescue/</guid>
		<description><![CDATA[As some of you may already have noticed some of my blog entries are now cross-posted on tracelight.ch and planetgeek.ch. A few weeks ago we decided to start a new blog project called planetgeek.ch. The goal of this blog is to provide geeky information to all ICT interested people. The language of the blog is [...]]]></description>
			<content:encoded><![CDATA[<p>As some of you may already have noticed some of my blog entries are now cross-posted on tracelight.ch and <a href="http://www.planetgeek.ch" target="_blank">planetgeek.ch</a>. A few weeks ago we decided to start a new blog project called <a href="http://www.planetgeek.ch" target="_blank">planetgeek.ch</a>. The goal of this blog is to provide geeky information to all ICT interested people. The language of the blog is English. We hope that we can provide some valuable and interesting information to you guys (both male and female!) out there in the world.</p>
<p>Please have a look and join us on <a href="http://www.planetgeek.ch" target="_blank">planetgeek.ch</a>! I can especially recommend the page <a href="http://www.planetgeek.ch/ask-a-geek/" target="_blank">“Ask a geek”</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tracelight.ch/2009/02/09/planetgeekch-to-the-rescue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Part I: Mimic SynchronizationContext behaviour on .NET CF</title>
		<link>http://www.tracelight.ch/2009/02/08/part-i-mimic-synchronizationcontext-behaviour-on-net-cf/</link>
		<comments>http://www.tracelight.ch/2009/02/08/part-i-mimic-synchronizationcontext-behaviour-on-net-cf/#comments</comments>
		<pubDate>Sun, 08 Feb 2009 17:42:57 +0000</pubDate>
		<dc:creator>Daniel Marbach</dc:creator>
				<category><![CDATA[Mobile Development]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[.NET CF]]></category>
		<category><![CDATA[Compact Framework]]></category>
		<category><![CDATA[Delegate]]></category>
		<category><![CDATA[SendOrPostCallback]]></category>
		<category><![CDATA[SynchronizationContext]]></category>

		<guid isPermaLink="false">http://www.tracelight.ch/2009/02/08/part-i-mimic-synchronizationcontext-behaviour-on-net-cf/</guid>
		<description><![CDATA[Before I got into the details of the problem I want to briefly describe what the SynchronizationContext class really does and what it’s main purpose really is in the first part of the article. From that perspective I&#8217;m going to show how the basic functionality of the SynchronizationContext class can be implemented for the .NET [...]]]></description>
			<content:encoded><![CDATA[<p>Before I got into the details of the problem I want to briefly describe what the <em>SynchronizationContext</em> class really does and what it’s main purpose really is in the first part of the article. From that perspective I&#8217;m going to show how the basic functionality of the <em>SynchronizationContext</em> class can be implemented for the .NET compact framework in the second part of the article..</p>
<p> The msdn library documentation states:
</p>
<blockquote><p>Provides the basic functionality for propagating a synchronization context in various synchronization models.</p>
</blockquote>
<p>I must admit the first time when I read this definition I didn’t really get the key point behind the SynchronizationContext class. Detailed look into the implementation of SynchronizationContext and its base classes provided me the following information:</p>
<blockquote><p><span style="background-color: #ffffff">The <em>SynchronizationContext</em> class is a class belonging to the System.Threading namespace. The <em>SynchronizationContext</em> provides a model to make the communication between threads easier and more robust especially if multiple threading contexts/apartments such as “UI threading context” etc. are present.</span></p>
</blockquote>
<p>To get a deeper understanding of the definition above I want to give you a short example. Imagine if you have a separate thread performing an intense calculation such as calculating the n-th Fibonacci number. When the separate thread has finished its long running operation you want to display the n-th Fibonacci number on a user interface. Normally (without using the <em>SynchronizationContext</em> class) you would need to do the following (or at least something similar):</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">delegate</span> <span style="color: #6666cc; font-weight: bold;">void</span> FibonacciResultDelegate<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">long</span> fibonacciResult<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">void</span> MethodCalledByTheFibonacciThread<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">long</span> fibonacciNumber<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
   <span style="color: #0600FF; font-weight: bold;">if</span><span style="color: #008000;">&#40;</span> fibonacciResultTextBox<span style="color: #008000;">.</span><span style="color: #0000FF;">InvokeRequired</span><span style="color: #008000;">&#41;</span>
   <span style="color: #008000;">&#123;</span>
      FibonacciResultDelegate fibonacciDelegate <span style="color: #008000;">=</span>
         MethodCalledByTheFibonacciThread<span style="color: #008000;">;</span>
      fibonacciDelegate<span style="color: #008000;">.</span><span style="color: #0000FF;">Invoke</span><span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span>, <span style="color: #008000;">new</span> <span style="color: #6666cc; font-weight: bold;">object</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">&#123;</span> fibonacciNumber <span style="color: #008000;">&#125;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
      <span style="color: #0600FF; font-weight: bold;">return</span><span style="color: #008000;">;</span>
   <span style="color: #008000;">&#125;</span>
   fibonacciResultTextBox<span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span> <span style="color: #008000;">=</span> fibonacciNumber<span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>
  <br />With the <em>SynchronizationContext</em> class we can invoke delegates in the context of a different thread. For the example above we could do the following: </p>
<p></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> FibonacciPresenter
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">readonly</span> Thread workerThread<span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">readonly</span> SynchronizationContext context<span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">readonly</span> IFibonacciView fibonacciView<span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">public</span> FibonacciWorker<span style="color: #008000;">&#40;</span>IFibonacciView view<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            fibonacciView <span style="color: #008000;">=</span> view<span style="color: #008000;">;</span>
&nbsp;
            context <span style="color: #008000;">=</span> SynchronizationContext<span style="color: #008000;">.</span><span style="color: #0000FF;">Current</span><span style="color: #008000;">;</span>
&nbsp;
            workerThread <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Thread<span style="color: #008000;">&#40;</span><span style="color: #008000;">new</span> ThreadStart<span style="color: #008000;">&#40;</span>FibonacciCalc<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            workerThread<span style="color: #008000;">.</span><span style="color: #0000FF;">Start</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">void</span> FibonacciCalc<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #6666cc; font-weight: bold;">long</span> result <span style="color: #008000;">=</span> CalculateFibonacciNumber<span style="color: #008000;">&#40;</span> <span style="color: #008000;">...</span> <span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            context<span style="color: #008000;">.</span><span style="color: #0000FF;">Post</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">new</span> SendOrPostCallback<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">delegate</span><span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> state<span style="color: #008000;">&#41;</span>
            <span style="color: #008000;">&#123;</span>
               fibonacciView<span style="color: #008000;">.</span><span style="color: #0000FF;">DisplayResult</span><span style="color: #008000;">&#40;</span>result<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span><span style="color: #008000;">&#41;</span>, <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">// details omitted...</span>
    <span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>In code line 13 we can see how the <em>SynchronizationContext</em> is retrieved. The <em>SynchronizationContex.Current</em> property points to the <em>SynchronizationContext</em> of the thread where the <em>FibonacciWorker</em> was created (in my example the <em>FibonacciWorker</em> would be created in a control). Then the <em>FibonacciCalc</em> method can <em>post</em> (asynchronous) or <em>send</em> (synchronous) a <em>SendOrPostCallback</em> delegate containing the “job” which needs to be marshaled over the <em>SynchronizationContext</em>. Therefore the line <em>fibonacciView.DisplayResult(result)</em> would be invoked on the UI thread which allows us to remove the “invoke required” code parts and directly set the fibonacci calculation result to the textbox <em>text</em> property.</p>
<p>We can briefly summarize that the purpose of the <em>SynchronizationContext</em> is to post (asynchronous) or send (synchronous) <em>SendOrPostCallback</em> delegates in the correct threading context which simplifies marshaling.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tracelight.ch/2009/02/08/part-i-mimic-synchronizationcontext-behaviour-on-net-cf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Mobile 6.5 information leaked</title>
		<link>http://www.tracelight.ch/2009/01/24/windows-mobile-65-information-leaked/</link>
		<comments>http://www.tracelight.ch/2009/01/24/windows-mobile-65-information-leaked/#comments</comments>
		<pubDate>Sat, 24 Jan 2009 07:52:58 +0000</pubDate>
		<dc:creator>Daniel Marbach</dc:creator>
				<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[qtek 9090]]></category>
		<category><![CDATA[ROM leaked]]></category>
		<category><![CDATA[Windows Mobile]]></category>
		<category><![CDATA[Windows Mobile 6.5]]></category>
		<category><![CDATA[Windows Mobile 7]]></category>

		<guid isPermaLink="false">http://www.tracelight.ch/2009/01/24/windows-mobile-65-information-leaked/</guid>
		<description><![CDATA[We don’t have to wait for the official announcements of Windows Mobile 6.5 to get the latest news about the mobile operating system. Yesterday a beta version of Windows Mobile 6.5 hast been leaked to the public which everyone can install on his qtek 9090. Let me describe what is new in Windows Mobile 6.5 [...]]]></description>
			<content:encoded><![CDATA[<p>We don’t have to wait for the official announcements of Windows Mobile 6.5 to get the latest news about the mobile operating system. Yesterday a beta version of Windows Mobile 6.5 hast been leaked to the public which everyone can install on his qtek 9090. </p>
<p> Let me describe what is new in Windows Mobile 6.5 in counterpart to the Windows Mobile 6.1:
</p>
<ul>
<li>No finger friendly user interface </li>
<li>No multi touch </li>
<li>Internet Explorer Mobile 6 with flash support </li>
<li>Sliding Panels </li>
<li>Scroll without scrollbars </li>
<li>New screen lock </li>
<li>New applications such as market player, my phone </li>
</ul>
<p>You can have a quick look at Windows Mobile 6.5 in the following two videos:</p>
<p><embed src="http://www.motionbox.com/external/hd_player/type=sd,video_uid=0a9adcb11d16e9c187" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" width="416" height="312" allowFullscreen="true" allowScriptAccess="always"></embed></p>
<p><embed align="none" src="http://www.youtube.com/v/wxRGEmx9kbg&amp;rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></p>
<p>As you can see Windows Mobile 6.5 is a major disappointment. Hopefully Windows Mobile 7 will knock us out of the chair!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tracelight.ch/2009/01/24/windows-mobile-65-information-leaked/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rumors about Windows Mobile 6.5</title>
		<link>http://www.tracelight.ch/2009/01/21/rumors-about-windows-mobile-65/</link>
		<comments>http://www.tracelight.ch/2009/01/21/rumors-about-windows-mobile-65/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 20:07:39 +0000</pubDate>
		<dc:creator>Daniel Marbach</dc:creator>
				<category><![CDATA[Mobile Development]]></category>
		<category><![CDATA[Rumors]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[Windows Mobile]]></category>
		<category><![CDATA[Windows Mobile 6.5]]></category>
		<category><![CDATA[Windows7]]></category>

		<guid isPermaLink="false">http://www.tracelight.ch/2009/01/21/rumors-about-windows-mobile-65/</guid>
		<description><![CDATA[There are rumors going around on the internet about the release of windows mobile 6.5. Some say that windows mobile 6.5 is never going to be released but other strongly believe that the new windows mobile 6.5 will be released soon. Not long ago people were blogging on the internet that Microsoft is probably going [...]]]></description>
			<content:encoded><![CDATA[<p>There are rumors going around on the internet about the release of windows mobile 6.5. Some say that windows mobile 6.5 is never going to be released but other strongly believe that the new windows mobile 6.5 will be released soon. </p>
<p>Not long ago people were blogging on the internet that Microsoft is probably going to focus on windows 7 and it’s integration into the newest mobile devices. But that has not been approved by Microsoft.</p>
<p>And today some screenshots about windows mobile 6.5 came up out of never on the following blog:</p>
<p><a title="http://wmpoweruser.com/?p=2536" href="http://wmpoweruser.com/?p=2536">http://wmpoweruser.com/?p=2536</a></p>
<p>Nobody can approve if these screenshots are real or just another horrible fake. We are staying put and watching the latest news on this topic. We’ll keep you guys posted!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tracelight.ch/2009/01/21/rumors-about-windows-mobile-65/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Delegate.DynamicInvoke for .NET Compact Framework</title>
		<link>http://www.tracelight.ch/2009/01/18/delegatedynamicinvoke-for-net-compact-framework/</link>
		<comments>http://www.tracelight.ch/2009/01/18/delegatedynamicinvoke-for-net-compact-framework/#comments</comments>
		<pubDate>Sun, 18 Jan 2009 00:35:14 +0000</pubDate>
		<dc:creator>Daniel Marbach</dc:creator>
				<category><![CDATA[Mobile Development]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[Compact Framework]]></category>
		<category><![CDATA[Delegate]]></category>
		<category><![CDATA[DynamicInvoke]]></category>
		<category><![CDATA[ExtensionMethod]]></category>

		<guid isPermaLink="false">http://www.tracelight.ch/?p=600</guid>
		<description><![CDATA[As you might already know I&#8217;m a certified windows mobile application developer. My speciality is hybrid application development for applications which target both the full .NET framework platform and also the mobile platform. Of course nobody wants to write the same code for each platform again so you have to come up with some tricks [...]]]></description>
			<content:encoded><![CDATA[<p>As you might already know I&#8217;m a certified windows mobile application developer. My speciality is hybrid application development for applications which target both the full .NET framework platform and also the mobile platform. Of course nobody wants to write the same code for each platform again so you have to come up with some tricks and solutions to overcome some limitations on the compact framework.</p>
<p>One such limitation is the missing Delegate.DynamicInvoke method. The Delegate.DynamicInvoke method allows to dynamically invoke delegates late-bound. That means normally when you are invoking a method via a delegate you actually need to have knowledge about the target type where the delegate gets executed. With Delegate.DynamicInvoke this is not longer necessary. The beauty of this is, that you can have base code like the following:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008080; font-style: italic;">// Elsewhere</span>
RegisterDelegate<span style="color: #008000;">&#40;</span>SomeClass<span style="color: #008000;">.</span><span style="color: #0000FF;">SomeMethod</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
RegisterDelegate<span style="color: #008000;">&#40;</span>SomeOtherClass<span style="color: #008000;">.</span><span style="color: #0000FF;">SomeOtherMethod</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
FireForAllWith<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">1</span>, <span style="color: #FF0000;">2</span>, <span style="color: #FF0000;">3</span>, <span style="color: #FF0000;">4</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">// Code in some utility</span>
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> FireForAllWith<span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">params</span> <span style="color: #6666cc; font-weight: bold;">object</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> args<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
   someGenericCollection<span style="color: #008000;">.</span><span style="color: #0600FF; font-weight: bold;">ForEach</span><span style="color: #008000;">&#40;</span>dlg <span style="color: #008000;">=&gt;</span> dlg<span style="color: #008000;">.</span><span style="color: #0000FF;">DynamicInvoke</span><span style="color: #008000;">&#40;</span>args<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span>
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> RegisterDelegate<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">Delegate</span> dlg<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
   someGenericCollection<span style="color: #008000;">.</span><span style="color: #0000FF;">Add</span><span style="color: #008000;">&#40;</span>dlg<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>But if you try to use Delegate.DynamicInvoke in the compact framework your infrastructure code will not compile because for some obscure reasons microsoft decided not to implement Delegate.DynamicInvoke for .NET compact framework. Here is my solution to this problem:</p>
<p>I created an extension method for the delegate class with the name DynamicInvoke. This extension method uses a small trick to implement the DynamicInvoke behaviour of the full framework platform.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">class</span> DelegateExtensions
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">object</span> DynamicInvoke<span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span> <span style="color: #6666cc; font-weight: bold;">Delegate</span> dlg, <span style="color: #0600FF; font-weight: bold;">params</span> <span style="color: #6666cc; font-weight: bold;">object</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> args<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">return</span> dlg<span style="color: #008000;">.</span><span style="color: #0000FF;">Method</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Invoke</span><span style="color: #008000;">&#40;</span>dlg<span style="color: #008000;">.</span><span style="color: #0000FF;">Target</span>, BindingFlags<span style="color: #008000;">.</span><span style="color: #0600FF; font-weight: bold;">Default</span>, <span style="color: #0600FF; font-weight: bold;">null</span>, args, <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span></pre></div></div>

<p>As you can see I&#8217;m using the delegates method property which returns a MethodInfo object. On the MethodInfo I&#8217;m able to call Invoke and pass the arguments to the bound method. But the problem here is that Invoke requires a target where the method gets executed. This is where the delegates target property comes into play. That&#8217;s the whole magic and you&#8217;re able to dynamically invoke late bound methods via Delegate.DynamicInvoke.</p>
<p>Download <a href='http://www.tracelight.ch/wp-content/uploads/2009/01/delegateextensions.cs'>DelegateExtensions</a> for the source code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tracelight.ch/2009/01/18/delegatedynamicinvoke-for-net-compact-framework/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

