<?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>devbar.de &#187; C#</title>
	<atom:link href="http://www.devbar.de/index.php/category/c/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.devbar.de</link>
	<description>just code chunks</description>
	<lastBuildDate>Sat, 07 Jan 2012 19:50:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Top Ten Extensions für Visual Studio 2010</title>
		<link>http://www.devbar.de/index.php/2010/06/top-ten-extensions-fur-visual-studio-2010/</link>
		<comments>http://www.devbar.de/index.php/2010/06/top-ten-extensions-fur-visual-studio-2010/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 03:10:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.devbar.de/?p=564</guid>
		<description><![CDATA[Leider hatte ich noch nicht viel Zeit mich in Visual Studio 2010 reinzufuchsen. Auf CodeProject gibt es aber schonmal die Top Ten Extensions, die man auf jeden Fall braucht  
Links

CodeProject: Top Ten Extensions for Visual Studio 2010

]]></description>
			<content:encoded><![CDATA[<p>Leider hatte ich noch nicht viel Zeit mich in Visual Studio 2010 reinzufuchsen. Auf CodeProject gibt es aber schonmal die Top Ten Extensions, die man auf jeden Fall braucht <img src='http://www.devbar.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Links</p>
<ul>
<li><a href="http://www.codeproject.com/KB/macros/TopTenFreeExtensions2010.aspx">CodeProject: Top Ten Extensions for Visual Studio 2010</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.devbar.de/index.php/2010/06/top-ten-extensions-fur-visual-studio-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Studio 2010 Community Wallpapers</title>
		<link>http://www.devbar.de/index.php/2010/05/visual-studio-2010-community-wallpapers/</link>
		<comments>http://www.devbar.de/index.php/2010/05/visual-studio-2010-community-wallpapers/#comments</comments>
		<pubDate>Mon, 31 May 2010 03:04:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Wallpaper]]></category>

		<guid isPermaLink="false">http://www.devbar.de/?p=557</guid>
		<description><![CDATA[
Links:

Visual Studio 2010 &#8211; Community Wallpapers

]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.devbar.de/wp-content/uploads/2010/05/visualstudio.png"><img class="aligncenter size-full wp-image-558" title="visualstudio" src="http://www.devbar.de/wp-content/uploads/2010/05/visualstudio.png" alt="" width="398" height="358" /></a></p>
<p>Links:</p>
<ul>
<li><a href="http://vs2010wallpapers.com/">Visual Studio 2010 &#8211; Community Wallpapers</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.devbar.de/index.php/2010/05/visual-studio-2010-community-wallpapers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamic in C# 4.0</title>
		<link>http://www.devbar.de/index.php/2010/05/dynamic-in-c-4-0/</link>
		<comments>http://www.devbar.de/index.php/2010/05/dynamic-in-c-4-0/#comments</comments>
		<pubDate>Sun, 30 May 2010 03:11:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://www.devbar.de/?p=537</guid>
		<description><![CDATA[Die Powerbuilder-Entwickler kennen das Schlüsselwert DYNAMIC um beim Aufruf einer Methode erst zur Laufzeit prüfen zu lassen ob diese bereits vorhanden ist. In C# gibt es ab der Version 4.0 ein ähnliches Hilfsmittel um späte Bindung zu vereinfachen.
Das Schlüsselwor DYNAMIC gibt es in C# jetzt auch. Aber anstatt es, wie in Powerbuilder, vor die Methode [...]]]></description>
			<content:encoded><![CDATA[<p>Die Powerbuilder-Entwickler kennen das Schlüsselwert <em>DYNAMIC </em>um beim Aufruf einer Methode erst zur Laufzeit prüfen zu lassen ob diese bereits vorhanden ist. In C# gibt es ab der Version 4.0 ein ähnliches Hilfsmittel um späte Bindung zu vereinfachen.</p>
<p><span id="more-537"></span>Das Schlüsselwor <em>DYNAMIC </em>gibt es in C# jetzt auch. Aber anstatt es, wie in Powerbuilder, vor die Methode oder den Event zu stellen wird es hier als Datentyp eingesetzt.</p>
<p><strong>Powerbuilder:</strong></p>
<pre class="brush: powerbuilder">
powerobject  lpo_powerobject
n_test               lnv_test

lnv_test = CREATE n_test
lpo_powerobject = lnv_test
lpo_powerobject.DYNAMIC of_helloWorld ( )
</pre>
<p><strong>C#</strong></p>
<pre class="brush: csharp">dynamic myobject;
myojbject = new TestA();
myobject.HelloWorld ( );
</pre>
<p>Das heißt natürlich im Umkehrschluss, dass man jetzt jede beliebige Methode als Aufruf programmieren kann ohne dass der Compiler aufmuckt. Ich würde sagen: Fluch und Segen <img src='http://www.devbar.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Daraus folgt aber auch, dass ich jede belibige Klasse unabhängig von Vererbungshierarchie in <em>myObject </em>füllen kann an der die Methode HelloWorld existiert.</p>
<p>Dieses Listing soll das Verhalten verdeutlichen:</p>
<pre class="brush: csharp">
static void Main(string[] args)
{
	dynamic work = null;

	work = new TestA();
	work.HelloWorld();

	work = new TestB();
	work.HelloWorld();

	Console.Read();

}

public class TestA
{
	public void HelloWorld()
	{
		Console.WriteLine("Hallo ich bin TestA");
	}
}

public class TestB
{
	public void HelloWorld()
	{
		Console.WriteLine("Hallo ich bin TestB");
	}
}
</pre>
<p><strong>Fazit</strong></p>
<p>Dynamic ist eine schöne Sache um späte Bindung zu vereinfachen. Früher oder später führt es aber, bei zu häufiger Anwendung, zum Chaos. Also: Immer Verantwortungsbewusst einsetzen <img src='http://www.devbar.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.devbar.de/index.php/2010/05/dynamic-in-c-4-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Augmented Reality mit Goblin XNA</title>
		<link>http://www.devbar.de/index.php/2010/05/augmented-reality-mit-goblin-xna/</link>
		<comments>http://www.devbar.de/index.php/2010/05/augmented-reality-mit-goblin-xna/#comments</comments>
		<pubDate>Fri, 28 May 2010 04:09:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[4fun]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Games]]></category>

		<guid isPermaLink="false">http://www.devbar.de/?p=510</guid>
		<description><![CDATA[Das sieht mal richtig gut aus. Goblin XNA ist ein OpenSource-Framework zur Programmierung von Augmented Reality-Games mit C# / .NET. Das hat jetzt erstmal einen Platz auf meiner ToCode-Liste  
Links

Coding4fun:  Augmnented Reality Domino Knowk-Down Game
Goblin XNA auf CodePlex



]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.devbar.de/wp-content/uploads/2010/05/clip_image0024_thumb-wetfloor.png"><img class="alignright size-medium wp-image-511" title="clip_image002[4]_thumb-wetfloor" src="http://www.devbar.de/wp-content/uploads/2010/05/clip_image0024_thumb-wetfloor-300x290.png" alt="" width="201" height="194" /></a>Das sieht mal richtig gut aus. Goblin XNA ist ein OpenSource-Framework zur Programmierung von Augmented Reality-Games mit C# / .NET. Das hat jetzt erstmal einen Platz auf meiner ToCode-Liste <img src='http://www.devbar.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Links</p>
<ul>
<li><a href="http://blogs.msdn.com/coding4fun/archive/2010/05/13/10012840.aspx">Coding4fun:  Augmnented Reality Domino Knowk-Down Game</a></li>
<li><a href="http://goblinxna.codeplex.com/">Goblin XNA auf CodePlex</a></li>
</ul>
<p><span id="more-510"></span><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="350" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.youtube.com/v/6AKgH4On65A" /><embed type="application/x-shockwave-flash" width="425" height="350" src="http://www.youtube.com/v/6AKgH4On65A"></embed></object></p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="350" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.youtube.com/v/c_LrVqI6StY" /><embed type="application/x-shockwave-flash" width="425" height="350" src="http://www.youtube.com/v/c_LrVqI6StY"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.devbar.de/index.php/2010/05/augmented-reality-mit-goblin-xna/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Einstieg in ASP.NET</title>
		<link>http://www.devbar.de/index.php/2010/05/einstieg-in-asp-net/</link>
		<comments>http://www.devbar.de/index.php/2010/05/einstieg-in-asp-net/#comments</comments>
		<pubDate>Thu, 27 May 2010 04:11:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://www.devbar.de/?p=506</guid>
		<description><![CDATA[Ich versuche mich momentan ein bischen in ASP.NET einzuarbeiten. Ein Freund von mir hat dieses Buch empfohlen und bisher bin ich wirklich begeistert. Der Schreiber kommt schnell auf den Punkt und es gibt viele praktische Beispiele mit denen man arbeiten kann.
Aber jetzt kommt&#8217;s : 70 Euronen. Mein Herz hat geblutet  . Das Buch ist [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.amazon.de/gp/product/1590598911?ie=UTF8&amp;tag=devbarde-21&amp;linkCode=as2&amp;camp=1638&amp;creative=19454&amp;creativeASIN=1590598911"><img class="alignright size-medium wp-image-507" title="asp-wetfloor" src="http://www.devbar.de/wp-content/uploads/2010/05/asp-wetfloor-174x300.png" alt="" width="174" height="300" /></a>Ich versuche mich momentan ein bischen in ASP.NET einzuarbeiten. Ein Freund von mir hat dieses Buch empfohlen und bisher bin ich wirklich begeistert. Der Schreiber kommt schnell auf den Punkt und es gibt viele praktische Beispiele mit denen man arbeiten kann.</p>
<p>Aber jetzt kommt&#8217;s : 70 Euronen. Mein Herz hat geblutet <img src='http://www.devbar.de/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> . Das Buch ist zwar sein Geld Wert, aber trotzdem frag&#8217; ich mich natürlich ob man nicht auch günstiger in&#8217;s Thema kommt. Vielleicht habt ihr ja einen Tipp.</p>
<p>Ansonsten würde ich es aber trotzdem weiterempfehlen.</p>
<p>Links:</p>
<ul>
<li><a href="http://www.amazon.de/gp/product/1590598911?ie=UTF8&amp;tag=devbarde-21&amp;linkCode=as2&amp;camp=1638&amp;creative=19454&amp;creativeASIN=1590598911">Amazon</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.devbar.de/index.php/2010/05/einstieg-in-asp-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tuples in C# 4.0 verwenden</title>
		<link>http://www.devbar.de/index.php/2010/05/tuples-in-c-4-0-verwenden/</link>
		<comments>http://www.devbar.de/index.php/2010/05/tuples-in-c-4-0-verwenden/#comments</comments>
		<pubDate>Tue, 25 May 2010 04:15:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://devbar.de/?p=471</guid>
		<description><![CDATA[Tuples sind eine Möglichkeit Elemente mit verschiedenen Datentypen zu gruppieren. In Python oder Haspell gibt es dieses Feature schon länger. In .NET kann man Tuples ab der Version 4.0 nutzen.
Tuples erstellen
Um einen Tuple in C# zu erstellen benötigt man den Standardtyp Tuple. Die Tuple-Klasse hat 8 überladene statische Methoden mit dem Namen Create.

Create (T1)
Create(T1,T2)
Create(T1,T2,T3)
Create(T1,T2,T3,T4)
Create(T1,T2,T3,T4,T5)
Create(T1,T2,T3,T4,T5,T6,T7)
Create(T1,T2,T3,T4,T5,T6,T7,T8)

Die Methoden [...]]]></description>
			<content:encoded><![CDATA[<p>Tuples sind eine Möglichkeit Elemente mit verschiedenen Datentypen zu gruppieren. In Python oder Haspell gibt es dieses Feature schon länger. In .NET kann man Tuples ab der Version 4.0 nutzen.</p>
<p><span id="more-471"></span><strong>Tuples erstellen</strong></p>
<p>Um einen Tuple in C# zu erstellen benötigt man den Standardtyp <em>Tuple</em>. Die Tuple-Klasse hat 8 überladene statische Methoden mit dem Namen <em>Create</em>.</p>
<ul>
<li>Create (T1)</li>
<li>Create(T1,T2)</li>
<li>Create(T1,T2,T3)</li>
<li>Create(T1,T2,T3,T4)</li>
<li>Create(T1,T2,T3,T4,T5)</li>
<li>Create(T1,T2,T3,T4,T5,T6,T7)</li>
<li>Create(T1,T2,T3,T4,T5,T6,T7,T8)</li>
</ul>
<p>Die Methoden geben folgende Datentypen zurück.</p>
<ul>
<li>Tuple&lt;T1&gt;</li>
<li>Tuple&lt;T1,T2&gt;</li>
<li>Tuple&lt;T1,T2,T3&gt;</li>
<li>Tuple&lt;T1,T2,T3,T4&gt;</li>
<li>Tuple&lt;T1,T2,T3,T4,T5&gt;</li>
<li>Tuple&lt;T1,T2,T3,T4,T5,T6&gt;</li>
<li>Tuple&lt;T1,T2,T3,T4,T5,T6,T7&gt;</li>
<li>Tuple&lt;T1,T2,T3,T4,T5,T6,T7,TRest&#8230;&gt; ( alle Tuples &gt; 8 wie das geht kommt noch <img src='http://www.devbar.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  )</li>
</ul>
<p>Hier der Code um einen einfachen Tuple zu erstellen.</p>
<pre class="brush: csharp">var album = Tuple.Create&lt;string,int&gt;("Rammstein", 2008);
Console.WriteLine(album);
Console.Read();</pre>
<p>Die Ausgabe ist: <em>(Rammstein, 2008)</em></p>
<p>Natürlich kann man auch auf einzelne Elemente zugreifen.</p>
<pre class="brush: csharp">var album = Tuple.Create&lt;string,int&gt;("Rammstein", 2008);
Console.WriteLine("Band: {0}, Jahr: {1}", album.Item1, album.Item2);
Console.Read();</pre>
<p>Die Ausgabe ist: <em>Band: Rammstein, Jahr: 2008</em></p>
<p><strong>Verschachtelte Tuples</strong></p>
<p>Tuples lassen sich auch verschachteln.</p>
<pre class="brush: csharp">var album = Tuple.Create("Rammstein", 2008,new Tuple&lt;int,int&gt;(1,2));
Console.WriteLine(album);
Console.Read();</pre>
<p>Die Ausgabe ist: <em>(Rammstein,(1,2))</em></p>
<p><strong>Tuples &gt; 8</strong></p>
<p>Die Create-Methoden haben nur 8 Überladungen. Wenn man Tuples erstellen will, die größer als 8 Elemente sind, benutzt man den new-Operator.</p>
<pre class="brush: csharp">var album = new Tuple&lt;string, int, int, int, int, int, int,  Tuple&lt;int, int&gt;&gt;("Rammstein", 1, 2, 3, 4, 5, 6, new  Tuple&lt;int, int&gt;(8, 9));
Console.WriteLine(album);
Console.Read();</pre>
<p>Die Ausfabe ist:<em> (Rammstein, 1, 2, 3, 4, 5, 6, 7, 8, 9)</em></p>
<p>Das direkte zugreifen auf die Elemente ist ebenfalls möglich.</p>
<pre class="brush: csharp">var album = new Tuple&lt;string, int, int, int, int, int, int, Tuple&lt;int, int&gt;&gt;("Rammstein", 1, 2, 3, 4, 5, 6, new Tuple&lt;int, int&gt;(8, 9));
Console.WriteLine(album.Rest.Item1);
Console.Read();
</pre>
<p><strong>Fazit</strong></p>
<p>Hin und wieder kommt man in die Verlegenheit temporär Daten speichern zu müssen. Eine vernünftige Gruppierung hält den Code sauber und übersichtlich. Was man allerdings vermeiden sollte, ist das Verwenden von Tuples anstatt eines sauberen Klassenkonzepts. Wenn ich also meinen Album-Datentyp noch öfter brauchen werden, dann erstelle ich mir lieber eine Klasse mit sprechend benannten Attributen anstatt<em> Item1 Item2,</em> <em>etc</em>.</p>
<p>Und noch etwas zum Schluss: Die Frage die ich mir zu Anfang gestellt habe war, warum man hier mit der Begrenzung auf 8 Parameter arbeitet. Des Rätsels Lösung: C# unterstützt keine generischen Konstruktoren/Methoden mit unterschiedlichen Datentypen. Soll heißen, dass z.B <em>Create</em> nur generisch sein könnte, wenn es nur int-Werte nehmen würde. Das ergibt aber keinen Sinn, da man dann besser ein Array deklarieren könnte.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devbar.de/index.php/2010/05/tuples-in-c-4-0-verwenden/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Programming WPF</title>
		<link>http://www.devbar.de/index.php/2010/05/programming-wpf/</link>
		<comments>http://www.devbar.de/index.php/2010/05/programming-wpf/#comments</comments>
		<pubDate>Mon, 24 May 2010 03:11:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Powerbuilder]]></category>
		<category><![CDATA[Bücher]]></category>
		<category><![CDATA[xaml]]></category>

		<guid isPermaLink="false">http://devbar.de/?p=474</guid>
		<description><![CDATA[Dieses Buch habe ich vor ca. 3 Jahren in die Hand genommen um mich ein bischen in WPF einzulesen. Meiner Meinung nach das beste Druckwerk um einen umfassenden Einstieg in das Thema zu bekommen.
Wer also der englischen Sprache mächtig ist sollte hier zugreifen. Ich finde ~ 30 Euro für ein Fachbuch ist auch noch im [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.amazon.de/gp/product/0596510373?ie=UTF8&amp;tag=devbarde-21&amp;linkCode=as2&amp;camp=1638&amp;creative=19454&amp;creativeASIN=0596510373"><img class="alignright size-full wp-image-475" title="wpf_buch" src="http://devbar.de/wp-content/uploads/2010/05/wpf_buch.png" alt="" width="192" height="300" /></a>Dieses Buch habe ich vor ca. 3 Jahren in die Hand genommen um mich ein bischen in WPF einzulesen. Meiner Meinung nach das beste Druckwerk um einen umfassenden Einstieg in das Thema zu bekommen.</p>
<p>Wer also der englischen Sprache mächtig ist sollte hier zugreifen. Ich finde ~ 30 Euro für ein Fachbuch ist auch noch im sehr fairen Bereich.</p>
<p>Links:</p>
<ul>
<li><a href="http://www.amazon.de/gp/product/0596510373?ie=UTF8&amp;tag=devbarde-21&amp;linkCode=as2&amp;camp=1638&amp;creative=19454&amp;creativeASIN=0596510373">Amazon</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.devbar.de/index.php/2010/05/programming-wpf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Entwurfsmuster von Kopf bis Fuß</title>
		<link>http://www.devbar.de/index.php/2010/05/buchtipp-entwurfsmuster-von-kopf-bis-fus/</link>
		<comments>http://www.devbar.de/index.php/2010/05/buchtipp-entwurfsmuster-von-kopf-bis-fus/#comments</comments>
		<pubDate>Sun, 23 May 2010 03:15:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Bücher]]></category>

		<guid isPermaLink="false">http://devbar.de/?p=464</guid>
		<description><![CDATA[Das Buch richtet sich an fortgeschrittene OO-Entwickler die ihren Horizont erweitern möchten. Es geht darum wie man mit Entwurfsmustern wiederkehrende Programmierprobleme des Alltags elegant löst.
Mir hat das Buch viele Erkenntnisse über meinen eigenen Programmierstil und Verbesserungsmöglichkeiten geliefert. Vererbung ist z.B. nicht immer der beste Weg und wie setzt man Interfaces sinnvoll ein.
Das Buch richtet sich [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.amazon.de/gp/product/3897214210?ie=UTF8&amp;tag=devbarde-21&amp;linkCode=as2&amp;camp=1638&amp;creative=6742&amp;creativeASIN=3897214210"><img class="size-full wp-image-465 alignright" title="517HsBMdL4L._SL160_-wetfloor" src="http://devbar.de/wp-content/uploads/2010/05/517HsBMdL4L._SL160_-wetfloor.png" alt="" width="138" height="208" /></a>Das Buch richtet sich an fortgeschrittene OO-Entwickler die ihren Horizont erweitern möchten. Es geht darum wie man mit Entwurfsmustern wiederkehrende Programmierprobleme des Alltags elegant löst.</p>
<p>Mir hat das Buch viele Erkenntnisse über meinen eigenen Programmierstil und Verbesserungsmöglichkeiten geliefert. Vererbung ist z.B. nicht immer der beste Weg und wie setzt man Interfaces sinnvoll ein.</p>
<p>Das Buch richtet sich zwar eher an Java-Entwickler aber wer C# kann, kommt auch sehr gut zurecht. Den reinen Powerbuilder-Entwicklern würde ich abraten. Viele Elemente (Interfaces, EventHandler, Enumarations, &#8230; ) gibt es in der Powerbuilder Classic nicht und in Powerbuilder .NET nur bedingt.</p>
<p>Kritikpunkt ist sicherlich der Preis, der mit Knapp 50 Euronen doch sehr happig ist. Ich habe die Investition aber nicht bereut.</p>
<p>Links:</p>
<ul>
<li><a href="http://www.amazon.de/gp/product/3897214210?ie=UTF8&amp;tag=devbarde-21&amp;linkCode=as2&amp;camp=1638&amp;creative=6742&amp;creativeASIN=3897214210">Amazon</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.devbar.de/index.php/2010/05/buchtipp-entwurfsmuster-von-kopf-bis-fus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wake-On-Lan mit C#-Methode auslösen</title>
		<link>http://www.devbar.de/index.php/2010/05/wake-on-lan-mit-c-methode-auslosen/</link>
		<comments>http://www.devbar.de/index.php/2010/05/wake-on-lan-mit-c-methode-auslosen/#comments</comments>
		<pubDate>Wed, 19 May 2010 05:11:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[wakeonlan]]></category>

		<guid isPermaLink="false">http://devbar.de/?p=381</guid>
		<description><![CDATA[Ich hätte hier mal ein kleines Snippet, was ich euch nicht vorenthalten will. Die Methode schickt das sogenannte &#8220;Magic Packet&#8221; an einen Rechner im lokalen Netz um diesen per Wake-On-Lan einzuschalten (vorausgesetzt die Konfiguration ist korrekt und die Hardware unterstützt Wake-On-Lan). Das ganze habe ich für Quickschedule gebraucht. Das ist ein kleines Tool um Aufnahmen [...]]]></description>
			<content:encoded><![CDATA[<p>Ich hätte hier mal ein kleines Snippet, was ich euch nicht vorenthalten will. Die Methode schickt das sogenannte &#8220;Magic Packet&#8221; an einen Rechner im lokalen Netz um diesen per Wake-On-Lan einzuschalten (vorausgesetzt die Konfiguration ist korrekt und die Hardware unterstützt Wake-On-Lan). Das ganze habe ich für <a href="http://forum.team-mediaportal.com/general-development-no-feature-request-here-48/quickschedule-37721/">Quickschedule</a> gebraucht. Das ist ein kleines Tool um Aufnahmen vom <a href="http://www.tvbrowser.org/">TVBrowser</a> in&#8217;s <a href="http://www.team-mediaportal.com/">Mediaportal</a> zu schieben.</p>
<p><span id="more-381"></span></p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">int</span> WakeOnLan<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span> macString<span style="color: #008000;">&#41;</span><br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #6666cc; font-weight: bold;">byte</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> mac <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> <span style="color: #6666cc; font-weight: bold;">byte</span><span style="color: #008000;">&#91;</span><span style="color: #FF0000;">6</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; <span style="color: #6666cc; font-weight: bold;">string</span> macPart <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">// parsing loop to convert string to byte array</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">for</span> <span style="color: #008000;">&#40;</span> <span style="color: #6666cc; font-weight: bold;">int</span> i <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span> i <span style="color: #008000;">&amp;</span>lt<span style="color: #008000;">;</span> <span style="color: #FF0000;">6</span><span style="color: #008000;">;</span> i<span style="color: #008000;">++</span> <span style="color: #008000;">&#41;</span><span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; macPart <span style="color: #008000;">=</span> macString<span style="color: #008000;">.</span><span style="color: #0000FF;">Substring</span><span style="color: #008000;">&#40;</span>i<span style="color: #008000;">*</span><span style="color: #FF0000;">3</span>,<span style="color: #FF0000;">2</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span> macPart<span style="color: #008000;">.</span><span style="color: #0000FF;">Equals</span><span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">String</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Empty</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Error<span style="color: #008000;">.</span><span style="color: #0000FF;">Show</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Error parsing mac&quot;</span>, Error<span style="color: #008000;">.</span><span style="color: #0000FF;">Severity</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Error</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">return</span> <span style="color: #008000;">-</span><span style="color: #FF0000;">1</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; mac<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span> <span style="color: #008000;">=</span> <span style="color: #6666cc; font-weight: bold;">byte</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Parse</span><span style="color: #008000;">&#40;</span>macPart, <span style="color: #000000;">System.<span style="color: #0000FF;">Globalization</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">NumberStyles</span><span style="color: #008000;">.</span><span style="color: #0000FF;">HexNumber</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">// WOL always via UDP 255.255.255.0:40000.</span><br />
&nbsp; &nbsp; UdpClient client <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> UdpClient<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; client<span style="color: #008000;">.</span><span style="color: #0000FF;">Connect</span><span style="color: #008000;">&#40;</span>IPAddress<span style="color: #008000;">.</span><span style="color: #0000FF;">Broadcast</span>, <span style="color: #FF0000;">40000</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">// WOL packet contains a 6-bytes trailer and 16 times a 6-bytes sequence containing the MAC address.</span><br />
&nbsp; &nbsp; <span style="color: #6666cc; font-weight: bold;">byte</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> packet <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> <span style="color: #6666cc; font-weight: bold;">byte</span><span style="color: #008000;">&#91;</span><span style="color: #FF0000;">17</span> <span style="color: #008000;">*</span> <span style="color: #FF0000;">6</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">// Trailer of 6 times 0xFF.</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">int</span> i <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span> i <span style="color: #008000;">&amp;</span>lt<span style="color: #008000;">;</span> <span style="color: #FF0000;">6</span><span style="color: #008000;">;</span> i<span style="color: #008000;">++</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; packet<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span> <span style="color: #008000;">=</span> 0xFF<span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">// Body of magic packet contains 16 times the MAC address.</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">int</span> i <span style="color: #008000;">=</span> <span style="color: #FF0000;">1</span><span style="color: #008000;">;</span> i <span style="color: #008000;">&amp;</span>lt<span style="color: #008000;">;=</span> <span style="color: #FF0000;">16</span><span style="color: #008000;">;</span> i<span style="color: #008000;">++</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">int</span> j <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span> j <span style="color: #008000;">&amp;</span>lt<span style="color: #008000;">;</span> <span style="color: #FF0000;">6</span><span style="color: #008000;">;</span> j<span style="color: #008000;">++</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; packet<span style="color: #008000;">&#91;</span>i <span style="color: #008000;">*</span> <span style="color: #FF0000;">6</span> <span style="color: #008000;">+</span> j<span style="color: #008000;">&#93;</span> <span style="color: #008000;">=</span> mac<span style="color: #008000;">&#91;</span>j<span style="color: #008000;">&#93;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">// go go go</span><br />
&nbsp; &nbsp; client<span style="color: #008000;">.</span><span style="color: #0000FF;">Send</span><span style="color: #008000;">&#40;</span>packet, packet<span style="color: #008000;">.</span><span style="color: #0000FF;">Length</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">return</span> <span style="color: #FF0000;">1</span><span style="color: #008000;">;</span><br />
<span style="color: #008000;">&#125;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.devbar.de/index.php/2010/05/wake-on-lan-mit-c-methode-auslosen/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Transparente Fenster in C#</title>
		<link>http://www.devbar.de/index.php/2010/05/transparente-fenster-in-c/</link>
		<comments>http://www.devbar.de/index.php/2010/05/transparente-fenster-in-c/#comments</comments>
		<pubDate>Mon, 17 May 2010 05:14:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[winform]]></category>

		<guid isPermaLink="false">http://devbar.de/?p=319</guid>
		<description><![CDATA[
Hier mal ein bischen Quick &#38; Dirty für euch, wie man &#8220;Glassfenster&#8221; unter Windows 7 bzw. Windows Vista erstellt.
C#
Als erstes erstellt ihr eine Winform-Anwendung und deklariert folgende externe Funktionen.
[DllImport("dwmapi.dll", PreserveSig = false)]
public static extern void DwmExtendFrameIntoClientArea
(IntPtr hwnd, ref MARGINS margins);

[DllImport("dwmapi.dll", PreserveSig = false)]
public static extern bool DwmIsCompositionEnabled();

Außerdem braucht ihr diese Struktur.
[StructLayout(LayoutKind.Sequential)]
public struct MARGINS
{
 public int [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;"><a href="http://devbar.de/wp-content/uploads/2010/05/2010-05-10-20h20_16.png"><img class="size-full wp-image-329    aligncenter" title="2010-05-10 20h20_16" src="http://devbar.de/wp-content/uploads/2010/05/2010-05-10-20h20_16.png" alt="" width="330" height="408" /></a></p>
<p style="text-align: left;">Hier mal ein bischen Quick &amp; Dirty für euch, wie man &#8220;Glassfenster&#8221; unter Windows 7 bzw. Windows Vista erstellt.</p>
<p><span id="more-319"></span><strong>C#</strong></p>
<p>Als erstes erstellt ihr eine Winform-Anwendung und deklariert folgende externe Funktionen.</p>
<pre class="brush: csharp">[DllImport("dwmapi.dll", PreserveSig = false)]
public static extern void DwmExtendFrameIntoClientArea
(IntPtr hwnd, ref MARGINS margins);

[DllImport("dwmapi.dll", PreserveSig = false)]
public static extern bool DwmIsCompositionEnabled();
</pre>
<p>Außerdem braucht ihr diese Struktur.</p>
<pre class="brush: csharp">[StructLayout(LayoutKind.Sequential)]
public struct MARGINS
{
 public int Left;
 public int Right;
 public int Top;
 public int Bottom;
}
</pre>
<p>Als Nächstes müsst ihr die &#8220;OnLoad&#8221;-Methode überschreiben.</p>
<pre class="brush: csharp">protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
if (DwmIsCompositionEnabled())
{
 // Paint the glass effect.

 margins = new MARGINS();
 margins.Top = -1;
 margins.Left = -1;
 margins.Right = -1;
 margins.Bottom = -1;
 DwmExtendFrameIntoClientArea(this.Handle, ref margins);
 }
}
</pre>
<p>Zum Schluss noch &#8220;OnPaintBackground&#8221; überschreiben.</p>
<pre class="brush: csharp">protected override void OnPaintBackground(PaintEventArgs e)
{
 base.OnPaintBackground(e);

 if (DwmIsCompositionEnabled())
 {
  // paint background black to enable include glass regions

  e.Graphics.Clear(Color.Black);
  // revert the non-glass rectangle back to it's original colour

  Rectangle clientArea = new Rectangle(
  margins.Left,
  margins.Top,
  this.ClientRectangle.Width - margins.Left - margins.Right,
  this.ClientRectangle.Height - margins.Top - margins.Bottom
  );
  Brush b = new SolidBrush(this.BackColor);
  e.Graphics.FillRectangle(b, clientArea);
 }
}
</pre>
<p>Fertig!</p>
<p>Download:</p>
<ul>
<li><a href="http://devbar.de/wp-content/uploads/2010/05/AeroGlass_CSharp.zip">AeroGlass_CSharp</a></li>
</ul>
<p>Links:</p>
<ul>
<li><a href="http://www.codeproject.com/KB/vista/AeroGlassForms.aspx">CodeProject-Artikel</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.devbar.de/index.php/2010/05/transparente-fenster-in-c/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

