<?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>EntwicklerForum.org</title>
	<atom:link href="http://www.entwicklerforum.org/feed" rel="self" type="application/rss+xml" />
	<link>http://www.entwicklerforum.org</link>
	<description>Tipps und Tricks für Entwickler</description>
	<lastBuildDate>Fri, 09 Dec 2011 17:54:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Eigene Ma&#223;nahmen zur Systempflege bei Mac OS X</title>
		<link>http://www.entwicklerforum.org/eigene-systempflegemassnahmen</link>
		<comments>http://www.entwicklerforum.org/eigene-systempflegemassnahmen#comments</comments>
		<pubDate>Wed, 26 Oct 2011 17:02:59 +0000</pubDate>
		<dc:creator>m.rastetter</dc:creator>
				<category><![CDATA[OS - Betriebssysteme]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://www.entwicklerforum.org/?p=1857</guid>
		<description><![CDATA[Wie schon in einem der voraufgegangenen Artikel n&#228;her beleuchtet wurde, ist Mac OS X mit einem leistungsf&#228;higen und flexiblen Steuerungsmechanismus zur automatisierten Systempflege ausgestattet. Will man seine eigenen Vorg&#228;nge in Form von Skripts o.&#228;. regelm&#228;&#223;ig ausf&#252;hren lassen, dann hat man folgende M&#246;glichkeiten. 1. Einf&#252;gen eines eigenen Skripts in den existierenden periodic Mechanismus Abh&#228;ngig davon, ob [...]]]></description>
			<content:encoded><![CDATA[<p>Wie schon in einem der <a href="./automatische-systempflege/">voraufgegangenen Artikel</a> n&#228;her beleuchtet wurde, ist <em>Mac OS X</em> mit einem leistungsf&#228;higen und flexiblen Steuerungsmechanismus zur automatisierten Systempflege ausgestattet.</p>
<p>Will man seine eigenen Vorg&#228;nge in Form von Skripts o.&#228;. regelm&#228;&#223;ig ausf&#252;hren lassen, dann hat man folgende M&#246;glichkeiten.</p>
<blockquote><p>1. Einf&#252;gen eines eigenen Skripts in den existierenden <a href="http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man8/periodic.8.html">periodic</a> Mechanismus
</p></blockquote>
<p>Abh&#228;ngig davon, ob der Vorgang t&#228;glich, w&#246;chentlich oder monatlich ablaufen soll, gibt es eine daf&#252;r vorgefertigte Ablage:<br />
 * /etc/periodic/daily &#8211; Verzeichnis, welches die t&#228;glich auszuf&#252;hrenden Skripts enth&#228;lt<br />
 * /etc/periodic/weekly  &#8211; Verzeichnis, welches die w&#246;chentlich auszuf&#252;hrenden Skripts enth&#228;lt<br />
 * /etc/periodic/monthly  &#8211; Verzeichnis, welches die monatlich auszuf&#252;hrenden Skripts enth&#228;lt</p>
<p>Die Reihenfolge wie die Skripts ausgef&#252;hrt werden ist &#252;ber die vorangestellte Zahl definiert. Und die Uhrzeit wann die Skripts gestartet werden, ist &#252;ber die Konfiguration des <a href="http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man8/periodic.8.html">periodic</a> Mechanismus definiert. Wie man die Ausf&#252;hrungszeit dieses Dienstes beeinflussen kann, erf&#228;hrt man <a href="./automatische-systempflege/">hier</a>.</p>
<blockquote><p>2. Hinzuf&#252;gen eines eigenen Skripts bzw. Skriptaufrufs in einen vorgefertigten Platzhalter.
</p></blockquote>
<p>Jeweils am Ende eines <a href="http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man8/periodic.8.html">periodic</a> Ablaufs wird ein vordefiniertes Skript ausgef&#252;hrt, sofern es existiert.<br />
 * /etc/daily.local<br />
 * /etc/weekly.local<br />
 * /etc/monthly.local</p>
<p>Werden verschiedene Interpreter zur Ausf&#252;hrung der Befehle ben&#246;tigt, dann kann man aus dieser Datei weitere Skripts aufrufen. Dann sind f&#252;r den Fall eines Abbruchs jedoch spezielle Vorkehrungen zu treffen.</p>
<p>Anstatt eines Skripts lassen sich auch mehrere oder der Inhalt eines ganzen Verzeichnis ausf&#252;hren. In diesem Fall kann man in einer der unter 3. erw&#228;hnten Dateien die Variablen:<br />
 * $daily_local<br />
 * $weekly_local<br />
 * $monthly_local<br />
&#252;berschreiben (z.B. monthly_local=&#8221;/usr/local/scripts.monthly/*&#8221;).</p>
<blockquote><p>3. Vorgesehene Ablage aktivieren &#8230;
</p></blockquote>
<p>Entsprechend den Anforderungen eigene Konfigurationsvariablen hinterlegen oder vorhandene &#252;berschreiben. Daf&#252;r sind zwei Dateien vorgesehen:<br />
 * /etc/periodic.conf<br />
 * /etc/periodic.conf.local<br />
Auch ein Verzeichnis zur Ablage der eigenen Ma&#223;nahmen ist schon definiert: <strong><em>/usr/local/etc/periodic</em></strong> in der Variable $local_periodic.<br />
Es wird allerdings vom bestehenden Mechanismus (noch) nicht verwendet.<br />
Bei Bedarf kann man es in einer der beiden o.g. lokalen Konfigurationsdateien anpassen.</p>
<p>Analog zu den 999.local Skripts in den unter 1. aufgef&#252;hrten Verzeichnissen bspw. 888.local Skripts anlegen, welche die ben&#246;tigten selbstdefinierten Variable auswerten.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entwicklerforum.org/eigene-systempflegemassnahmen/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wetter App mit Silverlight erstellen &#252;ber Google Weather API</title>
		<link>http://www.entwicklerforum.org/wetter-app-mit-silverlight-erstellen-uber-google-weather-api-6</link>
		<comments>http://www.entwicklerforum.org/wetter-app-mit-silverlight-erstellen-uber-google-weather-api-6#comments</comments>
		<pubDate>Mon, 24 Oct 2011 13:23:09 +0000</pubDate>
		<dc:creator>r.doderer</dc:creator>
				<category><![CDATA[.Net / ASP.Net / C#]]></category>
		<category><![CDATA[Silverlight, Flex, Flash]]></category>
		<category><![CDATA[C, C++, Objective-C]]></category>

		<guid isPermaLink="false">http://www.entwicklerforum.org/?p=1685</guid>
		<description><![CDATA[Vorwort Dieses Tutorial ist f&#252;r Einsteiger gedacht. Um mitarbeiten zu k&#246;nnen ben&#246;tigen Sie Visual Studio 2010 mit dem Silverlight 4 Add On und Vorkenntnisse in C#. Ich zeige Ihnen hier lediglich eine von vielen L&#246;sungen dieses Problems. Inhalt Google Weather API Erstellen eines Proxy-Services Klassendiagramm Erstellen der Klassen Erstellen der GUI &#160; Google Weather API [...]]]></description>
			<content:encoded><![CDATA[<p><span style="text-decoration: underline;">Vorwort</span></p>
<p>Dieses Tutorial ist f&#252;r Einsteiger gedacht. Um mitarbeiten zu k&#246;nnen ben&#246;tigen Sie Visual Studio 2010 mit dem Silverlight 4 Add On und Vorkenntnisse in C#. Ich zeige Ihnen hier lediglich eine von vielen L&#246;sungen dieses Problems.<br />
<span id="more-1685"></span><br />
<span style="text-decoration: underline;">Inhalt</span></p>
<ol>
<li><a href="#GoogleWeatherAPI">Google Weather API</a></li>
<li><a href="#ProxyService">Erstellen eines Proxy-Services</a></li>
<li><a href="#KlassenDiagramm">Klassendiagramm</a></li>
<li><a href="#Klassen">Erstellen der Klassen</a></li>
<li><a href="#GUI">Erstellen der GUI</a></li>
</ol>
<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><a name="GoogleWeatherAPI">Google Weather API</a></span></p>
<p>Vorab m&#252;ssen Sie dar&#252;ber im Klaren sein, dass die API nicht Dokumentiert ist. Schauen wir uns die API genauer an:</p>
<p>http://www.google.com/ig/api?weather=Stadt.Land&#038;hl=De</p>
<p>Wenn wir den Link genauer betrachten sehen wir, dass er drei Parameter besitzt welche wir ver&#228;ndern k&#246;nnen. Hier &#8220;Stadt&#8221;, &#8220;Land&#8221; und &#8220;De&#8221;. Man kann allerdings &#8220;Land&#8221; weglassen und anstelle einer Stadt deren Postleitzahl eingeben. Mit dem &#8220;De&#8221; am Ende des Links geben wir an in welcher Sprache uns die Wetterdaten &#252;bermittelt werden sollen. Wenn wir den Link nach diesen Angaben bearbeiten sieht er z.B. so aus:</p>
<p><a href="http://www.google.com/ig/api?weather=Berlin.germany&amp;hl=De" target="_blank">http://www.google.com/ig/api?weather=Berlin.germany&amp;hl=De </a></p>
<p>Hierbei ist es egal ob man das Land in Englisch oder in Deutsch schreibt.</p>
<p>Beim aufrufen dieses Links wird uns eine XML-Struktur angezeigt die wie folgt aussieht:</p>
<p><img src="http://www.entwicklerforum.org/wp-content/uploads/2011/10/xml_full.png" alt="" /></p>
<p>Es gibt nur drei unterschiedliche Parts die f&#252;r uns Interessant sind und zwar:</p>
<p><img src="http://www.entwicklerforum.org/wp-content/uploads/2011/10/important_datas.png" alt="" /></p>
<p>Nun werfen wir einen n&#228;heren Blick auf die drei verschiedenen Parts und suchen uns die Attribute raus die f&#252;r uns wichtig sind.</p>
<p><img src="http://www.entwicklerforum.org/wp-content/uploads/2011/10/xml_important_dates1.png" alt="" /></p>
<ol>
<li>Gibt uns Stadt und Bundesland.</li>
<li>Gibt uns das aktuelle Datum.</li>
<li>Gibt uns an wie das Wetter voraussichtlich wird.</li>
<li>Gibt uns die aktuelle Temperatur in Celsius.</li>
<li>Gibt uns die aktuelle Luftfeuchtigkeit.</li>
<li>Gibt den Pfad an wo das aktuelle Bild zum Wetter liegt.</li>
<li>Gibt uns die aktuelle Windst&#228;rke und Richtung.</li>
<li>Gibt uns den Wochentag.</li>
<li>Gibt uns die Mindesttemperatur.</li>
<li>Gibt uns die Maximaltemperatur.</li>
</ol>
<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><a name="ProxyService">Erstellen eines Proxy-Services</a></span></p>
<p>Da wir nun die XML-Struktur verstanden und uns die f&#252;r uns wichtigen Punkte herausgesucht haben, geht es daran die API mit Silverlight zu Konsumieren. Hier tritt das erste Problem auf. Silverlight bekommt keinen Zugriff auf die Google API, da es keine <em>crossdomain.xml </em>und keine <em>clientaccesspolicy.xml</em> findet, die Silverlight die Berechtigung zum Zugriff gibt. Silverlight braucht eine von diesen beiden Dateien. In diesen Dateien gibt der Eigent&#252;mer an auf welche Services und Inhalte von wem zugegriffen werden darf und auf welche nicht. Die <em>clientaccesspolicy.xml</em> ist speziell f&#252;r Silverlight entwickelt worden. Die <em>crossdomain.xml </em>wird von Flash verwendet aber da diese Datei schon ziemlich viel Verwendung im Internet hatte haben sich die Entwickler von Silverlight daf&#252;r entschlossen das Silverlight auch nach der<em> crossdomain.xml</em>-Datei sucht. Allerdings nur wenn es keine <em>clientaccesspolicy.xml</em> findet und wenn in der<em> crossdomain.xml</em> der Zugriff von allen Dom&#228;nen gestattet wird. Um trotzdem mit Silverlight auf die Google Weather API zugreifen zu k&#246;nnen, ist ein Proxy-Service notwendig, der sich auf der Download Dom&#228;ne der Silverlight Applikation befindet und die Anfragen an die API stellt. Einen solchen Service erstellen wir an dieser Stelle.</p>
<p><strong>Zur Verdeutlichung:</strong></p>
<p><img src="http://www.entwicklerforum.org/wp-content/uploads/2011/10/proxy_server.png" alt="" /></p>
<p>Den Proxy Service erstellen Sie, indem Sie zuerst eine Silverlight Applikation mit aktivem WCF-Dienst erstellen. Nun f&#252;gen Sie einen WCF Service hinzu, der sp&#228;ter auf die Google Weather API zugreifen wird.</p>
<p><img src="http://www.entwicklerforum.org/wp-content/uploads/2011/10/Create_WCF_Service.png" alt="" /></p>
<p>Diesen lassen wir nun die Google Weather API ansprechen. Hierzu verwenden wir den WebClient und den StreamReader. Folglich m&#252;ssen wir den Google Weather API Link als Stream deklarieren.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Linq</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Runtime.Serialization</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.ServiceModel</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.ServiceModel.Activation</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Net</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.IO</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #0600FF; font-weight: bold;">namespace</span> WeatherApp<span style="color: #008000;">.</span><span style="color: #0000FF;">Web</span>
<span style="color: #008000;">&#123;</span>
    <span style="color: #008000;">&#91;</span>ServiceContract<span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">Namespace</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span>
    <span style="color: #008000;">&#91;</span>SilverlightFaultBehavior<span style="color: #008000;">&#93;</span>
    <span style="color: #008000;">&#91;</span>AspNetCompatibilityRequirements<span style="color: #008000;">&#40;</span>RequirementsMode <span style="color: #008000;">=</span> AspNetCompatibilityRequirementsMode<span style="color: #008000;">.</span><span style="color: #0000FF;">Allowed</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> GoogleWeatherApiService
    <span style="color: #008000;">&#123;</span>
        <span style="color: #008000;">&#91;</span>OperationContract<span style="color: #008000;">&#93;</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> GetGoogleWeatherApiString<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span> _strCity<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            WebClient client <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> WebClient<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            Stream stream <span style="color: #008000;">=</span> client<span style="color: #008000;">.</span><span style="color: #0000FF;">OpenRead</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;http://www.google.com/ig/api?weather=&quot;</span> <span style="color: #008000;">+</span> _strCity <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;&amp;amp;hl=De&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008000;">&#40;</span>StreamReader streamReader <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> StreamReader<span style="color: #008000;">&#40;</span>stream, <span style="color: #000000;">System.<span style="color: #0000FF;">Text</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">Encoding</span><span style="color: #008000;">.</span><span style="color: #0600FF; font-weight: bold;">Default</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
            <span style="color: #008000;">&#123;</span>
                <span style="color: #0600FF; font-weight: bold;">return</span> streamReader<span style="color: #008000;">.</span><span style="color: #0000FF;">ReadToEnd</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
        <span style="color: #008000;">&#125;</span>
        <span style="color: #008080; font-style: italic;">// Add more operations here and mark them with [OperationContract]</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>In dem Link der Google API befindet sich der String <em>_strCity</em>, da der User sp&#228;ter seine Stadt eingeben k&#246;nnen soll.<br />
Nun f&#252;gen Sie der Silverlight Applikation eine neue Service Referenz hinzu, in dem Sie mit der rechten Maustaste auf Referenzen klicken und dann <em>Service Referenz hinzuf&#252;gen</em> ausw&#228;hlen. Wenn Sie dies getan haben &#246;ffnet sich folgendes Fenster:</p>
<p><img src="http://www.entwicklerforum.org/wp-content/uploads/2011/10/Create_WCF_Reverece.png" alt="" /></p>
<p>&#220;ber<em> Ermitteln</em> wird Visual Studio 2010 Ihren WCF-Service automatisch erkennen.</p>
<p><span style="text-decoration: underline;"><a name="KlassenDiagramm">Klassendiagramm</a></span></p>
<p>Jetzt ist es an der Zeit sich Gedanken dar&#252;ber zu machen, wie unsere Applikation funktionieren soll. Ich empfehle hierzu ein Klassendiagramm, welches Sie in Visual Studio 2010 durch Rechtsklick auf die Klasse erstellen k&#246;nnen. Wir brauchen drei verschiedene Klassen, eine zum Auslesen der Service Referenz und zwei, denen wir die ausgelesenen Daten &#252;bermitteln lassen, damit wir sp&#228;ter Listen dieser Klassen anfertigen k&#246;nnen. In meinem Fall hei&#223;en diese Klassen &#8220;Data&#8221;, &#8220;Current&#8221; und &#8220;Forecast&#8221;.</p>
<p><img src="http://www.entwicklerforum.org/wp-content/uploads/2011/10/Class_Diagramm.png" alt="" /></p>
<p>Welche Methode f&#252;r was zust&#228;ndig ist und was es mit dem Event auf sich hat, werden wir uns sp&#228;ter anschauen. Wichtig vorab zu wissen ist nur, dass die Variablen alle private deklariert wurden und die Eigenschaften der &#8220;Current&#8221; und &#8220;Forecast&#8221; Klassen sp&#228;ter die Variablen ver&#228;ndern.</p>
<p><span style="text-decoration: underline;"><a name="Klassen">Erstellen der Klassen</a></span></p>
<p>Da wir nun wissen, was unsere Klassen beinhalten sollen erstellen wir diese. Ich habe mit der &#8220;Current&#8221; Klassen begonnen.</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: #6666cc; font-weight: bold;">class</span> Current
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">string</span> _strCity<span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">private</span> DateTime _oDate <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> DateTime<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">string</span> _strCondition<span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">int</span> _intTemp<span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">string</span> _strHumidity<span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">string</span> _strWindCondition<span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">string</span> _strImage<span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span></pre></div></div>

<p>Nun m&#252;ssen wir die Variablen Verkapseln, damit wir diese sp&#228;ter von au&#223;erhalb ver&#228;ndern lassen k&#246;nnen. Hierzu klicken sie einfach mit der rechten Maustaste auf die Variable klicken dann auf <em>Umgestalten</em> und w&#228;hlen <em>Einkapseln</em> aus.</p>
<p><img src="http://www.entwicklerforum.org/wp-content/uploads/2011/10/Encapsulate_Field.png" alt="" /></p>
<p>Wenn Sie dies getan haben wird sich ein Fenster &#246;ffnen in dem Sie den Namen der Variable angeben sollen:</p>
<p><img src="http://www.entwicklerforum.org/wp-content/uploads/2011/10/generate_Encapsulated_Field.png" alt="" /></p>
<p>Wenn Sie nun auf &#8220;OK&#8221; klicken wird die Verkapselung automatisch von Visual Studio 2010 generiert und sieht nun so aus:</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;">string</span> _strCity<span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> strCity
        <span style="color: #008000;">&#123;</span>
            get <span style="color: #008000;">&#123;</span> <span style="color: #0600FF; font-weight: bold;">return</span> _strCity<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
            set <span style="color: #008000;">&#123;</span> _strCity <span style="color: #008000;">=</span> value<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
        <span style="color: #008000;">&#125;</span></pre></div></div>

<p>Dies machen Sie f&#252;r jede Variable in der Klasse &#8220;Current&#8221;.<br />
Nun k&#246;nnen wir mit der Klasse &#8220;Forecast&#8221; beginnen. In dieser m&#252;ssen Sie ebenfalls die Variablen als privat deklarieren und diese dann Verkapseln.</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: #6666cc; font-weight: bold;">class</span> Forecast
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">string</span> _strDay<span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">int</span> _intLowTemp<span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">int</span> _intHighTemp<span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">int</span> intHighTemp<span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">string</span> _strCondition<span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> strCondition<span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">string</span> _strImage<span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> strImage<span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span></pre></div></div>

<p>Wenn Sie mit diesen beiden Klassen fertig sind und jede Variable Verkapselt haben, k&#246;nnen Sie mit der Data-Klasse beginnen. Diese wird auf die Service Referenz zugreifen und das vom Proxy-Service abgefragte in einen String einspeichern. Dieser String wird mittels XmlReader ausgelesen und die f&#252;r uns wichtigen Daten den entsprechenden Klassen &#252;bergeben und dann eine Liste der Klasse erstellt.</p>
<p>Zuerst deklarieren wir die f&#252;r uns wichtigen Variablen und Listen. Hier brauchen wir keinerlei Verkapselung, da auf diese Variablen von anderen Klassen nicht zugegriffen wird.</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: #6666cc; font-weight: bold;">class</span> Data
    <span style="color: #008000;">&#123;</span>
&nbsp;
                <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">string</span> _strCity<span style="color: #008000;">;</span>
                <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">string</span> _strDate<span style="color: #008000;">;</span>
                <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">string</span> _strCurrentCondition<span style="color: #008000;">;</span>
                <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">string</span> _strCondition<span style="color: #008000;">;</span>
                <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">string</span> _strCurrentTemp<span style="color: #008000;">;</span>
                <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">string</span> _strHumidity<span style="color: #008000;">;</span>
                <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">string</span> _strWindCondition<span style="color: #008000;">;</span>
                <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">string</span> _strDay<span style="color: #008000;">;</span>
                <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">string</span> _strLowTemp<span style="color: #008000;">;</span>
                <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">string</span> _strHighTemp<span style="color: #008000;">;</span>
                <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">string</span> _strImage<span style="color: #008000;">;</span>
                <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">string</span> _strWeatherData<span style="color: #008000;">;</span> 
&nbsp;
                <span style="color: #0600FF; font-weight: bold;">public</span> List listCurrentList <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> List<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
                <span style="color: #0600FF; font-weight: bold;">public</span> List listForecastList <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> List<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<p>Nun werden wir uns darum k&#252;mmern, dass das vom WCF-Service an die Referenz &#252;bergebene in einen String eingespeichert wird.</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: #6666cc; font-weight: bold;">void</span> LoadData<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span> _strCity<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            GoogleWeatherApiServiceClient client <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> GoogleWeatherApiServiceClient<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            client<span style="color: #008000;">.</span><span style="color: #0000FF;">GetGoogleWeatherApiStringCompleted</span> <span style="color: #008000;">+=</span> <span style="color: #008000;">new</span> EventHandler
                <span style="color: #008000;">&#40;</span>client_GetGoogleWeatherApiStringCompleted<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            client<span style="color: #008000;">.</span><span style="color: #0000FF;">GetGoogleWeatherApiStringAsync</span><span style="color: #008000;">&#40;</span>_strCity<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #6666cc; font-weight: bold;">void</span> client_GetGoogleWeatherApiStringCompleted
            <span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> sender, GetGoogleWeatherApiStringCompletedEventArgs e<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>e<span style="color: #008000;">.</span><span style="color: #0000FF;">Error</span> <span style="color: #008000;">==</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span>
            <span style="color: #008000;">&#123;</span>
                _strWeatherData <span style="color: #008000;">=</span> e<span style="color: #008000;">.</span><span style="color: #0000FF;">Result</span><span style="color: #008000;">;</span>
                GetData<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
                FireXMLReaderReady<span style="color: #008000;">&#40;</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>Zur &#8220;GetData()&#8221;-Methode, die hier ausgef&#252;hrt wird, kommen wir sp&#228;ter. Die &#8220;FireXMLReaderReady()&#8221;-Methode werden wir jetzt implementieren. Die &#8220;FireXMLReaderReader()&#8221;-Methode entsteht durch ein Event, das wir erstellen m&#252;ssen, da die Daten Asynchron geladen werden. Durch das eben genannte asynchrone Laden kann es passieren, dass die Daten noch nicht fertig geladen sind, wenn wir auf diese zugreifen wollen. Um dieses Problem zu l&#246;sen werden wir ein Event erstellen, das ausgel&#246;st wird, wenn die Daten in den String eingetragen wurden.</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;">event</span> EventHandler XMLReaderReady<span style="color: #008000;">;</span>
&nbsp;
                <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> FireXMLReaderReady<span style="color: #008000;">&#40;</span><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>XMLReaderReady <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span>
                        XMLReaderReady<span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span>, EventArgs<span style="color: #008000;">.</span><span style="color: #0000FF;">Empty</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
                <span style="color: #008000;">&#125;</span></pre></div></div>

<p>Wenn wir dieses Event erstellt haben kommen wir zum Hauptteil, indem wir die f&#252;r uns wichtigen Daten aus dem String auslesen und an die entsprechenden Klassen &#252;bergeben lassen.</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;">void</span> GetData<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            Current OCurrent <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Current<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            Forecast OForecast <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Forecast<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>            
&nbsp;
            <span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008000;">&#40;</span>XmlReader reader <span style="color: #008000;">=</span> XmlReader<span style="color: #008000;">.</span><span style="color: #0000FF;">Create</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">new</span> StringReader<span style="color: #008000;">&#40;</span>_strWeatherData<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
            <span style="color: #008000;">&#123;</span>
                <span style="color: #0600FF; font-weight: bold;">while</span> <span style="color: #008000;">&#40;</span>reader<span style="color: #008000;">.</span><span style="color: #0000FF;">Read</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><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><span style="color: #008000;">&#40;</span>reader<span style="color: #008000;">.</span><span style="color: #0000FF;">NodeType</span> <span style="color: #008000;">==</span> XmlNodeType<span style="color: #008000;">.</span><span style="color: #0000FF;">Element</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp<span style="color: #008000;">;&amp;</span>amp<span style="color: #008000;">;</span> <span style="color: #008000;">&#40;</span>reader<span style="color: #008000;">.</span><span style="color: #0000FF;">LocalName</span> <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span><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>reader<span style="color: #008000;">.</span><span style="color: #0000FF;">HasAttributes</span><span style="color: #008000;">&#41;</span>
                        <span style="color: #008000;">&#123;</span>
&nbsp;
                            <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;icon&quot;</span> <span style="color: #008000;">==</span> reader<span style="color: #008000;">.</span><span style="color: #0000FF;">LocalName</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
                            <span style="color: #008000;">&#123;</span>
                                _strImage <span style="color: #008000;">=</span> reader<span style="color: #008000;">.</span><span style="color: #0000FF;">GetAttribute</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;data&quot;</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;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;city&quot;</span> <span style="color: #008000;">==</span> reader<span style="color: #008000;">.</span><span style="color: #0000FF;">LocalName</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
                            <span style="color: #008000;">&#123;</span>
                                _strCity <span style="color: #008000;">=</span> TranslateFerderalState<span style="color: #008000;">&#40;</span> reader<span style="color: #008000;">.</span><span style="color: #0000FF;">GetAttribute</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;data&quot;</span><span style="color: #008000;">&#41;</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;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;forecast_date&quot;</span> <span style="color: #008000;">==</span> reader<span style="color: #008000;">.</span><span style="color: #0000FF;">LocalName</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
                            <span style="color: #008000;">&#123;</span>
                               _strDate <span style="color: #008000;">=</span> reader<span style="color: #008000;">.</span><span style="color: #0000FF;">GetAttribute</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;data&quot;</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;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;condition&quot;</span> <span style="color: #008000;">==</span> reader<span style="color: #008000;">.</span><span style="color: #0000FF;">LocalName</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
                            <span style="color: #008000;">&#123;</span>
                               _strCurrentCondition <span style="color: #008000;">=</span> reader<span style="color: #008000;">.</span><span style="color: #0000FF;">GetAttribute</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;data&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
                               _strCondition <span style="color: #008000;">=</span> reader<span style="color: #008000;">.</span><span style="color: #0000FF;">GetAttribute</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;data&quot;</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;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;temp_c&quot;</span> <span style="color: #008000;">==</span> reader<span style="color: #008000;">.</span><span style="color: #0000FF;">LocalName</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
                            <span style="color: #008000;">&#123;</span>
                                _strCurrentTemp <span style="color: #008000;">=</span> reader<span style="color: #008000;">.</span><span style="color: #0000FF;">GetAttribute</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;data&quot;</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;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;humidity&quot;</span> <span style="color: #008000;">==</span> reader<span style="color: #008000;">.</span><span style="color: #0000FF;">LocalName</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
                            <span style="color: #008000;">&#123;</span>
                                _strHumidity <span style="color: #008000;">=</span> reader<span style="color: #008000;">.</span><span style="color: #0000FF;">GetAttribute</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;data&quot;</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;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;wind_condition&quot;</span> <span style="color: #008000;">==</span> reader<span style="color: #008000;">.</span><span style="color: #0000FF;">LocalName</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
                            <span style="color: #008000;">&#123;</span>
                                _strWindCondition <span style="color: #008000;">=</span> reader<span style="color: #008000;">.</span><span style="color: #0000FF;">GetAttribute</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;data&quot;</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;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;day_of_week&quot;</span> <span style="color: #008000;">==</span> reader<span style="color: #008000;">.</span><span style="color: #0000FF;">LocalName</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
                            <span style="color: #008000;">&#123;</span>
                                _strDay <span style="color: #008000;">=</span> reader<span style="color: #008000;">.</span><span style="color: #0000FF;">GetAttribute</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;data&quot;</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;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;low&quot;</span> <span style="color: #008000;">==</span> reader<span style="color: #008000;">.</span><span style="color: #0000FF;">LocalName</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
                            <span style="color: #008000;">&#123;</span>
                                _strLowTemp <span style="color: #008000;">=</span> reader<span style="color: #008000;">.</span><span style="color: #0000FF;">GetAttribute</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;data&quot;</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;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;high&quot;</span> <span style="color: #008000;">==</span> reader<span style="color: #008000;">.</span><span style="color: #0000FF;">LocalName</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
                            <span style="color: #008000;">&#123;</span>
                                _strHighTemp <span style="color: #008000;">=</span> reader<span style="color: #008000;">.</span><span style="color: #0000FF;">GetAttribute</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;data&quot;</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;">if</span><span style="color: #008000;">&#40;</span>_strCity <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span> <span style="color: #008000;">&amp;</span>amp<span style="color: #008000;">;&amp;</span>amp<span style="color: #008000;">;</span> _strCity<span style="color: #008000;">!=</span> <span style="color: #666666;">&quot;&quot;</span> <span style="color: #008000;">&amp;</span>amp<span style="color: #008000;">;&amp;</span>amp<span style="color: #008000;">;</span> _strDate <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span> <span style="color: #008000;">&amp;</span>amp<span style="color: #008000;">;&amp;</span>amp<span style="color: #008000;">;</span> _strDate <span style="color: #008000;">!=</span> <span style="color: #666666;">&quot;&quot;</span> <span style="color: #008000;">&amp;</span>amp<span style="color: #008000;">;&amp;</span>amp<span style="color: #008000;">;</span>
                                _strCurrentCondition <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span> <span style="color: #008000;">&amp;</span>amp<span style="color: #008000;">;&amp;</span>amp<span style="color: #008000;">;</span> _strCurrentCondition <span style="color: #008000;">!=</span> <span style="color: #666666;">&quot;&quot;</span> <span style="color: #008000;">&amp;</span>amp<span style="color: #008000;">;&amp;</span>amp<span style="color: #008000;">;</span>
                                _strCurrentTemp <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span> <span style="color: #008000;">&amp;</span>amp<span style="color: #008000;">;&amp;</span>amp<span style="color: #008000;">;</span> _strCurrentTemp <span style="color: #008000;">!=</span> <span style="color: #666666;">&quot;&quot;</span> <span style="color: #008000;">&amp;</span>amp<span style="color: #008000;">;&amp;</span>amp<span style="color: #008000;">;</span> _strHumidity <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span> <span style="color: #008000;">&amp;</span>amp<span style="color: #008000;">;&amp;</span>amp<span style="color: #008000;">;</span>
                                _strHumidity <span style="color: #008000;">!=</span> <span style="color: #666666;">&quot;&quot;</span> <span style="color: #008000;">&amp;</span>amp<span style="color: #008000;">;&amp;</span>amp<span style="color: #008000;">;</span> _strWindCondition <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span> <span style="color: #008000;">&amp;</span>amp<span style="color: #008000;">;&amp;</span>amp<span style="color: #008000;">;</span> _strWindCondition <span style="color: #008000;">!=</span> <span style="color: #666666;">&quot;&quot;</span> <span style="color: #008000;">&amp;</span>amp<span style="color: #008000;">;&amp;</span>amp<span style="color: #008000;">;</span>
                                _strImage <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span> <span style="color: #008000;">&amp;</span>amp<span style="color: #008000;">;&amp;</span>amp<span style="color: #008000;">;</span> _strImage <span style="color: #008000;">!=</span> <span style="color: #666666;">&quot;&quot;</span><span style="color: #008000;">&#41;</span>
                            <span style="color: #008000;">&#123;</span>
                                OCurrent<span style="color: #008000;">.</span><span style="color: #0000FF;">strCity</span> <span style="color: #008000;">=</span> _strCity<span style="color: #008000;">;</span>
                                _strDate <span style="color: #008000;">=</span> ConvertStringToDate<span style="color: #008000;">&#40;</span>_strDate<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
                                OCurrent<span style="color: #008000;">.</span><span style="color: #0000FF;">ODate</span> <span style="color: #008000;">=</span> DateTime<span style="color: #008000;">.</span><span style="color: #0000FF;">Parse</span><span style="color: #008000;">&#40;</span>_strDate<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
                                OCurrent<span style="color: #008000;">.</span><span style="color: #0000FF;">strCondition</span> <span style="color: #008000;">=</span> _strCurrentCondition<span style="color: #008000;">;</span>
                                OCurrent<span style="color: #008000;">.</span><span style="color: #0000FF;">intTemp</span> <span style="color: #008000;">=</span> Convert<span style="color: #008000;">.</span><span style="color: #0000FF;">ToInt32</span><span style="color: #008000;">&#40;</span>_strCurrentTemp<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
                                OCurrent<span style="color: #008000;">.</span><span style="color: #0000FF;">strHumidity</span> <span style="color: #008000;">=</span> _strHumidity<span style="color: #008000;">;</span>
                                OCurrent<span style="color: #008000;">.</span><span style="color: #0000FF;">strWindCondition</span> <span style="color: #008000;">=</span> _strWindCondition<span style="color: #008000;">;</span>
                                _strImage <span style="color: #008000;">=</span> ConvertToShortPath<span style="color: #008000;">&#40;</span>_strImage<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
                                OCurrent<span style="color: #008000;">.</span><span style="color: #0000FF;">strImage</span> <span style="color: #008000;">=</span> _strImage<span style="color: #008000;">;</span>                               
&nbsp;
                                listCurrentList<span style="color: #008000;">.</span><span style="color: #0000FF;">Add</span><span style="color: #008000;">&#40;</span>OCurrent<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
                                OCurrent <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Current<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
                                _strHumidity <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;&quot;</span><span style="color: #008000;">;</span>
                                <span style="color: #008080; font-style: italic;">//_strCity = &quot;&quot;;</span>
                                _strDate <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;&quot;</span><span style="color: #008000;">;</span>
                                _strCurrentCondition <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;&quot;</span><span style="color: #008000;">;</span>
                                _strCondition <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;&quot;</span><span style="color: #008000;">;</span>
                                _strCurrentTemp <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;&quot;</span><span style="color: #008000;">;</span>
                                _strWindCondition <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;&quot;</span><span style="color: #008000;">;</span>
                            <span style="color: #008000;">&#125;</span>
&nbsp;
                            <span style="color: #0600FF; font-weight: bold;">if</span><span style="color: #008000;">&#40;</span>_strCondition <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span> <span style="color: #008000;">&amp;</span>amp<span style="color: #008000;">;&amp;</span>amp<span style="color: #008000;">;</span> _strCondition <span style="color: #008000;">!=</span> <span style="color: #666666;">&quot;&quot;</span> <span style="color: #008000;">&amp;</span>amp<span style="color: #008000;">;&amp;</span>amp<span style="color: #008000;">;</span> _strLowTemp <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span> <span style="color: #008000;">&amp;</span>amp<span style="color: #008000;">;&amp;</span>amp<span style="color: #008000;">;</span>
                                _strLowTemp <span style="color: #008000;">!=</span> <span style="color: #666666;">&quot;&quot;</span> <span style="color: #008000;">&amp;</span>amp<span style="color: #008000;">;&amp;</span>amp<span style="color: #008000;">;</span> _strHighTemp <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span> <span style="color: #008000;">&amp;</span>amp<span style="color: #008000;">;&amp;</span>amp<span style="color: #008000;">;</span> _strHighTemp <span style="color: #008000;">!=</span> <span style="color: #666666;">&quot;&quot;</span> <span style="color: #008000;">&amp;</span>amp<span style="color: #008000;">;&amp;</span>amp<span style="color: #008000;">;</span>
                                _strDay <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span> <span style="color: #008000;">&amp;</span>amp<span style="color: #008000;">;&amp;</span>amp<span style="color: #008000;">;</span> _strDay <span style="color: #008000;">!=</span> <span style="color: #666666;">&quot;&quot;</span> <span style="color: #008000;">&amp;</span>amp<span style="color: #008000;">;&amp;</span>amp<span style="color: #008000;">;</span> _strImage <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span> <span style="color: #008000;">&amp;</span>amp<span style="color: #008000;">;&amp;</span>amp<span style="color: #008000;">;</span> _strImage <span style="color: #008000;">!=</span> <span style="color: #666666;">&quot;&quot;</span><span style="color: #008000;">&#41;</span>
                            <span style="color: #008000;">&#123;</span>
                                OForecast<span style="color: #008000;">.</span><span style="color: #0000FF;">intHighTemp</span> <span style="color: #008000;">=</span> Convert<span style="color: #008000;">.</span><span style="color: #0000FF;">ToInt32</span><span style="color: #008000;">&#40;</span>_strHighTemp<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
                                OForecast<span style="color: #008000;">.</span><span style="color: #0000FF;">intLowTemp</span> <span style="color: #008000;">=</span> Convert<span style="color: #008000;">.</span><span style="color: #0000FF;">ToInt32</span><span style="color: #008000;">&#40;</span>_strLowTemp<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
                                OForecast<span style="color: #008000;">.</span><span style="color: #0000FF;">strCondition</span> <span style="color: #008000;">=</span> _strCondition<span style="color: #008000;">;</span>
                                OForecast<span style="color: #008000;">.</span><span style="color: #0000FF;">strDay</span> <span style="color: #008000;">=</span> _strDay<span style="color: #008000;">;</span>
                                _strImage <span style="color: #008000;">=</span> ConvertToShortPath<span style="color: #008000;">&#40;</span>_strImage<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
                                OForecast<span style="color: #008000;">.</span><span style="color: #0000FF;">strImage</span> <span style="color: #008000;">=</span> _strImage<span style="color: #008000;">;</span>
&nbsp;
                                listForecastList<span style="color: #008000;">.</span><span style="color: #0000FF;">Add</span><span style="color: #008000;">&#40;</span>OForecast<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
                                OForecast <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Forecast<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
                                _strDay <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;&quot;</span><span style="color: #008000;">;</span>
                                _strHighTemp <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;&quot;</span><span style="color: #008000;">;</span>
                                _strLowTemp <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;&quot;</span><span style="color: #008000;">;</span>
                                _strCondition <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;&quot;</span><span style="color: #008000;">;</span>
                                _strImage <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;&quot;</span><span style="color: #008000;">;</span>
                            <span style="color: #008000;">&#125;</span>
                        <span style="color: #008000;">&#125;</span>
                    <span style="color: #008000;">&#125;</span>
                <span style="color: #008000;">&#125;</span>
            <span style="color: #008000;">&#125;</span>
        <span style="color: #008000;">&#125;</span></pre></div></div>

<p>Hier sehen sie mehrere Pr&#252;fungen. Wir lassen pr&#252;fen, ob das was wir ben&#246;tigen, z.B. &#8220;City&#8221;, vorhanden ist. Ist dies der Fall wird es in unsere lokale Variable eingetragen. Wenn diese Pr&#252;fungen alle durchlaufen wurden wird noch gepr&#252;ft ob alle Daten vorhanden sind, welche die Klassen &#8220;Current&#8221; und &#8220;Forecast&#8221; ben&#246;tigen. Trifft dies zu werden die Daten an die Verkapselten Variablen &#252;bergeben und direkt danach wird die entsprechende Klasse in ihre Liste eingetragen. Da nicht alle Daten so Formatiert sind, dass sie f&#252;r uns sofort brauchbar sind, brauchen wir noch drei Methoden die uns helfen die Daten in das richtige Format umzuwandeln.<br />
Als erstes brauchen wir die Methode &#8220;ConvertStringToDate()&#8221;, welche uns das &#252;bergebene Datum, z.B. 2011-10-24 in ein f&#252;r uns brauchbares Format bringt z.B. 24.10.2011.</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: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">string</span> ConvertStringToDate<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span> _strDate<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
&nbsp;
            <span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> arrDateSplitted <span style="color: #008000;">=</span> _strDate<span style="color: #008000;">.</span><span style="color: #0000FF;">Split</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">'-'</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            _strDate <span style="color: #008000;">=</span> arrDateSplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">2</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;.&quot;</span> <span style="color: #008000;">+</span> arrDateSplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;.&quot;</span> <span style="color: #008000;">+</span> arrDateSplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">;</span>
            <span style="color: #0600FF; font-weight: bold;">return</span> _strDate<span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span></pre></div></div>

<p>Desweiteren brauchen wir die Methode &#8220;ConvertToShortPath()&#8221;, die uns den von der Google API gegebenen Link f&#252;r das Bild k&#252;rzt. Dies ist notwendig um sp&#228;ter schneller auf die Bilder zugreifen zu k&#246;nnen.</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: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">string</span> ConvertToShortPath<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span> _strImage<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> arrPathSplitted <span style="color: #008000;">=</span> _strImage<span style="color: #008000;">.</span><span style="color: #0000FF;">Split</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">'/'</span>, <span style="color: #666666;">'.'</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            _strImage <span style="color: #008000;">=</span> arrPathSplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">4</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">;</span>
            <span style="color: #0600FF; font-weight: bold;">return</span> _strImage<span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span></pre></div></div>

<p>Falls Sie wollen, das die Ausgabe der St&#228;dte und Bundesl&#228;nder in deutsch erfolgt, brauchen Sie noch die Methode &#8220;TranslateFerderalState()&#8221;.</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: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">string</span> TranslateFerderalState<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span> _strCity<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> arrCitySplitted <span style="color: #008000;">=</span> _strCity<span style="color: #008000;">.</span><span style="color: #0000FF;">Split</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">','</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>       
&nbsp;
            <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>arrCitySplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">==</span> <span style="color: #666666;">&quot;Munich&quot;</span><span style="color: #008000;">&#41;</span>
            <span style="color: #008000;">&#123;</span>
                arrCitySplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;München&quot;</span><span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
            <span style="color: #0600FF; font-weight: bold;">else</span> <span style="color: #0600FF; font-weight: bold;">if</span><span style="color: #008000;">&#40;</span>arrCitySplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">==</span> <span style="color: #666666;">&quot;Cologne&quot;</span><span style="color: #008000;">&#41;</span>
            <span style="color: #008000;">&#123;</span>
                arrCitySplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Köln&quot;</span><span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
            <span style="color: #0600FF; font-weight: bold;">else</span> <span style="color: #0600FF; font-weight: bold;">if</span><span style="color: #008000;">&#40;</span>arrCitySplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">==</span> <span style="color: #666666;">&quot;Hanover&quot;</span><span style="color: #008000;">&#41;</span>
            <span style="color: #008000;">&#123;</span>
                arrCitySplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Hannover&quot;</span><span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
&nbsp;
            <span style="color: #0600FF; font-weight: bold;">else</span> <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>arrCitySplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">==</span> <span style="color: #666666;">&quot;Nuremberg&quot;</span><span style="color: #008000;">&#41;</span>
            <span style="color: #008000;">&#123;</span>
                arrCitySplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Nürnberg&quot;</span><span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
&nbsp;
            <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>arrCitySplitted<span style="color: #008000;">.</span><span style="color: #0000FF;">Length</span> <span style="color: #008000;">==</span> <span style="color: #FF0000;">2</span><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>arrCitySplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">==</span> <span style="color: #666666;">&quot; Thuringia&quot;</span><span style="color: #008000;">&#41;</span>
                <span style="color: #008000;">&#123;</span>
                    arrCitySplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot; Thüringen&quot;</span><span style="color: #008000;">;</span>
                <span style="color: #008000;">&#125;</span>
&nbsp;
                <span style="color: #0600FF; font-weight: bold;">else</span> <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>arrCitySplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">==</span> <span style="color: #666666;">&quot; Saxony&quot;</span><span style="color: #008000;">&#41;</span>
                <span style="color: #008000;">&#123;</span>
                    arrCitySplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot; Sachsen&quot;</span><span style="color: #008000;">;</span>
                <span style="color: #008000;">&#125;</span>
&nbsp;
                <span style="color: #0600FF; font-weight: bold;">else</span> <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>arrCitySplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">==</span> <span style="color: #666666;">&quot; Rhineland-Palatinate&quot;</span><span style="color: #008000;">&#41;</span>
                <span style="color: #008000;">&#123;</span>
                    arrCitySplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot; Rheinland Pfalz&quot;</span><span style="color: #008000;">;</span>
                <span style="color: #008000;">&#125;</span>
&nbsp;
                <span style="color: #0600FF; font-weight: bold;">else</span> <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>arrCitySplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">==</span> <span style="color: #666666;">&quot; Saxony-Anhalt&quot;</span><span style="color: #008000;">&#41;</span>
                <span style="color: #008000;">&#123;</span>
                    arrCitySplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot; Sachsen Anhalt&quot;</span><span style="color: #008000;">;</span>
                <span style="color: #008000;">&#125;</span>
&nbsp;
                <span style="color: #0600FF; font-weight: bold;">else</span> <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>arrCitySplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">==</span> <span style="color: #666666;">&quot; Hesse&quot;</span><span style="color: #008000;">&#41;</span>
                <span style="color: #008000;">&#123;</span>
                    arrCitySplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot; Hessen&quot;</span><span style="color: #008000;">;</span>
                <span style="color: #008000;">&#125;</span>
&nbsp;
                <span style="color: #0600FF; font-weight: bold;">else</span> <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>arrCitySplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">==</span> <span style="color: #666666;">&quot; Mecklenburg-West Pommerania&quot;</span><span style="color: #008000;">&#41;</span>
                <span style="color: #008000;">&#123;</span>
                    arrCitySplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot; Mecklenburg Vorpommern&quot;</span><span style="color: #008000;">;</span>
                <span style="color: #008000;">&#125;</span>
&nbsp;
                <span style="color: #0600FF; font-weight: bold;">else</span> <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>arrCitySplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">==</span> <span style="color: #666666;">&quot; North Rhine-Westphalia&quot;</span><span style="color: #008000;">&#41;</span>
                <span style="color: #008000;">&#123;</span>
                    arrCitySplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot; Nordrhein-Westfalen&quot;</span><span style="color: #008000;">;</span>
                <span style="color: #008000;">&#125;</span>
&nbsp;
                <span style="color: #0600FF; font-weight: bold;">else</span> <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>arrCitySplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">==</span> <span style="color: #666666;">&quot; Lower Saxony&quot;</span><span style="color: #008000;">&#41;</span>
                <span style="color: #008000;">&#123;</span>
                    arrCitySplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot; Niedersachsen&quot;</span><span style="color: #008000;">;</span>
                <span style="color: #008000;">&#125;</span>
&nbsp;
                <span style="color: #0600FF; font-weight: bold;">else</span> <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>arrCitySplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">==</span> <span style="color: #666666;">&quot; Bavaria&quot;</span><span style="color: #008000;">&#41;</span>
                <span style="color: #008000;">&#123;</span>
                    arrCitySplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot; Bayern&quot;</span><span style="color: #008000;">;</span>
                <span style="color: #008000;">&#125;</span>
                <span style="color: #0600FF; font-weight: bold;">else</span>
                <span style="color: #008000;">&#123;</span>
                    arrCitySplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">=</span> arrCitySplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">;</span>
                <span style="color: #008000;">&#125;</span>
                _strCity <span style="color: #008000;">=</span> arrCitySplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;,&quot;</span> <span style="color: #008000;">+</span> arrCitySplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
&nbsp;
            <span style="color: #0600FF; font-weight: bold;">return</span> _strCity<span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span></pre></div></div>

<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><a name="GUI">Erstellen der GUI</a></span></p>
<p>Nach der Implementierung der Logik m&#252;ssen wir noch die GUI (Grafische Benutzeroberfl&#228;che) entwerfen und daf&#252;r sorgen, dass die Daten auch korrekt &#252;bergeben und angezeigt werden.</p>
<p>Entwerfen wir zuerst die GUI:</p>
<p><img src="http://www.entwicklerforum.org/wp-content/uploads/2011/10/GUI_entwurrf.png" alt="" /></p>
<p>Meinen XAML-Code finden Sie in meiner Projektmappe.</p>
<p>Lassen Sie Ihrer Fantasie freien lauf und gestalten Sie die Oberfl&#228;che so wie Sie es m&#246;chten.</p>
<p>Als Bilder benutze ich die standard Google Weather-Bilder. Um dies ebenfalls zu tun laden sie diese einfach runter und wandeln Sie diese von &#8220;.gif&#8221; zu &#8220;.png&#8221; um, da Silverlight &#8220;.gif&#8221; nicht verwenden kann. Bei mir liegen diese Bilder dann in der Projektmappe in einem separaten Ordner Namens &#8220;GoogleWeatherImages&#8221;.</p>
<p><strong><span style="color: red; text-decoration: underline;">Achtung:</span></strong> sollten Sie sich entschlie&#223;en Ihre GUI anders zu gestalten m&#252;ssen Sie darauf achten, dass die &#220;bergabe der Daten auf die GUI anders aussehen wird als bei meinem Beispiel.</p>
<p>Bevor wir mit der &#220;bergabe der Daten an die GUI beginnen m&#252;ssen wir erst einmal daf&#252;r sorgen, dass unser Projekt beim Start die &#8220;LoadData()&#8221;-Methode der Klasse Data ausf&#252;hrt. Daraufhin soll dann das Event &#8220;FireXMLReaderReady()&#8221; gefeuert werden.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">        Data OData <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Data<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        List listCurrentList <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> List<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        List listForecastList <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> List<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>              
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">public</span> Weather<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            OData<span style="color: #008000;">.</span><span style="color: #0000FF;">LoadData</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Berlin&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            InitializeComponent<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            OData<span style="color: #008000;">.</span><span style="color: #0000FF;">XMLReaderReady</span> <span style="color: #008000;">+=</span> <span style="color: #008000;">new</span> EventHandler<span style="color: #008000;">&#40;</span>OData_XMLReaderReady<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;">string</span> _strImagePath <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;/WeatherApp;component/GoogleWeatherImages/&quot;</span><span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">string</span> _strDate<span style="color: #008000;">;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"> <span style="color: #6666cc; font-weight: bold;">void</span> OData_XMLReaderReady<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> sender, EventArgs e<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">try</span>
            <span style="color: #008000;">&#123;</span>
                listCurrentList <span style="color: #008000;">=</span> OData<span style="color: #008000;">.</span><span style="color: #0000FF;">listCurrentList</span><span style="color: #008000;">;</span>
                listForecastList <span style="color: #008000;">=</span> OData<span style="color: #008000;">.</span><span style="color: #0000FF;">listForecastList</span><span style="color: #008000;">;</span>
                BuildApp<span style="color: #008000;">&#40;</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;">catch</span> <span style="color: #008000;">&#40;</span>Exception<span style="color: #008000;">&#41;</span>
            <span style="color: #008000;">&#123;</span>
                MessageBox<span style="color: #008000;">.</span><span style="color: #0000FF;">Show</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Bitte eine korrekte Stadt eingeben.&quot;</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>


<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;">void</span> BuildApp<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            _strDate <span style="color: #008000;">=</span> listCurrentList<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ODate</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ToShortDateString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            _strDate <span style="color: #008000;">=</span> FormateDateString<span style="color: #008000;">&#40;</span>_strDate<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            _lblCityLable<span style="color: #008000;">.</span><span style="color: #0000FF;">Content</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Wetter in &quot;</span> <span style="color: #008000;">+</span> listCurrentList<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">strCity</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;:&quot;</span><span style="color: #008000;">;</span>
            _lblConditionLabel<span style="color: #008000;">.</span><span style="color: #0000FF;">Content</span> <span style="color: #008000;">=</span> listCurrentList<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">strCondition</span><span style="color: #008000;">;</span>
            _lblMinMaxLabel<span style="color: #008000;">.</span><span style="color: #0000FF;">Content</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Min&quot;</span> <span style="color: #008000;">+</span> listForecastList<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">intLowTemp</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;°C&quot;</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;|&quot;</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;Max&quot;</span> <span style="color: #008000;">+</span> listForecastList<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">intHighTemp</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;°C&quot;</span><span style="color: #008000;">;</span>
            _lblHumidityLabel<span style="color: #008000;">.</span><span style="color: #0000FF;">Content</span> <span style="color: #008000;">=</span> listCurrentList<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">strHumidity</span><span style="color: #008000;">;</span>
            _lblWindConditionLabel<span style="color: #008000;">.</span><span style="color: #0000FF;">Content</span> <span style="color: #008000;">=</span> listCurrentList<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">strWindCondition</span><span style="color: #008000;">;</span>
            _lblCurrentTempLabel<span style="color: #008000;">.</span><span style="color: #0000FF;">Content</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Aktuell: &quot;</span> <span style="color: #008000;">+</span> listCurrentList<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">intTemp</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;°C&quot;</span><span style="color: #008000;">;</span>
            _lblTodayLable<span style="color: #008000;">.</span><span style="color: #0000FF;">Content</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Heute, der &quot;</span> <span style="color: #008000;">+</span> _strDate <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;(&quot;</span> <span style="color: #008000;">+</span> listForecastList<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">strDay</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;)&quot;</span><span style="color: #008000;">;</span>
            _imgTodayImage<span style="color: #008000;">.</span><span style="color: #0000FF;">Source</span> <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> BitmapImage<span style="color: #008000;">&#40;</span><span style="color: #008000;">new</span> Uri<span style="color: #008000;">&#40;</span>_strImagePath <span style="color: #008000;">+</span> listCurrentList<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">strImage</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;.png&quot;</span>, UriKind<span style="color: #008000;">.</span><span style="color: #0000FF;">RelativeOrAbsolute</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            _lblDay1Label<span style="color: #008000;">.</span><span style="color: #0000FF;">Content</span> <span style="color: #008000;">=</span> listForecastList<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">strDay</span><span style="color: #008000;">;</span>
            _lblDay1MinMaxLabel<span style="color: #008000;">.</span><span style="color: #0000FF;">Content</span> <span style="color: #008000;">=</span> listForecastList<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">intLowTemp</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;°|&quot;</span> <span style="color: #008000;">+</span> listForecastList<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">intHighTemp</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;°&quot;</span><span style="color: #008000;">;</span>
            _imgDay1Image<span style="color: #008000;">.</span><span style="color: #0000FF;">Source</span> <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> BitmapImage<span style="color: #008000;">&#40;</span><span style="color: #008000;">new</span> Uri<span style="color: #008000;">&#40;</span>_strImagePath <span style="color: #008000;">+</span> listForecastList<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">strImage</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;.png&quot;</span>, UriKind<span style="color: #008000;">.</span><span style="color: #0000FF;">RelativeOrAbsolute</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            _lblDay2Label<span style="color: #008000;">.</span><span style="color: #0000FF;">Content</span> <span style="color: #008000;">=</span> listForecastList<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">2</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">strDay</span><span style="color: #008000;">;</span>
            _lblDay2MinMaxLabel<span style="color: #008000;">.</span><span style="color: #0000FF;">Content</span> <span style="color: #008000;">=</span> listForecastList<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">2</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">intLowTemp</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;°|&quot;</span> <span style="color: #008000;">+</span> listForecastList<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">2</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">intHighTemp</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;°&quot;</span><span style="color: #008000;">;</span>
            _imgDay2Image<span style="color: #008000;">.</span><span style="color: #0000FF;">Source</span> <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> BitmapImage<span style="color: #008000;">&#40;</span><span style="color: #008000;">new</span> Uri<span style="color: #008000;">&#40;</span>_strImagePath <span style="color: #008000;">+</span> listForecastList<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">2</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">strImage</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;.png&quot;</span>, UriKind<span style="color: #008000;">.</span><span style="color: #0000FF;">RelativeOrAbsolute</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            _lblDay3Label<span style="color: #008000;">.</span><span style="color: #0000FF;">Content</span> <span style="color: #008000;">=</span> listForecastList<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">3</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">strDay</span><span style="color: #008000;">;</span>
            _lblDay3MinMaxLabel<span style="color: #008000;">.</span><span style="color: #0000FF;">Content</span> <span style="color: #008000;">=</span> listForecastList<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">3</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">intLowTemp</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;°|&quot;</span> <span style="color: #008000;">+</span> listForecastList<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">3</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">intHighTemp</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;°&quot;</span><span style="color: #008000;">;</span>
            _imgDay3Image<span style="color: #008000;">.</span><span style="color: #0000FF;">Source</span> <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> BitmapImage<span style="color: #008000;">&#40;</span><span style="color: #008000;">new</span> Uri<span style="color: #008000;">&#40;</span>_strImagePath <span style="color: #008000;">+</span> listForecastList<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">3</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">strImage</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;.png&quot;</span>, UriKind<span style="color: #008000;">.</span><span style="color: #0000FF;">RelativeOrAbsolute</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span></pre></div></div>

<p>Auch hier ben&#246;tigen wir wieder eine Hilfsmethode, die das Datum k&#252;rzt.</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;">string</span> FormateDateString<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span> _strDate<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> arrDateSplitted <span style="color: #008000;">=</span> _strDate<span style="color: #008000;">.</span><span style="color: #0000FF;">Split</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">'.'</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            _strDate <span style="color: #008000;">=</span> arrDateSplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;.&quot;</span> <span style="color: #008000;">+</span> arrDateSplitted<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #0600FF; font-weight: bold;">return</span> _strDate<span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span></pre></div></div>

<p>Wenn Sie nun Ihre Applikation Debuggen ermittelt diese nur f&#252;r die Stadt das Wetter, die sie beim Start der Applikation mit der &#8220;LoadData()&#8221;-Methode &#252;bergeben haben. Um dem Benutzer die M&#246;glichkeit zu bieten das Wetter einer eingegebenen Stadt zu sehen, m&#252;ssen wir das Button Click Event implementieren.</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;">void</span> _btnCalculateWeather_Click<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> sender, RoutedEventArgs e<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #6666cc; font-weight: bold;">string</span> _strCity <span style="color: #008000;">=</span> _txtCity<span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span><span style="color: #008000;">;</span>           
&nbsp;
            listCurrentList<span style="color: #008000;">.</span><span style="color: #0000FF;">Clear</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            listForecastList<span style="color: #008000;">.</span><span style="color: #0000FF;">Clear</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            _txtCity<span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;&quot;</span><span style="color: #008000;">;</span>            
&nbsp;
            OData<span style="color: #008000;">.</span><span style="color: #0000FF;">LoadData</span><span style="color: #008000;">&#40;</span>_strCity<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span></pre></div></div>

<p>Nun ist die Applikation fertig und sieht wie folgt aus:</p>
<p><img src="http://www.entwicklerforum.org/wp-content/uploads/2011/10/Fertige_App_Berlin.png" alt="" /></p>
<p>&nbsp;</p>
<p>Meine Projektmappe k&#246;nnen Sie <a href="http://www.entwicklerforum.org/wp-content/uploads/2011/10/WeatherApp.zip">hier</a> herunterladen.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entwicklerforum.org/wetter-app-mit-silverlight-erstellen-uber-google-weather-api-6/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Formatierungstrick in FileMaker</title>
		<link>http://www.entwicklerforum.org/formatierungstrick-in-filemaker</link>
		<comments>http://www.entwicklerforum.org/formatierungstrick-in-filemaker#comments</comments>
		<pubDate>Sun, 23 Oct 2011 17:15:22 +0000</pubDate>
		<dc:creator>Martin Schmid</dc:creator>
				<category><![CDATA[FileMaker]]></category>

		<guid isPermaLink="false">http://www.entwicklerforum.org/?p=1689</guid>
		<description><![CDATA[FileMaker vergr&#246;ssert immer automatisch die Objektgr&#246;sse im Layout auf Basis der Schriftgr&#246;sse und des Objektnamens bzw. Tabellen/Feldnamens. Dies kann zu ungew&#252;nschten Nebeneffekten f&#252;hren, wenn man z.B. ein Label mit einem Klick versieht, weil die Auswahl viel gr&#246;&#223;er als die Zeile ist. Man das recht einfach l&#246;sen, in dem man nur den ersten Tag &#8220;&#60;&#8221; in [...]]]></description>
			<content:encoded><![CDATA[<p>FileMaker vergr&#246;ssert immer automatisch die Objektgr&#246;sse im Layout auf Basis der Schriftgr&#246;sse und des Objektnamens bzw. Tabellen/Feldnamens.</p>
<p><a href="http://www.entwicklerforum.org/wp-content/uploads/2011/10/lange_feldnamen.png"><img class="alignnone size-full wp-image-1691" title="lange_feldnamen" src="http://www.entwicklerforum.org/wp-content/uploads/2011/10/lange_feldnamen.png" alt="" width="551" height="102" /></a></p>
<p>Dies kann zu ungew&#252;nschten Nebeneffekten f&#252;hren, wenn man z.B. ein Label mit einem Klick versieht, weil die Auswahl viel gr&#246;&#223;er als die Zeile ist.</p>
<p><a href="http://www.entwicklerforum.org/wp-content/uploads/2011/10/auswahl.png"><img class="alignnone size-full wp-image-1692" title="auswahl" src="http://www.entwicklerforum.org/wp-content/uploads/2011/10/auswahl.png" alt="" width="470" height="123" /></a></p>
<p>Man das recht einfach l&#246;sen, in dem man nur den ersten Tag &#8220;&lt;&#8221; in der richtigen Schriftgr&#246;sse und Formatierung bel&#228;sst. Die restlichen Zeichen k&#246;nnen in einer kleineren Schriftgr&#246;sse eingestellt werden. Dies kann bis zu Gr&#246;sse &#8220;1&#8243; minimiert werden.</p>
<p><a href="http://www.entwicklerforum.org/wp-content/uploads/2011/10/fontsize.png"><img class="alignnone size-full wp-image-1693" title="fontsize" src="http://www.entwicklerforum.org/wp-content/uploads/2011/10/fontsize.png" alt="" width="730" height="164" /></a></p>
<p>Danach kann man das Feld auf die gew&#252;nschte Gr&#246;sse formatieren und die Auswahl stimmt dann w&#228;hrend der Laufzeit.</p>
<p><img class="alignnone size-full wp-image-1694" style="border: 0px initial initial;" title="selection" src="http://www.entwicklerforum.org/wp-content/uploads/2011/10/selection.png" alt="" width="279" height="85" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.entwicklerforum.org/formatierungstrick-in-filemaker/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automatische Systempflege bei Mac OS X</title>
		<link>http://www.entwicklerforum.org/automatische-systempflege</link>
		<comments>http://www.entwicklerforum.org/automatische-systempflege#comments</comments>
		<pubDate>Fri, 21 Oct 2011 10:01:50 +0000</pubDate>
		<dc:creator>m.rastetter</dc:creator>
				<category><![CDATA[OS - Betriebssysteme]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://www.entwicklerforum.org/?p=1591</guid>
		<description><![CDATA[Mit der Einf&#252;hrung von Mac OS 10.4 (Tiger) wurde der Automatismus, welcher die systemtechnischen Wartungsma&#223;nahmen regelm&#228;&#223;ig ausf&#252;hrt von crontab auf launchd umgestellt. Dies bedeutet nicht, da&#223; man mit der crontab auf Mac OS X nicht mehr arbeiten k&#246;nnte, sie funktioniert nach wie vor. Doch dieses Verfahren ist eben alt und wird von Apple selbst nicht [...]]]></description>
			<content:encoded><![CDATA[<p>Mit der Einf&#252;hrung von <a href="http://en.wikipedia.org/wiki/Mac_OS_X_v10.4">Mac OS 10.4 (Tiger)</a> wurde der Automatismus, welcher die systemtechnischen Wartungsma&#223;nahmen regelm&#228;&#223;ig ausf&#252;hrt von <em>crontab</em> auf <em>launchd</em> umgestellt. Dies bedeutet nicht, da&#223; man mit der crontab auf Mac OS X nicht mehr arbeiten k&#246;nnte, sie funktioniert nach wie vor. Doch dieses Verfahren ist eben alt und wird von Apple selbst nicht mehr angewandt (s. Artikel <a href="http://support.apple.com/kb/HT2319">background maintenance tasks</a>).</p>
<p>Der <em>launchd</em> Mechanismus ist ein ziemlich schlaues Verfahren zur Verwaltung von Systemdiensten und Hintergrundprozessen. Einer meiner folgenden Artikel wird sich speziell mit diesem Thema befassen.</p>
<p>Die vom <a href="http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man5/launchd.plist.5.html">launchd</a> regelm&#228;&#223;ig ausgef&#252;hrten Wartungsma&#223;nahmen sind:<br />
 * <a href="http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man8/periodic.8.html">periodic</a> daily &#8211; /System/Library/LaunchDaemons/com.apple.periodic-daily.plist<br />
 * <a href="http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man8/periodic.8.html">periodic</a> weekly &#8211; /System/Library/LaunchDaemons/com.apple.periodic-weekly.plist<br />
 * <a href="http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man8/periodic.8.html">periodic</a> monthly &#8211; /System/Library/LaunchDaemons/com.apple.periodic-monthly.plist</p>
<p>Es gibt schon zahlreiche Artikel (u.a. <a href="http://www.thexlab.com/faqs/maintscripts.html">diesen hier</a>) die sich mit dem Thema befassen, was da genau im Hintergrund getan wird. Doch wenige zeigen einem, wie man die Uhrzeit des Ablaufs anpa&#223;t.<br />
Zum Beispiel funktioniert der Mechanismus auf unserem Mac Server ohne Probleme (der Server ist ja auch rund um die Uhr angeschaltet).</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">zebra:~ super$ cd /var/log
zebra:log super$ ls -ltr *.out
-rw-r--r--  1 root  wheel    1653 Oct  1 05:30 monthly.out
-rw-r--r--  1 root  wheel    6269 Oct 15 03:15 weekly.out
-rw-r--r--  1 root  wheel  455430 Oct 21 03:15 daily.out</pre></div></div>

<p>Hingegen werden diese Systempflegema&#223;nahmen auf meinem <em>MacBook</em> eigentlich nie ausgef&#252;hrt, denn zwischen 3 und 6 Uhr mogens ist der entweder im Stromsparmodus schlafen gelegt oder ganz ausgeschaltet.</p>
<p><a href="http://www.entwicklerforum.org/wp-content/uploads/2011/10/periodic-daily.png"><img src="http://www.entwicklerforum.org/wp-content/uploads/2011/10/periodic-daily-300x167.png" alt="Xcode Ansicht der Konfigurationsdatei" title="periodic-daily" width="300" height="167" class="alignnone size-medium wp-image-1600" /></a></p>
<p>Man kann die Skripte nat&#252;rlich manuell aus dem Terminal Programm starten, doch zwischen 12 und 13 Uhr mittags ist bei mir eine gute Zeit wann diese auf meinem mobilen Computer automatisch ihren Dienst tun k&#246;nnen. Also &#228;ndern wir das, und das geht bspw. so &#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[super@sequoia:LaunchDaemons]? cd /System/Library/LaunchDaemons
[super@sequoia:LaunchDaemons]? sudo vi com.apple.periodic*
....</pre></div></div>

<p>Wer den <em>vi</em> noch nicht bedienen kann, findet <a href="http://www.unix-manuals.com/refs/vi-ref/vi-ref.htm">hier eine Anleitung</a>.</p>
<p>Will man die &#196;nderungen hingegen im <a href="http://developer.apple.com/xcode/">Xcode 4</a> mit dem eingebauten <em>Property List Editor</em> durchf&#252;hren, dann sind dazu mehr Anpassungen n&#246;tig.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[super@sequoia:LaunchDaemons]? cd /System/Library/LaunchDaemons
[super@sequoia:LaunchDaemons]? sudo chmod o+w . com.apple.periodic*
[super@sequoia:LaunchDaemons]? open -a /Developer/Applications/Xcode.app com.apple.periodic*
....
[super@sequoia:LaunchDaemons]? sudo chmod g-w,o-w . com.apple.periodic*
[super@sequoia:LaunchDaemons]? sudo chown root:wheel com.apple.periodic*
[super@sequoia:LaunchDaemons]? sudo xattr -d com.apple.xcode.PlistType com.apple.periodic*</pre></div></div>

<p>Warum blo&#223; soviel Zusatzaufwand f&#252;r das bi&#223;chen mehr an Komfort?<br />
Nun es ist so, da&#223; Xcode zum einen die ge&#228;nderten Dateien dem Benutzer und seiner prim&#228;ren Gruppe &#252;bereignet, und zus&#228;tzlich noch <a href="http://de.wikipedia.org/wiki/Metadaten">Metadaten</a> den Dateien hinzuf&#252;gt.<br />
Wenn Metadaten zu einer Datei existieren, wird das durch ein <strong>@</strong> kenntlich gemacht &#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[super@sequoia:LaunchDaemons]? ls -le@ com.apple.periodic*
-rw-rw-r--@ 1 super staff  - 612 23 Okt 10:46 com.apple.periodic-daily.plist
	com.apple.xcode.PlistType	  0 
-rw-rw-r--@ 1 super staff  - 665 21 Okt 14:01 com.apple.periodic-monthly.plist
	com.apple.xcode.PlistType	  0 
-rw-rw-r--@ 1 super staff  - 667 21 Okt 14:01 com.apple.periodic-weekly.plist
	com.apple.xcode.PlistType	  0</pre></div></div>

<p>Die hier ausgegeben Zeilen zeigen die Dateirechte, welche nach dem Speichern der &#196;nderungen vorherrschten, bevor die Kommandos zum Herstellen des urspr&#252;nglichen Zustandes ausgef&#252;hrt wurden.<br />
Einer meiner folgenden Artikel wird sich noch genauer mit diesem Thema auseinandersetzen.</p>
<p><u>Die eigentlich durchzuf&#252;hrenden &#196;nderungen liegen auf der Hand &#8230;</u></p>
<blockquote><p>periodic-daily.plist</p></blockquote>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">                &lt;key&gt;Hour&lt;/key&gt;
		&lt;integer&gt;12&lt;/integer&gt;
		&lt;key&gt;Minute&lt;/key&gt;
		&lt;integer&gt;13&lt;/integer&gt;</pre></div></div>

<p>Jeden Tag um 12:13 Uhr geht es mit der t&#228;glichen Pflege los.</p>
<blockquote><p>periodic-weekly.plist</p></blockquote>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">		&lt;key&gt;Hour&lt;/key&gt;
		&lt;integer&gt;12&lt;/integer&gt;
		&lt;key&gt;Minute&lt;/key&gt;
		&lt;integer&gt;23&lt;/integer&gt;
		&lt;key&gt;Weekday&lt;/key&gt;
		&lt;integer&gt;1&lt;/integer&gt;</pre></div></div>

<p>Jeden Montag (Sonntag = 0) kommen um 12:23 Uhr die w&#246;chentlichen Pflegema&#223;nahmen hinzu. Als Standard ist hier der Samstag (6) eingetragen. Aber ich arbeite nicht jedes Wochenende, so kommt mir pers&#246;nlich der Montag gelegener.</p>
<blockquote><p>periodic-monthly.plist</p></blockquote>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">		&lt;key&gt;Hour&lt;/key&gt;
		&lt;integer&gt;12&lt;/integer&gt;
		&lt;key&gt;Minute&lt;/key&gt;
		&lt;integer&gt;37&lt;/integer&gt;
		&lt;key&gt;Day&lt;/key&gt;
		&lt;integer&gt;1&lt;/integer&gt;</pre></div></div>

<p>Und an jedem ersten im Monat werden um 12:37 Uhr die monatlichen Pflegevorg&#228;nge gestartet.<br />
Nat&#252;rlich werden diese Einstellung erst nach dem erneuten Laden der Konfigurationsdateien aktiviert. Ganz sicher ist das nach einem Neustart des Systems der Fall.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entwicklerforum.org/automatische-systempflege/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Time Machine Local Backup</title>
		<link>http://www.entwicklerforum.org/time-machine-local-backup</link>
		<comments>http://www.entwicklerforum.org/time-machine-local-backup#comments</comments>
		<pubDate>Fri, 21 Oct 2011 07:51:54 +0000</pubDate>
		<dc:creator>m.rastetter</dc:creator>
				<category><![CDATA[OS - Betriebssysteme]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Lion]]></category>
		<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://www.entwicklerforum.org/?p=1574</guid>
		<description><![CDATA[Mit Mac OS X Lion (Version 10.7) wurde die Software zur Datensicherung Time Machine nochmals deutlich verbessert. So ist es einem mobilen Anwender jetzt m&#246;glich an verschiedenen Arbeitspl&#228;tzen unterschiedliche Festplatten oder Netzwerklaufwerke als Datenablage zu verwenden. Dar&#252;ber hinaus besteht noch die M&#246;glichkeit einer lokalen Sicherung. Diese kann sehr n&#252;tzlich sein, aber manchmal st&#246;rt es einen [...]]]></description>
			<content:encoded><![CDATA[<p>Mit Mac OS X Lion (Version 10.7) wurde die Software zur Datensicherung <em>Time Machine</em> nochmals deutlich verbessert. So ist es einem mobilen Anwender jetzt m&#246;glich an verschiedenen Arbeitspl&#228;tzen unterschiedliche Festplatten oder Netzwerklaufwerke als Datenablage zu verwenden. Dar&#252;ber hinaus besteht noch die M&#246;glichkeit einer lokalen Sicherung. Diese kann sehr n&#252;tzlich sein, aber manchmal st&#246;rt es einen auch. Denn zur Sicherung wird dieselbe Festplatte benutzt auf welcher sich auch das Betriebssystem befindet. Das wirkt sich bei der Sicherung dann negativ auf den Datendurchsatz aus und der zur Verf&#252;gung stehende Platz auf der Festplatte verringert sich bei &#196;nderungen an gro&#223;en Datenbest&#228;nden deutlich. Deswegen kann diese Funktion bei Bedarf ein- und ausgeschaltet werden.</p>
<p>Dem Thema wie man mit <em>Time Machine</em> auf verschiedenen Medien Sicherungen durchf&#252;hren kann widmet sich ein <a href="http://hints.macworld.com/article.php?story=20110906221223743">Artikel auf Macworld</a>.</p>
<p>Und das Thema wie die lokalen Sicherungen verwaltet werden, wird auf der <a href="http://www.alexanderwilde.com/2011/08/time-machine-unter-lion-anderungen-und-tipps/">Seite von Alexander Wilde</a> sehr ausf&#252;hrlich erkl&#228;rt.</p>
<p>Technisch funktioniert dieses Verfahren so &#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[root@sequoia:~]# mount
/dev/disk1 on / (hfs, local, journaled)
devfs on /dev (devfs, local, nobrowse)
map -hosts on /net (autofs, nosuid, automounted, nobrowse)
map auto_home on /home (autofs, automounted, nobrowse)
localhost:/gT1vdKfZjhVeYqEnaYXbbb on /Volumes/MobileBackups (mtmfs, nosuid, read-only, nobrowse)</pre></div></div>

<p>Die Sicherungen sind im Verzeichnis <em>/Volumes/MobileBackups</em> bereitgestellt und befinden sich in der etwas kryptischen Freigabe <em>localhost:/gT1vdKfZjhVeYqEnaYXbbb</em>.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[root@sequoia:~]? ls -l /Volumes/
drwxrwxrwx  0 root  wheel  0 Oct 21 08:23 MobileBackups
lrwxr-xr-x  1 root  admin  1 Oct 21 08:22 sequoia_hd0 -&gt; /
[root@sequoia:~]? ls -l /Volumes/MobileBackups/Backups.backupdb/sequoia/
drwxr-xr-x@ 3 root  wheel  102 Oct 21 08:23 2011-10-15-163456
drwxr-xr-x@ 3 root  wheel  102 Oct 21 08:23 2011-10-16-174223
drwxr-xr-x@ 3 root  wheel  102 Oct 21 08:23 2011-10-17-180254
drwxr-xr-x@ 3 root  wheel  102 Oct 21 08:23 2011-10-18-180544
lrwxrwxrwx  0 root  wheel    0 Oct 21 08:22 Latest -&gt; 2011-10-18-180544</pre></div></div>

<p>Auf der Festplatte liegen die lokalen Sicherungen im versteckten Ordner <em>/.MobileBackups</em>.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[root@sequoia:Volumes]? ls -la /
drwxr-xr-x  23 root  wheel      1156 Oct 16 15:44 .
drwxr-xr-x  23 root  wheel      1156 Oct 16 15:44 ..
-rw-rw-r--   1 root  admin     15364 Oct 13 16:09 .DS_Store
d--x--x--x   7 root  wheel       238 Oct 16 15:44 .DocumentRevisions-V100
drwxr-xr-x+  3 root  wheel       102 Oct 14 07:26 .MobileBackups
drwx------   4 root  wheel       170 Oct 13 13:34 .Spotlight-V100
d-wx-wx-wt   2 root  staff        68 Oct 13 13:09 .Trashes
.....</pre></div></div>

<p>Nach dem Ausschalten der lokalen Sicherungen, sind diese Verzeichnisse verschwunden und der verbrauchte Platz wieder freigegeben.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entwicklerforum.org/time-machine-local-backup/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Die Erstellung einer App in Zusammenarbeit von Entwickler und Gestalter</title>
		<link>http://www.entwicklerforum.org/erstellung-einer-app-entwickler-gestalter</link>
		<comments>http://www.entwicklerforum.org/erstellung-einer-app-entwickler-gestalter#comments</comments>
		<pubDate>Mon, 17 Oct 2011 07:55:27 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Allgemein / Web 2.0]]></category>
		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://www.entwicklerforum.org/?p=1510</guid>
		<description><![CDATA[Unsere 1. App-Entwicklung wurde mit xCode 4 durchgef&#252;hrt. Zuerst wurde ein Layout in Photoshop CS5 erstellt, wie die App im fertigen Zustand aussehen soll. Das Grundger&#252;st hat der Entwickler dann in xCode nachgebaut. Jeder der App Beteiligten hat auf seinem Laptop mittels VCS Subversion V1.6 lokal einen Ordner angelegt, in diesem das Projekt samt Dateien [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.entwicklerforum.org/wp-content/uploads/2011/10/Technik-gestaltung.jpg"><img class="alignnone size-medium wp-image-1529" title="Technik-gestaltung" src="http://www.entwicklerforum.org/wp-content/uploads/2011/10/Technik-gestaltung-300x135.jpg" alt="" width="300" height="135" /></a></p>
<p>Unsere 1. App-Entwicklung wurde mit <a href="http://developer.apple.com/xcode/index.php" target="_blank">xCode 4</a> durchgef&#252;hrt. Zuerst wurde ein Layout in Photoshop CS5 erstellt, wie die App im fertigen Zustand aussehen soll.<br />
<a href="http://www.entwicklerforum.org/wp-content/uploads/2011/10/startlayout.jpg"><img class="alignnone size-medium wp-image-1523" title="startlayout" src="http://www.entwicklerforum.org/wp-content/uploads/2011/10/startlayout-187x300.jpg" alt="" width="187" height="300" /></a><br />
Das Grundger&#252;st hat der Entwickler dann in xCode nachgebaut. Jeder der App Beteiligten hat auf seinem Laptop mittels <a href="http://en.wikipedia.org/wiki/Revision_control" target="_blank">VCS</a> <a href="http://en.wikipedia.org/wiki/Apache_Subversion" target="_blank">Subversion</a> V1.6 lokal einen Ordner angelegt, in diesem das Projekt samt Dateien und Bilder gespeichert wurde.</p>
<p>Nach und nach wurden aus dem Photoshop Layout einzelne Grafiken abgespeichert, diese im Images Ordner abgelegt und im xCode Projekt eingepflegt.</p>
<p><strong><span style="font-size: medium; color: #800000;">Was ist dabei zu beachten?</span></strong><br />
Die Grafiken m&#252;ssen nach Abspeichern im lokalen Projektordner auch noch im xCode Projekt dem Projekt hinzugef&#252;gt werden, indem man im xCode mit Rechtsklick auf den Ordner &#8220;Images&#8221; klickt und dann &#8220;Add files to &#8230;&#8221;.<br />
<a href="http://www.entwicklerforum.org/wp-content/uploads/2011/10/addFiles.jpg"><img class="alignnone size-medium wp-image-1524" title="addFiles" src="http://www.entwicklerforum.org/wp-content/uploads/2011/10/addFiles-300x260.jpg" alt="" width="300" height="260" /></a><br />
Danach m&#252;ssen die neu hinzugef&#252;gten Daten noch commited werden, damit der Projektpartner die &#196;nderungen auch auf seinem Arbeitsplatz sehen und damit arbeiten kann.<br />
<a href="http://www.entwicklerforum.org/wp-content/uploads/2011/10/commit.jpg"><img class="alignnone size-full wp-image-1525" title="commit" src="http://www.entwicklerforum.org/wp-content/uploads/2011/10/commit.jpg" alt="" width="46" height="51" /></a></p>
<p><span style="color: #800000;"><strong><span style="font-size: medium;">Farblehre f&#252;r unsere xCode Anwendung</span></strong></span><br />
Die Farbangaben werden in xCode nicht in reinen RGB Werten angezeigt.<br />
Hier ein Beispiel aus unserem Clock View: { 255.0/255.0f, 217.0/255.0f, 83.0/255.0f, 1.0f }  Das ist die Farbe Gelb vom Ziffernblatt.<br />
Der 1. Wert von 255.0/255.0f ist beispielsweise der 1. RGB Wert = Rot<br />
Der 2. Wert 217.0/255.0f ist Gr&#252;n und der 3. Wert von 83.0/255.0f ist Blau.<br />
Der 4. Wert steht f&#252;r den Alpha Wert.</p>
<p><strong><span style="color: #800000; font-size: medium;">Wie kommen die Werte zustande?</span></strong><br />
Erkl&#228;ren ist das Ganze so, dass der Wert vor dem Slash der RGB Farbwert ist und man die 255.0f nach dem Slash erstmal nicht zu beachten braucht. Das f steht f&#252;r den float. Ist der Alpha-Wert 0.0, so ist die Farbe vollkommen 		transparent, ist er 1.0, so ist die Farbe opak.<br />
<a href="http://www.entwicklerforum.org/wp-content/uploads/2011/10/clockView.jpg"><img class="alignnone size-medium wp-image-1527" title="clockView" src="http://www.entwicklerforum.org/wp-content/uploads/2011/10/clockView-208x300.jpg" alt="" width="208" height="300" /></a></p>
<p><span style="color: #800000;"><strong><span style="font-size: medium;">Wie sind die Grafiken abzuspeichern?</span></strong></span><br />
iPhone 3GS/iPad: reichen die 72dpi und die normale Gr&#246;&#223;e des iPhones. Das hei&#223;t 320 x 480Pixel.<br />
F&#252;r die 4. Generation des iPhones und alle Retina Displays ist die Aufl&#246;sung von 72dpi auch noch ausreichend. Allerdings wird hier empfohlen die Grafiken mit der doppelten Pixelanzahl zu belegen. Das hei&#223;t wenn eine Grafik, zum Beispiel ein Logo f&#252;r das iPhone 3GS/iPad eine Gr&#246;&#223;e von 120 x 80 Pixel hat, ist die Gr&#246;&#223;e f&#252;r Retina Displays 240 x 160 Pixel.</p>
<p>Wenn der Entwickler nun etwas programmiert hat committed er die Dateien somit die anderen Personen, die an dem Projekt mitarbeiten, sich ein &#8220;Update&#8221; ziehen k&#246;nnen.<br />
<a href="http://www.entwicklerforum.org/wp-content/uploads/2011/10/update.jpg"><img class="alignnone size-full wp-image-1528" title="update" src="http://www.entwicklerforum.org/wp-content/uploads/2011/10/update.jpg" alt="" width="46" height="48" /></a></p>
<p><span style="color: #800000;"><strong><span style="font-size: medium;">Wozu ist das gut?</span></strong></span><br />
Somit sind beide Parteien immer auf dem aktuellen Stand. Entwickelt nun der Entwickler und der Gestalter an der selben Datei und beide wollen die Datei gleichzeitig committen wird gefragt, ob die Datei &#8220;gemerged&#8221; werden soll. Das hei&#223;t, die &#196;nderungen der einzelnen Personen werden erst aufgezeigt und dann werden beide &#196;nderungen in die eine Datei zusammengef&#252;hrt und diese eine Datei wird dann abgespeichert. Wer das nun nicht verstanden hat kann sich hier zum Thema &#8220;<a href="http://de.wikipedia.org/wiki/Merge" target="_blank">Merge</a>&#8221; noch einmal schlau lesen.<br />
<span style="color: #800000;"><strong><span style="font-size: medium;"><br />
Wer kann die Apps verwalten?</span></strong></span><br />
Es kann pro Firma 1 Agent bei Apple angelegt sein. Das bedeutet, dass 1 Person die neu erstellte App im App-Store anmelden kann. Wenn man eine <a href="http://developer.apple.com/programs/start/register/create.php" target="_blank">Entwickler ID</a> hat (kostenlos) und von dem TeamAgent dann  in das Entwicklerteam eingebunden/eingeladen wird, dann kann der  Entwickler mit der kostenlosen ID auch Applikationen auf einem  Testger&#228;t ausf&#252;hren, welches vom selben TeamAgent als  Entwicklungsgerate f&#252;r sein Team registriert wurde.<br />
<span style="font-size: medium; color: #800000;"><strong><br />
Fazit</strong></span><br />
Das Zusammenspiel zwischen Entwickler und Gestaltung war sehr spannend,  da immer kleine Neuerungen vom Entwickler kamen, wie in unserem Fall zum  Beispiel das Erscheinen eines Wasserdampfes. Und f&#252;r mich, die  Gestalterin war es super anzusehen wie meine Grafiken langsam in der App  Gestalt annahmen.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entwicklerforum.org/erstellung-einer-app-entwickler-gestalter/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ACL &#8211; Erweiterte Dateiberechtigungen bei Mac OS X</title>
		<link>http://www.entwicklerforum.org/acl-mac-osx</link>
		<comments>http://www.entwicklerforum.org/acl-mac-osx#comments</comments>
		<pubDate>Mon, 10 Oct 2011 08:57:41 +0000</pubDate>
		<dc:creator>m.rastetter</dc:creator>
				<category><![CDATA[OS - Betriebssysteme]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Lion]]></category>
		<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://www.entwicklerforum.org/?p=1481</guid>
		<description><![CDATA[Seit Mac OS 10.7 (Lion) kommen ACLs (= Access Control List, in die deutsche Sprache wahrscheinlich am besten mit erweiterten Dateizugriffsberechtigungen zu &#252;bersetzen) zum Einsatz. Das f&#228;llt zun&#228;chst auch technisch versierten Benutzern nicht sofort ins Auge. Zun&#228;chst einmal handelt es sich dabei um nichts Neues. Auf Mac OS wurden diese Dateiattribute mit Mac OS 10.4 [...]]]></description>
			<content:encoded><![CDATA[<p>Seit <a href="http://de.wikipedia.org/wiki/Mac_OS_X_v10.7">Mac OS 10.7 (Lion)</a> kommen ACLs (= Access Control List, in die deutsche Sprache wahrscheinlich am besten mit <em>erweiterten Dateizugriffsberechtigungen</em> zu &#252;bersetzen) zum Einsatz. Das f&#228;llt zun&#228;chst auch technisch versierten Benutzern nicht sofort ins Auge. </p>
<p>Zun&#228;chst einmal handelt es sich dabei um nichts Neues. Auf Mac OS wurden diese Dateiattribute mit <a href="http://de.wikipedia.org/wiki/Mac_OS_X_v10.4">Mac OS 10.4 (Tiger)</a> eingef&#252;hrt, welche <a href="http://de.wikipedia.org/wiki/Mac_OS_X#Mac_OS_X_10.4_.28Tiger.29">offiziell am 29. April 2005</a> erschien.<br />
Die meisten <a href="http://de.wikipedia.org/wiki/Access_Control_List">anderen Betriebssysteme hatten ACLs</a> schon bedeutend l&#228;nger mit an Bord.<br />
Der Funktionsumfang dieser erweiterten Dateizugriffsrechte liegt im wesentlichen im zugrunde gelegten <a href="http://en.wikipedia.org/wiki/Comparison_of_file_systems#Metadata">Dateisystem</a> verankert. Und bez&#252;glich Mac OS X haben sich vor einigen Jahren auch schon <a href="http://aplawrence.com/MacOSX/acl.html">andere damit befa&#223;t</a>.</p>
<p>Die Befehle, welche man zum Anschauen und zur Bearbeitung von ACLs benutzt lauten:<br />
 * <a href="http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/ls.1.html">ls -le</a><br />
 * <a href="http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/chmod.1.html#//apple_ref/doc/man/1/chmod">chmod +a</a></p>
<p>Und was soll das jetzt?</p>
<p>Zum einen wird man manchmal unfreiwillig damit konfrontiert, davon handelt mein<a href="http://www.entwicklerforum.org/probleme-mit-gnupg-mit-mac-os-x-lion"> vorangehender Artikel</a>.<br />
Zum anderen gibt es denkbar viele Anwendungsf&#228;lle, welche sich mit ACLs sehr geschickt und einfach l&#246;sen lassen. Greifen wir uns also einen heraus &#8230;</p>
<p>1. Individuelle Drop Box</p>
<p>Ein jeder Mac OS X Benutzer stellt f&#252;r andere Anwender eine Ablage f&#252;r Dateien bereit, deren Inhalt sie aber nicht sehen k&#246;nnen bzw. d&#252;rfen.<br />
Nun w&#228;re es manchmal hilfreich, einer einzelnen Person das Recht einr&#228;umen zu k&#246;nnen in ein solches Verzeichnis hineinzuschauen, was denn schon drin liegt. Also eine individuelle Drop Box anlegen.</p>
<p>Man schaut sich die aktuellen Rechte an  &#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ ls -le
drwx-wx-wx+ 2 martin  staff   102  8 Okt 09:30 Drop Box
 0: user:martin allow list,add_file,search,delete,add_subdirectory,delete_child,
    readattr,writeattr,readextattr,writeextattr,readsecurity,writesecurity,
    chown,file_inherit,directory_inherit
 1: user:_spotlight inherited allow list,search,file_inherit,directory_inherit
&nbsp;
-rw-r--r--+ 1 martin  staff  1711  8 Okt 09:11 mac_rastetter-gpg.asc
 0: user:_spotlight inherited allow read,execute</pre></div></div>

<p>Das der Kennzeichnung der Zugriffsrechte nachgestellte <strong>+</strong> Zeichen, gibt einem den Hinweis es sind ACLs f&#252;r diese Datei gesetzt. Diese werden je Benutzer bzw. Gruppe von dem Befehl <em>ls -le</em> aufgelistet.<br />
ACL 0 : Der Besitzer (martin) des Verzeichnisses bekommt explizit alle Rechte<br />
ACL 1 : Der Spotlight Dienst (_spotlight) darf alles darinnen befindliche lesen und durchsuchen<br />
Bei einer darinnen befindlichen Datei (mein &#246;ffentlicher PGP Schl&#252;ssel) hat jeder Leserechte und unabh&#228;ngig davon, wie ich die gew&#246;hnlichen Dateirechte einschr&#228;nkte, blieb dem Spotlight Dienst die M&#246;glichkeit den Inhalt zu lesen bzw. diese auszuf&#252;hren (wozu auch immer).</p>
<p>Nun legen wir ein Verzeichnis mit individueller Berechtigung an &#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ cp -Rp Drop\ Box Ina\'s\ Box
$ chmod o-wx Ina\'s\ Box
$ chmod g-wx Ina\'s\ Box
$ chmod +a &quot;ina allow list&quot; Ina\'s\ Box
$ chmod +a &quot;ina allow add_file&quot; Ina\'s\ Box
$ chmod +a &quot;ina allow search&quot; Ina\'s\ Box
$ chmod +a &quot;ina deny delete_child&quot; Ina\'s\ Box</pre></div></div>

<p>Wir kopieren also das Verzeichnis <em>Drop Box</em> mit Inhalt (in diesem Fall hoffentlich leer) und allen Berechtigungen und nennen es <em>Ina&#8217;s Box</em>.<br />
Dann nehmen wir allen anderen Benutzern und jenen der eigenen Gruppe (<em>staff</em> s.o.) alle Rechte.<br />
Wir erlauben nur der Benutzerin <em>ina</em> sich den Inhalt des Verzeichnisses anzusehen, Dateien hinzuzuf&#252;gen,<br />
darin zu suchen und verbieten das L&#246;schen.</p>
<p>Das ganze sieht dann wie folgt aus &#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ ls -le
drwx-wx-wx+ 2 martin  staff   204 10 Okt 08:46 Drop Box
 0: user:martin allow list,add_file,search,delete,add_subdirectory,delete_child,
    readattr,writeattr,readextattr,writeextattr,readsecurity,writesecurity,
    chown,file_inherit,directory_inherit
 1: user:_spotlight inherited allow list,search,file_inherit,directory_inherit
drwx------+ 2 martin  staff   306 10 Okt 08:47 Ina's Box
 0: user:ina deny delete_child
 1: user:ina allow list,add_file,search
 2: user:martin allow list,add_file,search,delete,add_subdirectory,delete_child,
    readattr,writeattr,readextattr,writeextattr,readsecurity,writesecurity,
    chown,file_inherit,directory_inherit
 3: user:_spotlight inherited allow list,search,file_inherit,directory_inherit
-rw-r--r--+ 1 martin  staff  1711  8 Okt 09:11 mac_rastetter-gpg.asc
 0: user:_spotlight inherited allow read,execute</pre></div></div>

<p>So, jetzt wollen wir schauen ob und wie es funktioniert.<br />
Alle Benutzer sehen mein &#246;ffentliches Verzeichnis im Finder wie folgt:<br />
<a href="http://www.entwicklerforum.org/wp-content/uploads/2011/10/super-public.png"><img src="http://www.entwicklerforum.org/wp-content/uploads/2011/10/super-public.png" alt="Allgemeine Benutzeransicht" title="super-public" width="339" height="129" class="alignnone size-full wp-image-1496" /></a><br />
Wohingegen die Benutzerin <em>ina</em> mein &#246;ffentliches Verzeichnis im Finder wie folgt dargestellt bekommt:<br />
<a href="http://www.entwicklerforum.org/wp-content/uploads/2011/10/ina-public.png"><img src="http://www.entwicklerforum.org/wp-content/uploads/2011/10/ina-public.png" alt="Ina Ansicht" title="ina-public" width="342" height="119" class="alignnone size-full wp-image-1497" /></a><br />
Und siehe da, diese Benutzerin kann mir dort nicht nur Dateien hinterlegen, sondern diese und deren Inhalt kontrollieren.<br />
<a href="http://www.entwicklerforum.org/wp-content/uploads/2011/10/ina-inasbox.png"><img src="http://www.entwicklerforum.org/wp-content/uploads/2011/10/ina-inasbox.png" alt="Ina Inhalt" title="ina-inasbox" width="340" height="121" class="alignnone size-full wp-image-1498" /></a></p>
<p>Die tats&#228;chlichen Rechte sehen dann wie folgt aus.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ ls -le Ina\'s\ Box/
-rw-r--r--+ 1 ina  staff  1188252 15 Sep  2009 ObjC.pdf
 0: user:martin inherited allow read,write,execute,delete,append,
    readattr,writeattr,readextattr,writeextattr,readsecurity,writesecurity,
    chown
 1: user:_spotlight inherited allow read,execute
-rw-r--r--+ 1 ina  staff      124 10 Okt 08:40 maxosx_extensions.txt
 0: user:martin inherited allow read,write,execute,delete,append,
    readattr,writeattr,readextattr,writeextattr,readsecurity,writesecurity,
    chown
 1: user:_spotlight inherited allow read,execute</pre></div></div>

<p>Man kann erkennen, da&#223; bei den Dateien die Rechte vom Verzeichnis vererbt (inherited) wurden, sowie keine Verzeichnisattribute gesetzt sind.<br />
Die allgemeinen Zugriffsrechte bleiben erhalten.<br />
Will die Besitzerin die Dateien l&#246;schen, wird das abgelehnt, bzw. mit der Frage nach dem Kennwort des Administrators quittiert (der darf sowieso alles).<br />
Nachtr&#228;gliche &#196;nderungen an den Dateien sind mit Mac Texteditoren (TextEditor, XCode) nicht mehr m&#246;glich, wohingegen auf der Unix Kommandoebene keine Einschr&#228;nkungen bestehen.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$cd ~martin/Public
$ echo &quot;Hallo Welt ... wie geht's?&quot; &gt;&gt; Ina\'s\ Box/maxosx_extensions.txt 
$ tail -1 Ina\'s\ Box/maxosx_extensions.txt 
Hallo Welt ...wie geht's?</pre></div></div>

<p>Man erwartet eigentlich auch genau dieses Verhalten, dennoch behaupten o.g. Editoren die Datei sei gesperrt?!<br />
Vielleicht will ja ein interessierter Leser dieser Sache n&#228;her auf den Grund gehen &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entwicklerforum.org/acl-mac-osx/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Probleme mit GnuPG Verschl&#252;sselung beim Einsatz unter Mac OS 10.7 Lion</title>
		<link>http://www.entwicklerforum.org/probleme-mit-gnupg-mit-mac-os-x-lion</link>
		<comments>http://www.entwicklerforum.org/probleme-mit-gnupg-mit-mac-os-x-lion#comments</comments>
		<pubDate>Sun, 09 Oct 2011 14:25:36 +0000</pubDate>
		<dc:creator>m.rastetter</dc:creator>
				<category><![CDATA[Allgemein / Web 2.0]]></category>
		<category><![CDATA[OS - Betriebssysteme]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Lion]]></category>
		<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://www.entwicklerforum.org/?p=1454</guid>
		<description><![CDATA[Wenn jemand seinen Computer auch anderweitig als nur zum Spielen einsetzt, dann st&#246;&#223;t er automatisch auf das Thema Verschl&#252;sselung. Eine qualitativ hochwertige Software, welche einfach in der Nutzung und zudem v&#246;llig kostenlos erh&#228;ltlich ist, nennt sich GNU Privacy Guard oder kurz GnuPG. Nutzer der Apple Mac OS X Betriebssystemfamilie greifen dabei gerne auf das Softwarepaket [...]]]></description>
			<content:encoded><![CDATA[<p>Wenn jemand seinen Computer auch anderweitig als nur zum Spielen einsetzt, dann st&#246;&#223;t er automatisch auf das Thema Verschl&#252;sselung. Eine qualitativ hochwertige Software, welche einfach in der Nutzung und zudem v&#246;llig kostenlos erh&#228;ltlich ist, nennt sich <a href="http://www.gnupg.org">GNU Privacy Guard</a> oder kurz GnuPG.</p>
<p>Nutzer der Apple Mac OS X Betriebssystemfamilie greifen dabei gerne auf das Softwarepaket <a href="http://www.gpgtools.org">GPGTools</a> zur&#252;ck. Eine <a href="http://www.kaipi.de/2011/01/26/gpgtools-version-2011-01-25-erschienen">deutsche Installationsanleitung</a> erlaubt selbst technischen Laien eine problemlose Installation der Software.<br />
Unabh&#228;ngig davon, ob man einige der <a href="http://www.gpgtools.org/faq.html">Funktionen</a> nun direkt aus irgendwelchen Anwendungen nutzen will, kann ein gew&#246;hnlicher Anwender unter Mac OS 10.7 (Lion) weder ent- noch verschl&#252;sseln. Und das sollte generell schon m&#246;glich sein!</p>
<p>Schaut man in der <em>Konsole</em> Anwendung, fallen einem Meldungen der Art</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">08.10.11 09:43:30,335 org.gpgtools.macgpg2.gpg-agent: gpg-agent[5844]: 
    error binding socket to `/Users/myuser/.gnupg/S.gpg-agent': Invalid argument</pre></div></div>

<p>ins Auge. Und man stellt fest, da&#223; der pers&#246;nliche GPG Agent nicht l&#228;uft.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ ps uxw | grep gpg</pre></div></div>

<p>bzw.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ launchctl list | grep gpg
	-	(2) org.gpgtools.macgpg2.gpg-agent</pre></div></div>

<p>Die Zahl in Klammern ist die Fehlernummer, welcher beim Startversuch des Agenten auftritt.</p>
<p>Nun gut, sucht man im Internet &#8230; dann findet man zu diesem Thema einige Konversationen direkt mit den Entwicklern der Software.<br />
1. <a href="http://gpgtools.lighthouseapp.com/projects/66001/tickets/2">Diskussion vom Januar 2011</a><br />
2. <a href="http://gpgtools.lighthouseapp.com/projects/66001/tickets/59">Diskussion vom Juni 2011</a><br />
Und siehe da, man erkennt sofort es werden bei Mac OS 10.7 (Lion) viel h&#228;ufiger als in den vorhergehenden Versionen dieser Betriebssystemfamilie sogenannte ACLs (= Access Control Lists, zu deutsch sind damit erweiterte  Zugriffsberechtigungen auf Dateiebene gemeint) verwendet werden.</p>
<p>Beheben wir zun&#228;chst das Problem, und schauen uns dieses Ph&#228;nomen danach noch etwas genauer an (in einem meiner nachfolgenden Beitr&#228;ge).</p>
<p>So nimmt man alle ACLs vom benutzereigenen GnuPG Verzeichnis weg &#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ cd ~
$ chmod -R -a# 0 .gnupg</pre></div></div>

<p>&#8230; dann startet man den Agenten erneut und schaut, ob er diesmal l&#228;uft &#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ launchctl start org.gpgtools.macgpg2.gpg-agent
$ launchctl list | grep gpg
213	-	org.gpgtools.macgpg2.gpg-agent</pre></div></div>

<p>Die Zahl vorne ist die Proze&#223;kennung des Agenten.</p>
<p>Bei Interesse kann man sich Details zum Agenten anzeigen lassen &#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ launchctl list org.gpgtools.macgpg2.gpg-agent</pre></div></div>

<p>&#8230; und das sollte etwa so aussehen.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">{
	&quot;Label&quot; = &quot;org.gpgtools.macgpg2.gpg-agent&quot;;
	&quot;LimitLoadToSessionType&quot; = &quot;Background&quot;;
	&quot;OnDemand&quot; = true;
	&quot;LastExitStatus&quot; = 0;
	&quot;PID&quot; = 213;
	&quot;TimeOut&quot; = 30;
	&quot;ProgramArguments&quot; = (
		&quot;/usr/local/MacGPG2/bin/gpg-agent&quot;;
		&quot;--launchd&quot;;
		&quot;--write-env-file&quot;;
	);
};</pre></div></div>

<p>Und jetzt klappt auch die Ent- und Verschl&#252;sselung wieder, bspw. &#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ gpg -d -o decoded.file encoded.file 
Sie benötigen eine Passphrase, um den geheimen Schlüssel zu entsperren.
Benutzer: &quot;Martin Rastetter &lt;martin@baden.de&gt;&quot;
1024-Bit ELG Schlüssel, ID EE827F34, erzeugt 2005-01-09 (Hauptschlüssel-ID D94AFAD0)
gpg: verschlüsselt mit 1024-Bit ELG Schlüssel, ID F3D63379, erzeugt 2008-11-03
      &quot;Fritz Fuchs &lt;fritzle@schwaben.de&gt;&quot;
gpg: verschlüsselt mit 1024-Bit ELG Schlüssel, ID EE827F34, erzeugt 2005-01-09
      &quot;Martin Rastetter &lt;martin@baden.de&gt;&quot;
gpg: Signatur vom Mi 27 Mai 12:01:06 2009 CEST mittels DSA-Schlüssel ID 63525EE3
gpg: Korrekte Signatur von &quot;Fritz Fuchs &lt;fritzle@schwaben.de&gt;&quot;
Haupt-Fingerabdruck  = CA62 6DD9 CE88 4D3D 0621  1343 6806 7B58 6352 5EE3</pre></div></div>

<p>Bestens, ab jetzt k&#246;nnen wir wieder mit GnuPG arbeiten wie wir es bisher gewohnt waren.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entwicklerforum.org/probleme-mit-gnupg-mit-mac-os-x-lion/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>InDesign-Tipp #1 Adobe PDF-Vorgaben erstellen</title>
		<link>http://www.entwicklerforum.org/indesign-tipp-1-adobe-pdf-vorgaben-erstellen</link>
		<comments>http://www.entwicklerforum.org/indesign-tipp-1-adobe-pdf-vorgaben-erstellen#comments</comments>
		<pubDate>Fri, 30 Sep 2011 09:55:19 +0000</pubDate>
		<dc:creator>Johann Müller</dc:creator>
				<category><![CDATA[InDesign]]></category>

		<guid isPermaLink="false">http://www.entwicklerforum.org/?p=1404</guid>
		<description><![CDATA[Was? - Wie erstelle ich eine eigene PDF Export-Vorgabe in InDesign. Warum? - Probleme ggf. schon vor dem Export aus dem Weg gehen. - Zeit sparen beim richtigen Exportieren. Wer in InDesign Dokumente f&#252;r die Druckerei exportiert, wird in den mei&#223;ten F&#228;llen auf das bew&#228;hrte &#8220;Exportieren als &#62; PDF X3 2002&#8243; zur&#252;ckgegriffen. Manchmal macht es [...]]]></description>
			<content:encoded><![CDATA[<h3><img class="alignnone size-full wp-image-1450" title="mac-grafik-indesign1_title" src="http://www.entwicklerforum.org/wp-content/uploads/2011/09/mac-grafik-indesign1_title.jpg" alt="" width="317" height="120" /></h3>
<h3>Was?</h3>
<p>- Wie erstelle ich eine eigene PDF Export-Vorgabe in InDesign.</p>
<h3>Warum?</h3>
<p>- Probleme ggf. schon vor dem Export aus dem Weg gehen.<br />
- Zeit sparen beim richtigen Exportieren.</p>
<p>Wer in InDesign Dokumente f&#252;r die Druckerei exportiert, wird in den mei&#223;ten F&#228;llen auf das bew&#228;hrte &#8220;Exportieren als &gt; PDF X3 2002&#8243; zur&#252;ckgegriffen. Manchmal macht es Sinn ein eigenes Ausgabeprofil anzulegen, dies m&#246;chte ich euch hier erkl&#228;ren.</p>
<p><span style="color: #800000; font-size: medium;"><strong>Achtung: </strong></span>Besonders f&#252;r Upgrades von der<strong> Adobe Creative Suite 5.0</strong> auf <strong>5.5</strong> ist es ratsam noch einmal speziell auf den Punkt <strong>Ausgabe</strong> zu achten, welche das Farbprofil f&#252;r das Dokument verwalten kann. In einigen bekannten F&#228;llen wird dieses beim Upgrade n&#228;mlich standardm&#228;&#223;ig auf <strong>U.S. Webcoated (SWOP)</strong> gestellt! In anderen F&#228;llen wird es auf das US Webcoated SWOP gewechselt sobald man die Ausgabe-Version von z.B. Acrobat 4 (PDF 1.3) auf eine h&#246;here Version einstellt, wird diese im Hintergrund auch die &#8220;Ausgabe&#8221; (also die Farbkonvertierung) &#228;ndern.</p>
<p><span id="more-1404"></span></p>
<h2>Was ist denn PDF/X ?</h2>
<p>Bevor man wei&#223; wie man eine PDF/X Vorgabe anlegen kann, lohnt es sich vielleicht erstmal ein wenig zu verstehen was das denn ist!</p>
<p>Das PDF/X ist ein Dateiformat das den Austausch von Druckdaten vereinfachen soll. Diese PDF/X Standards sind sogar nach ISO genormt. Das allgemeine PDF/X wird im ISO 15929 beschrieben, auf die einzelnen Versionen geht dann die ISO 15930-x genauer ein. Kurz gesagt, nach diesem PDF/X Standard wird entschieden welche Informationen in die PDF kommen und f&#252;r die Druckerei wichtig sind um eine gutes Ergebnis zu gew&#228;hrleisten.</p>
<p>Die unterschiedlichen Zahlen (PDF/X1; X3, X4&#8230;) beschreiben einzelne Elemente welche die PDF enthalten soll/muss.<br />
Um genau zu erkl&#228;ren welches Format was unterst&#252;tzt w&#252;rde hier den Rahmen sprengen. Eine direkte Anlaufstelle hierf&#252;r findet ihr auf der <a href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=42877" target="_blank">ISO-Seite</a>.</p>
<p>Kurzum f&#252;r PDF/X4: zus&#228;tzlich zu CMYK, Graustufen, RGB und Schmuckfarben, werden auch Transparenzen, Ebenen, OpenType-Fonts, JPEG2000 und 16-bit Bilddaten zugelassen.</p>
<p>Die Verarbeitung der Transparenzen werden im PDF/X4 (im Ablauf der Verarbeitung) weiter nach hinten gelegt, dadurch werden einige alte Probleme mit Transparenzen behoben bzw. treten garnicht erst auf. Mit diesen Transparenzen wird aber erst ab Acrobat (und Acrobat Reader) Version 7.0 richtig umgegangen. Das bedeutet dass man beim Export auch mind. die PDF Version 1.6 verwenden sollte.</p>
<p><strong><span style="color: #800000; font-size: medium;">Wichtig:</span></strong> Es ist unerl&#228;sslich das man genau weiss welches Format die Druckerei sp&#228;ter auch verarbeiten kann! Wenn die Druckerei nicht &#252;ber eine sogenannte <strong>PDF Print Engine</strong> verf&#252;gt, kann es mit X4 zu Problemen kommen. Normalerweise k&#246;nnen alle modernen Druckereien die X4 verarbeiten, einige empfehlen dies sogar. Es gibt aber dennoch viele g&#252;nstige Online-Druckservices welche nur das X3 Format akzeptieren!</p>
<h2>Eigenes Exportprofil erstellen</h2>
<p>1. Wenn ihr InDesign ge&#246;ffnet habt, geht ihr auf<br />
Datei &gt; Adobe PDF-Vorgaben &gt; Definieren&#8230;</p>
<p><a href="http://www.entwicklerforum.org/wp-content/uploads/2011/09/mac-grafik-indesign1_1.jpg" target="_blank"><img class="alignnone size-full wp-image-1419" title="Datei &gt; Adobe PDF-Vorgaben &gt; Definieren..." src="http://www.entwicklerforum.org/wp-content/uploads/2011/09/mac-grafik-indesign1_1.jpg" alt="" width="232" height="229" /></a></p>
<p>2. Im neuen Fenster k&#246;nnt ihr die Vorgaben schnell &#252;berblicken.<br />
Ich w&#228;hle f&#252;r meine neue Vorgabe <strong>PDFX4 2008</strong> und klicke auf <strong>Neu&#8230;</strong> ,<br />
Nun wird eine neue Vorlage angelegt mit den Vorgaben basierend auf der PDFX4 2008.</p>
<p><a href="http://www.entwicklerforum.org/wp-content/uploads/2011/09/mac-grafik-indesign1_2.jpg" target="_blank"><img class="alignnone size-medium wp-image-1423" title="mac-grafik-indesign1_2" src="http://www.entwicklerforum.org/wp-content/uploads/2011/09/mac-grafik-indesign1_2-300x263.jpg" alt="" width="300" height="263" /></a></p>
<p>&nbsp;</p>
<p>3. Im neuen Fenster k&#246;nnt ihr der neuen Vorgabe erst einmal einen f&#252;r euch passenden Namen vergeben. Ich nenne meine Vorlage <strong>PDFX4 2008 &#8211; Eigene Vorlage.</strong></p>
<p>F&#252;r diese Version m&#252;sste als &#8220;Standard&#8221; schon die <strong>PDF/X-4:2010 </strong>gew&#228;hlt sein und die Kompatibilit&#228;t <strong>Acrobat 7 (PDF 1.6)</strong>.</p>
<p>Auf dem Reiter <strong>Allgemein</strong> mache ich keine weiteren &#196;nderungen und belasse alles ohne Haken.</p>
<p><a href="http://www.entwicklerforum.org/wp-content/uploads/2011/09/mac-grafik-indesign1_3.jpg" target="_blank"><img class="alignnone size-medium wp-image-1432" title="mac-grafik-indesign1_3" src="http://www.entwicklerforum.org/wp-content/uploads/2011/09/mac-grafik-indesign1_3-300x218.jpg" alt="" width="300" height="218" /></a></p>
<p>&nbsp;</p>
<p>4. <strong>Komprimierung<br />
</strong></p>
<p>Die Art der Bildberechnung sollte &#252;berall auf <strong>Bikubische Neuberechnung</strong> stehen. Diese Werte bitte nur ab&#228;ndern wenn ihr genau wisst was die verschiedenen Optionen bedeuten um unerw&#252;nschte Effekte zu vermeiden. Im allgemeinen kann man mit der Bikubischen Neuberechnung nichts falsch machen.</p>
<p>Ebenfalls die Qie Komprimierung und die Bildqualit&#228;t auf jeweils <strong>Automatisch (JPEG)</strong> bzw. <strong>Maximum</strong> f&#252;r die Druckerei ist genau richtig. Lediglich <strong>bei Bildern mit mehr als 450 Pixel pro Zoll</strong> stelle ich hier den Wert auf<strong> 600</strong> (wie mir von einer Druckerei empfohlen wurde).</p>
<p><a href="http://www.entwicklerforum.org/wp-content/uploads/2011/09/mac-grafik-indesign1_4.jpg" target="_blank"><img class="alignnone size-medium wp-image-1433" title="mac-grafik-indesign1_4" src="http://www.entwicklerforum.org/wp-content/uploads/2011/09/mac-grafik-indesign1_4-300x187.jpg" alt="" width="300" height="187" /></a></p>
<p>&nbsp;</p>
<p>5. <strong>Marken und Anschnitt</strong></p>
<p>Bei den Druckmarken aktivieren viele Leute gerne alle H&#228;kchen, weil das Dokument danach so toll technisch aussieht. In den mei&#223;ten F&#228;llen ben&#246;tigen die mei&#223;ten Druckereien nur die <strong>Schnittmarken</strong>. Die <strong>Seiteninformationen</strong> sind h&#228;ufig auch sehr hilfreich.<br />
Der <strong>Versatz</strong> kann aus Sicherheitsgr&#252;nden auf <strong>3 mm</strong> erweitert werden. Dies regelt z.B. die Distanz der Schnittmarken zu dem Dokumenteninhalt.</p>
<p>Den Haken bei <strong>Anschnittseinstellungen des Dokuments verwenden</strong> lasse ich in dieser Vorlage deaktiviert, daf&#252;r stelle ich aber einen Standard-Anschnitt von <strong>3 mm</strong> f&#252;r alle Seiten. Wenn eine Druckerei einen genauen Anschnittsbereich haben m&#246;chte (einige Online-Services bitten darum) dann lege ich diese in den Dokumenteneigenschaften an und w&#228;hle beim Export dann <strong>Anschnittseinstellungen des Dokuments verwenden.</strong></p>
<p><a href="http://www.entwicklerforum.org/wp-content/uploads/2011/09/mac-grafik-indesign1_5.jpg" target="_blank"><img class="alignnone size-medium wp-image-1434" title="mac-grafik-indesign1_5" src="http://www.entwicklerforum.org/wp-content/uploads/2011/09/mac-grafik-indesign1_5-300x151.jpg" alt="" width="300" height="151" /></a></p>
<p><strong><br />
</strong></p>
<p>6. <strong>Ausgabe<br />
</strong></p>
<p>Wer von der InDesign Version 5.0 auf 5.5 upgedatet hat, bei dem kann es passieren dass bei einigen PDF/X-Versionen die Farbkonvertierung auf U.S. Webcoated (SWOP) automatisch voreingestellt wird. Hier w&#252;rde ich <strong>keine Farbkonvertierung</strong> empfehlen, weiter unten bei &#8220;Name des Ausgabemethodenprofils&#8221; habe ich <strong>Dokument-CMYK</strong> gew&#228;hlt. F&#252;r diese beiden Werte ist die eigene Arbeitsweise ausschlaggebend.</p>
<p>Ich empfehle die Bilder schon in dem richtigen Farbprofil anzulegen. Wenn dies aus irgend einem Grund nicht gemacht werden kann (Zeitmangel oder sonstiger abstrakter Grund) kann man hier die Farbkonvertiertung f&#252;r Bilder ohne Farbprofil steuern und auf ein gew&#252;nschtes Profil beim Export &#228;ndern lassen. Dies kann dann ggf. mit unvorhergesehenen Farbvarianten enden. Nicht alle Farb&#228;nderungen haben auch Auswirkung in der Ansicht der gespeicherten PDF. Wenn die Druckerei die Druckplatten belichtet kann es hier zu Abweichungen kommen.</p>
<p><a href="http://www.entwicklerforum.org/wp-content/uploads/2011/09/mac-grafik-indesign1_6.jpg" target="_blank"><img class="alignnone size-medium wp-image-1435" title="mac-grafik-indesign1_6" src="http://www.entwicklerforum.org/wp-content/uploads/2011/09/mac-grafik-indesign1_6-300x174.jpg" alt="" width="300" height="174" /></a></p>
<p>&nbsp;</p>
<p>7. <strong>Erweitert</strong></p>
<p>Bei diesen Punkt habe ich keine &#196;nderungen durchgef&#252;hrt.<strong> </strong></p>
<p>&nbsp;</p>
<p>8. <strong>&#220;bersicht</strong></p>
<p>Hier solltet ihr darauf achten ob links ein Ausrufezeichen in einem gelben Dreieck zu sehen ist (eine Warnung). Ist dies der Fall, solltet ihr der Sache nachgehen. Genauere Informationen hierzu findet ihr dann in dem Reiter &#8220;&#220;bersicht&#8221; im unteren Bereich unter &#8220;Warnungen&#8221;.</p>
<p>&nbsp;</p>
<p>Mit einem Klick auf OK speichert ihr eure neue Vorgabe.</p>
<h3>Fazit:</h3>
<p>Mit diesen Vorgaben solltet ihr in den mei&#223;ten F&#228;llen schon sehr gut liegen. Nat&#252;rlich m&#252;sst ihr, je nach Druckdokument und Druckerei die Werte (wie z.B. Farbprofile f&#252;r gestrichenes oder nicht gestrichenes Papier) richtig setzen, oder eben das richtige Ausgabeformat w&#228;hlen (wie oben schon beschrieben, manche Druckereien nehmen nur X3 Dokumente).<br />
Neben PDF Vorgaben f&#252;r die Druckerei lohnt es sich auch Vorgaben f&#252;r PDFs zu erstellen die nur einen schnellen Text-Review ben&#246;tigen, in diesen F&#228;llen kann man die Qualit&#228;t der Bilder stark einschr&#228;nken. Genauso wie PDFs die nur f&#252;r den Bildschirm gedacht sind, hier kann man auch viele Megabytes sparen. F&#252;r solche F&#228;lle gibt es zwar die vordefinierten &#8220;Press Quality&#8221; und &#8220;Small File Size&#8221;-Vorgaben, nun wisst ihr ja wie man an dieser Stelle Vorgaben nach eigenem Wunsch erstellt.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entwicklerforum.org/indesign-tipp-1-adobe-pdf-vorgaben-erstellen/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mitarbeiterwebsite bearbeiten</title>
		<link>http://www.entwicklerforum.org/mitarbeiterwebsite-bearbeiten</link>
		<comments>http://www.entwicklerforum.org/mitarbeiterwebsite-bearbeiten#comments</comments>
		<pubDate>Mon, 19 Sep 2011 13:42:15 +0000</pubDate>
		<dc:creator>j.eberle</dc:creator>
				<category><![CDATA[Typo3]]></category>

		<guid isPermaLink="false">http://www.entwicklerforum.org/?p=1385</guid>
		<description><![CDATA[In dieser eLearning Einheit von TYPO3 erlernen Sie wie Sie z.B. Inhalte in die Website eintragen k&#246;nnen und wie Sie mit Typo3 arbeiten. Sehen Sie hier ein kleines Intro Video &#252;ber die 3 verschiedenen Abspielmodis. Interaktive eLearning HTML Dokumentation PDF Dokumentation Wichtig: Die eLearning Einheit k&#246;nnen Sie nur mit dem Firefox oder dem Internet Explorer [...]]]></description>
			<content:encoded><![CDATA[<p>In dieser eLearning Einheit von TYPO3 erlernen Sie wie Sie z.B. Inhalte in die Website eintragen k&#246;nnen und wie Sie mit Typo3 arbeiten.  Sehen Sie <a href="http://elearning.enventa-extensions.de/index.php?id=344" target="_blank">hier</a> ein kleines Intro Video &#252;ber die 3 verschiedenen Abspielmodis.</p>
<p><a href="http://www.entwicklerforum.org/elearning/typo3/Mitarbeiterseite_bearbeiten/start_mitarbeiterwebsite_by33ozmx_lm.html" target="_blank">Interaktive eLearning</a></p>
<p><a href="http://www.entwicklerforum.org/elearning/typo3/Mitarbeiterseite_bearbeiten/start_mitarbeiterwebsite_documentation_by33ozmx.html" target="_blank">HTML Dokumentation</a></p>
<p><a href="http://www.entwicklerforum.org/elearning/typo3/Mitarbeiterseite_bearbeiten/mitarbeiterwebsite_documentation_by33ozmx.pdf" target="_blank">PDF Dokumentation</a></p>
<p><strong>Wichtig:</strong> Die eLearning Einheit k&#246;nnen Sie nur mit       dem Firefox  oder dem     Internet Explorer ansehen. Falls Sie uns  mit     einem  anderen Browser      besuchen, bitten wir Sie hierf&#252;r  Browser   zu   wechseln.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entwicklerforum.org/mitarbeiterwebsite-bearbeiten/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

