<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2frenchfull.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:a10="http://www.w3.org/2005/Atom" version="2.0"><channel><title>labs.bewise.fr - Articles</title><description /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/BewiseLabs/Articles" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="bewiselabs/articles" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://add.my.yahoo.com/content?lg=fr&amp;url=http%3A%2F%2Ffeeds.feedburner.com%2FBewiseLabs%2FArticles" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/bn/intatm_fr_1.gif">Subscribe with Mon Yahoo!</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FBewiseLabs%2FArticles" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.bloglines.com/sub/http://feeds.feedburner.com/BewiseLabs/Articles" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FBewiseLabs%2FArticles" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FBewiseLabs%2FArticles" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FBewiseLabs%2FArticles" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.plusmo.com/add?url=http%3A%2F%2Ffeeds.feedburner.com%2FBewiseLabs%2FArticles" src="http://plusmo.com/res/graphics/fbplusmo.gif">Subscribe with Plusmo</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.thefreedictionary.com/_/hp/AddRSS.aspx?http%3A%2F%2Ffeeds.feedburner.com%2FBewiseLabs%2FArticles" src="http://img.tfd.com/hp/addToTheFreeDictionary.gif">Subscribe with The Free Dictionary</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.bitty.com/manual/?contenttype=rssfeed&amp;contentvalue=http%3A%2F%2Ffeeds.feedburner.com%2FBewiseLabs%2FArticles" src="http://www.bitty.com/img/bittychicklet_91x17.gif">Subscribe with Bitty Browser</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.live.com/?add=http%3A%2F%2Ffeeds.feedburner.com%2FBewiseLabs%2FArticles" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://mix.excite.eu/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FBewiseLabs%2FArticles" src="http://image.excite.co.uk/mix/addtomix.gif">Subscribe with Excite MIX</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.webwag.com/wwgthis.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FBewiseLabs%2FArticles" src="http://www.webwag.com/images/wwgthis.gif">Subscribe with Webwag</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.podcastready.com/oneclick_bookmark.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FBewiseLabs%2FArticles" src="http://www.podcastready.com/images/podcastready_button.gif">Subscribe with Podcast Ready</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.wikio.com/subscribe?url=http%3A%2F%2Ffeeds.feedburner.com%2FBewiseLabs%2FArticles" src="http://www.wikio.com/shared/img/add2wikio.gif">Subscribe with Wikio</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.dailyrotation.com/index.php?feed=http%3A%2F%2Ffeeds.feedburner.com%2FBewiseLabs%2FArticles" src="http://www.dailyrotation.com/rss-dr2.gif">Subscribe with Daily Rotation</feedburner:feedFlare><item><guid isPermaLink="false">431</guid><link>http://labs.bewise.fr//Article/Premiers-pas-avec-Windows-8-et-les-applications-Metro-en-javascript---html</link><title>Premiers pas avec Windows 8 et les applications Metro en javascript / html (part 2/2)</title><description>&lt;h2&gt;Introduction&lt;/h2&gt;  &lt;p&gt;Windows 8 et Metro sont arrivées et avec eux, la possibilité de créer des applications aux interfaces utilisateurs sexy sans avoir à apprendre le xaml. Issu du monde du développement Web Asp.net, j'ai abordé la création d'applications Metro avec l'idée de capitaliser sur mes connaissances de l'html 5 et du javascript. Dans la première partie de cet article, nous avons abordé l'utilisation de jQuery et de linq en complément des librairies javascript de Microsoft pour gagner en productivité sur la création de nos applications Metro.&lt;/p&gt;  &lt;p&gt;Pour ce second  volet, nous allons nous focaliser sur l'utilisation de librairies Js dédiées aux animations 2D et 3D.&lt;/p&gt;  &lt;h2&gt;L'application&lt;/h2&gt;  &lt;p&gt;Pour rappel, l' application a pour but de visualiser le résultat d'une recherche sur Tweeter en choisissant une animation 2d ou 3d.&lt;/p&gt;  &lt;p&gt;L'application doit permettre de lancer une recherche via l'api de tweeter depuis un menu contextuel. La page principale propose un menu de navigation avec le style Metro pour choisir une animation. Une fois la recherche lancée, les miniatures dynamiques des animations s'affichent dans le menu de navigation. En cliquant sur une miniature, on navigue vers une page en plein écran pour afficher l'animation.&lt;/p&gt;  &lt;p&gt;Maintenant que nous avons vu que l'utilisation de JQuery était possible, nous allons porter notre attention sur la création d'animations 2d et 3d.&lt;/p&gt;  &lt;p&gt;Pour créer des animations avec les applications métro, nous avons plusieurs technologies à notre disposition. La première consiste à s'appuyer sur le Xaml, la seconde consiste à coder l'animation en Direct 2D ou en Direct 3D et la dernière consiste à utiliser html et css.&lt;/p&gt;  &lt;p&gt;Coder l'animation en Direct 2D/3D demande des compétences en c++ mais les projets Visual Studio sont de bons starters. Les possibilités de paramétrage et donc d'optimisation sont plus importantes.&lt;/p&gt;  &lt;p&gt;Pour cet article, nous allons utiliser 3 librairies différentes pour des animations html 5/ css 3 : processing.js , three.js et jquery-css-transform.js.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h3&gt;Utilisation de librairies pour les animations 2D et 3D : processing.js&lt;/h3&gt;  &lt;p&gt;&lt;a href="http://processingjs.org/"&gt;Processing.js&lt;/a&gt; est une librairie javascript portée du monde Java et utilisée dans le monde de l'art numérique. Elle est limitée avec les applications Metro à la 2D car elle utilise le moteur de rendu webGl en 3d qui n'est pas compatible avec IE 10 et donc avec les applications Metro. C'est la première et plus grande limitation de cette librairie pour la création d'animation. C'est aussi à mon sens la librairie la plus riche en 2D en termes d'Api.&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;(&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #006080"&gt;'use strict'&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;var&lt;/span&gt; ballAnim = WinJS.Class.define(&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    },&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        processingInstance: &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        loadcanvas: &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #008000"&gt;//Initialisation&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #008000"&gt;// Simple way to attach js code to the canvas is by using a function&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; sketchProc(processing) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            processing.setup = &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #008000"&gt;//setup 2d objects&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            processing.draw = &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #008000"&gt;//animate 2d object in a loop&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #008000"&gt;//var canvas = document.getElementById("canvas1");&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; canvas = jQuery(&lt;span style="color: #006080"&gt;"#canvas1"&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #008000"&gt;// attaching the sketchProc function to the canvas&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.processingInstance = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Processing(canvas[0], sketchProc);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        },&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        stopAnimation: &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.processingInstance != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.processingInstance.noLoop();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    });&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    WinJS.Namespace.define(&lt;span style="color: #006080"&gt;"Application1"&lt;/span&gt;,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        BallAnim: ballAnim&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    });&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;})();&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;h3&gt;Utilisation de librairies pour les animations 2D et 3D : three.js&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/mrdoob/three.js/"&gt;Three.js&lt;/a&gt; est également une librairie reconnue pour la création d'animations 2D et 3D. Elle a le bon goût d'être compatible avec Direct 3D même si elle est plus complète avec le moteur de rendu WebGl.&lt;/p&gt;

&lt;p&gt;L'idée est de charger l'animation en miniature dans chacun des templates de notre listview. Pour cela, nous ajoutons à notre item dans le fichier data.js la propriété « elementclass ». Nous allons « binder » la propriété classe du div qui doit contenir notre animation dans le template de notre listeview avec la propriété « elementclass » de notre item.&lt;/p&gt;

&lt;p&gt;Data.js : &lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;var&lt;/span&gt; sampleItems = [&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    {     &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        group: sampleGroups[0],&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        title: &lt;span style="color: #006080"&gt;"Item Title: 1"&lt;/span&gt;,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        subtitle: &lt;span style="color: #006080"&gt;"Item Subtitle: 1"&lt;/span&gt;,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        description: itemDescription,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        backgroundImage: lightGray,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        content: &lt;span style="color: #006080"&gt;"&lt;div class=\"minicube\"&gt;&lt;/div&gt;"&lt;/span&gt;,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        elementclass:&lt;span style="color: #006080"&gt;"minicube"&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;];&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Groupeditems.html :&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="itemtemplate"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;data-win-control&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="WinJS.Binding.Template"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt; &lt;span style="color: #ff0000"&gt;data-win-bind&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="className: elementclass;"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="item-overlay"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;h4&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="item-title"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;data-win-bind&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="textContent:title"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;h4&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Nous allons utiliser cette classe comme sélecteur avec jQuery pour trouver le conteneur de l'animation cube. Nous insérons dans ce conteneur un div aux dimensions du div du template.&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.container = document.createElement(&lt;span style="color: #006080"&gt;'div'&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;var&lt;/span&gt; currentMain = jQuery(&lt;span style="color: #006080"&gt;".minicube"&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.viewPortWidth = currentMain.first().width();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.viewPortHeight = currentMain.first().height();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;currentMain.first().append(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.container);&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Ensuite, nous créons l'objet de rendu de la librairie Three.js. Nous lui attribuons ses dimensions et on initialise la scène 3D.&lt;/font&gt;&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.renderer = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; THREE.CanvasRenderer();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.renderer.setSize(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.viewPortWidth, &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.viewPortHeight);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.renderer.domElement.setAttribute(&lt;span style="color: #006080"&gt;'id'&lt;/span&gt;, &lt;span style="color: #006080"&gt;'surface'&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.scene = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; THREE.Scene();&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;font color="#000000"&gt;On va ensuite créer les lumières, la camera et notre cube avant de les ajouter à la scène. La fonction checkTweets() met à jour les textures des surfaces des cubes à partir du tableau de tweets mis à jour régulièrement par un timer.  L'idée est de créer un canvas 2D pour chaque surface. Pour chacun de ces canvas, on écrit le texte dans un rectangle et on transforme le tout en texture.&lt;/font&gt;&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.camera = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.buildCamera();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.cube = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.buildCube();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.checkTweets();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.scene.add(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.camera);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.scene.add(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.cube);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.scene.add(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.buildAmbientLight());&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.scene.add(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.buildDirectionalLight());&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.container.appendChild(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.renderer.domElement);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;checkTweets: &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; max = 5;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (Data.tweets.results.length &lt; 5) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        max = Data.tweets.results.length;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;var&lt;/span&gt; i = 0; i &lt; max; i++) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; x = document.createElement(&lt;span style="color: #006080"&gt;"canvas"&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; xc = x.getContext(&lt;span style="color: #006080"&gt;"2d"&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; color = &lt;span style="color: #006080"&gt;"rgb("&lt;/span&gt; +&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        Math.floor(Math.random() * 256) + &lt;span style="color: #006080"&gt;","&lt;/span&gt; +&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        Math.floor(Math.random() * 256) + &lt;span style="color: #006080"&gt;","&lt;/span&gt; +&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        Math.floor(Math.random() * 256) + &lt;span style="color: #006080"&gt;")"&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        x.width = x.height = 128;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        xc.shadowColor = &lt;span style="color: #006080"&gt;"#000"&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        xc.shadowBlur = 2;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        xc.strokeStyle = color;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        xc.fillStyle = color;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        color = &lt;span style="color: #006080"&gt;"rgb("&lt;/span&gt; +&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        Math.floor(Math.random() * 256) + &lt;span style="color: #006080"&gt;","&lt;/span&gt; +&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        Math.floor(Math.random() * 256) + &lt;span style="color: #006080"&gt;","&lt;/span&gt; +&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        Math.floor(Math.random() * 256) + &lt;span style="color: #006080"&gt;")"&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        xc.fillRect(0, 0, 128, 128);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        xc.fillStyle = color;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        xc.font = &lt;span style="color: #006080"&gt;"11pt arial bold"&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        wrapText(xc, Data.tweets.results[i].text, 10, 10, 98, 12);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; new_texture = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; THREE.Texture(x);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.cube.geometry.materials[i].map = new_texture;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.cube.geometry.materials[i].map.needsUpdate = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Création de la lumière directionnelle avec three.js.&lt;/font&gt;&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;buildDirectionalLight: &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; directionalLight = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; THREE.DirectionalLight(0xffffff);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    directionalLight.position.set(1, 1, 1).normalize();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; directionalLight;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Création de la lumière ambiante avec three.js.&lt;/font&gt;&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;buildAmbientLight: &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; THREE.AmbientLight(0x999999);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;},&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Création de notre maillage de type cube avec three.js.&lt;/font&gt;&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;buildCube: &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; materials = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.buildMaterials();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; tmpcube = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; THREE.Mesh(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; THREE.CubeGeometry(200, 200, 200, 1, 1, 1, materials), &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; THREE.MeshFaceMaterial());&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    tmpcube.position.y = 150;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; tmpcube;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Création de textures basiques avec three.js.&lt;/font&gt;&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;buildMaterials: &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; materials = [];&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;var&lt;/span&gt; i = 0; i &lt; 5; i++) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        materials.push(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; THREE.MeshBasicMaterial({ color: Math.random() * 0xffffff     }));&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; materials;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Création de la caméra avec three.js.&lt;/font&gt;&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;buildCamera: &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; tmpcamera = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; THREE.PerspectiveCamera(50, &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.viewPortWidth / &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.viewPortHeight, 1, 1000);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    tmpcamera.position.y = 150;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    tmpcamera.position.z = 500;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; tmpcamera;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;},&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Finalement, on anime le cube :&lt;/font&gt;&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;calculateCube: &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;var&lt;/span&gt; that = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.angle = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.angle + &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.animationSpeed.value;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.cube.rotation.x = degreesToRadians(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.angle);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.cube.rotation.y = degreesToRadians(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.angle);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.cube.rotation.z = degreesToRadians(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.angle);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.renderer.render(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.scene, &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.camera);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.requestId = msRequestAnimationFrame(&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () { that.calculateCube(); &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;}, &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.renderer.domElement);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/Premiers-pas-avec-Windows-8-et-les-appli_D444/clip_image014_thumb_2.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image014_thumb" border="0" alt="clip_image014_thumb" src="http://labs.bewise.fr/Media/Windows-Live-Writer/Premiers-pas-avec-Windows-8-et-les-appli_D444/clip_image014_thumb_thumb.png" width="244" height="201" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Utilisation de librairies pour les animations 2D et 3D : transformation css&lt;/h3&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Pour cette animation, j'ai voulu tester la création d'animations en utilisant les transformations css 3.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Je suis parti de l'hélice 3D de &lt;/font&gt;&lt;a href="http://webroo.org/2012/05/23/css-3d-helix/"&gt;&lt;font color="#000000"&gt;Matt Sweetman&lt;/font&gt;&lt;/a&gt;&lt;font color="#000000"&gt; que j'ai modifiée pour appliquer aux nouds de l'hélice les tweets du résultat de recherche.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color="#000000"&gt;En conservant la même logique que pour le cube, nous créons un fichier helix.js qui contient une classe HelixAnim dans le namespace MyFirstApp.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Pour cette classe, nous créons une fonction init qui va initialiser l'hélice en fonction de la taille de son conteneur.&lt;/font&gt;&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; init() {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; that = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; container = jQuery(&lt;span style="color: #006080"&gt;'.minihelix'&lt;/span&gt;).first();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; main = jQuery(&lt;span style="color: #006080"&gt;"&lt;div id='main'&gt;&lt;/div&gt;"&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    container.append(main);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #008000"&gt;// The number of nodes and waves is dependent on the width of the browser window&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.WIDTH = 0.8 * main.width(),&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.HEIGHT = 0.8 * main.height(),&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.HELIX_SIZE = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.WIDTH / 10;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.NODES_PER_ARM = Math.floor(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.WIDTH / 110),&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.HELIX_Y = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.HEIGHT / 2,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.HELIX_WAVES = Math.round(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.WIDTH / 350),&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.X_STEP = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.WIDTH / &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.NODES_PER_ARM;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.nodes = [];&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.currentColorDec = Math.random() * 0xffffff;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #008000"&gt;// Create node elements for each arm&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;var&lt;/span&gt; i = 0; i &lt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.NODES_PER_ARM * &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.ARMS; i++) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.currentColorDec == 0xffffff) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.currentColorDec = Math.random() * 0xffffff;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; node = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.HelixNode();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        node.x = (i % &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.NODES_PER_ARM) * &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.X_STEP;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.currentColorDec = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.currentColorDec + 0x0000001;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        node.color = &lt;span style="color: #006080"&gt;'#'&lt;/span&gt; + (&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.currentColorDec).toString(16).substr(0, 6);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.nodes.push(node);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        MSApp.execUnsafeLocalFunction(&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            main.append(node.$el);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        });&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    jQuery(&lt;span style="color: #006080"&gt;"#main .node"&lt;/span&gt;).css({ &lt;span style="color: #006080"&gt;'width'&lt;/span&gt;: &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.HELIX_SIZE + &lt;span style="color: #006080"&gt;'px'&lt;/span&gt;, &lt;span style="color: #006080"&gt;'height'&lt;/span&gt;: &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.HELIX_SIZE + &lt;span style="color: #006080"&gt;'px'&lt;/span&gt;, &lt;span style="color: #006080"&gt;'font-size'&lt;/span&gt;: (Math.floor(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.WIDTH / 100) - 1) + &lt;span style="color: #006080"&gt;'px'&lt;/span&gt; });&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.renderFrame();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.helixTextTimer = setInterval(&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () { that.checkTweets(); },3000);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;font color="#000000"&gt;La fonction renderframe va calculer à chaque boucle la nouvelle position des nouds de l'hélice pour lancer la transformation css :&lt;/font&gt;&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;node.$el.css({&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;transform: &lt;span style="color: #006080"&gt;'translate3d('&lt;/span&gt; + x + &lt;span style="color: #006080"&gt;'px,'&lt;/span&gt; + y + &lt;span style="color: #006080"&gt;'px,'&lt;/span&gt; + z + &lt;span style="color: #006080"&gt;'px) '&lt;/span&gt; + &lt;span style="color: #006080"&gt;'rotateX('&lt;/span&gt; + &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;rx + &lt;span style="color: #006080"&gt;'rad) '&lt;/span&gt; + &lt;span style="color: #006080"&gt;'rotateZ('&lt;/span&gt; + rz + &lt;span style="color: #006080"&gt;'deg)'&lt;/span&gt;, opacity: opacity});&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;h3&gt; &lt;/h3&gt;

&lt;h3&gt;Affichage en plein écran.&lt;/h3&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Maintenant que l'animation s'affiche en miniature dans notre menu, nous allons permettre la navigation vers une page pour l'affichage en plein écran.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Pour cela, on modifie le code html de la page itemDetail.html. On conserve le titre de l'animation et la flèche pour retourne au menu. Le "div" avec la classe "item-content" va contenir le canvas pour l'animation.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="content"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;aria-label&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="Main content"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;role&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="main"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;article&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;header&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;                &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;h2&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="item-title"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;h2&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;                &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;h4&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="item-subtitle"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;h4&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;             &lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;header&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;img&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="item-image"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;src&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="#"&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="item-content"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;article&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;font color="#000000"&gt;devient :&lt;/font&gt;&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="content"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;aria-label&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="Main content"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;role&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="main"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;article&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;         &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;header&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;                 &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;h2&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="item-title"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;h2&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;header&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="item-content"&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;         &lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;article&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Dans la css associée à la page, on commente la partie donc on a plus besoin.&lt;/font&gt;&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #cc6633"&gt;.itemdetailpage&lt;/span&gt; &lt;span style="color: #cc6633"&gt;.content&lt;/span&gt; article {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; &lt;span style="color: #008000"&gt;/* Define a &lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;multi-column, horizontally scrolling article by default. &lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;*/&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; &lt;span style="color: #008000"&gt;/*column-fill: auto;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt; column-gap: &lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;80px;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt; column-width: 480px;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt; height: &lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;calc(100% - 50px);&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt; margin-left: &lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;120px;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt; margin-top: 5px;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt; width: &lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;480px;*/&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Dans itemDetail.js, on modifie la fonction ready pour ne gérer le binding que du titre et du conteneur de l'animation. On s'assure que ce conteneur va prendre 100% de l'espace disponible et on ajoute au div avec la classe "item-content" le code html qui est dans la propriété content de l'item qui a été sélectionné dans le menu.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color="#000000"&gt;{ group: sampleGroups[0], title: "Cube", subtitle: "Item Subtitle: 1", description: itemDescription, backgroundImage: lightGray, &lt;strong&gt;content: "&lt;div class=\"minicube\"&gt;&lt;/div&gt;",&lt;/strong&gt; elementclass: "minicube" },&lt;/font&gt;&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;element.querySelector(&lt;span style="color: #006080"&gt;".content"&lt;/span&gt;).focus();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;jQuery(&lt;span style="color: #006080"&gt;"article .item-content"&lt;/span&gt;).css(&lt;span style="color: #006080"&gt;"width"&lt;/span&gt;, &lt;span style="color: #006080"&gt;"100%"&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;jQuery(&lt;span style="color: #006080"&gt;"article .item-content"&lt;/span&gt;).css(&lt;span style="color: #006080"&gt;"height"&lt;/span&gt;,&lt;span style="color: #006080"&gt;"100%"&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;jQuery(&lt;span style="color: #006080"&gt;"article .item-title"&lt;/span&gt;).text(item.title);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;jQuery(&lt;span style="color: #006080"&gt;".titlearea .pagetitle"&lt;/span&gt;).text(item.group.title);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;jQuery(&lt;span style="color: #006080"&gt;"article .item-content"&lt;/span&gt;).empty();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;jQuery(&lt;span style="color: #006080"&gt;"article .item-content"&lt;/span&gt;).html(item.content);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;loadAnimation();&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;font color="#000000"&gt;La fonction loadAnimation vérifie teste la classe du div contenu dans &lt;div class="item-content" &gt; &lt;/div&gt; pour en déduire l'animation à lancer.&lt;/font&gt;&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; loadAnimation() {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;     &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (jQuery(&lt;span style="color: #006080"&gt;"article .item-content .minicube"&lt;/span&gt;).length != 0) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;     jQuery(&lt;span style="color: #006080"&gt;"article .item-content .minicube"&lt;/span&gt;).first().height(currentHeight);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;     jQuery(&lt;span style="color: #006080"&gt;"article .item-content .minicube"&lt;/span&gt;).first().width(currrentWidth);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;     jQuery(&lt;span style="color: #006080"&gt;"article .item-content .minicube"&lt;/span&gt;).first().empty();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;     &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (cubeAnim != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;         cubeAnim.stopAnimation();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;     cubeAnim = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Application1.CubeAnim();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;     &lt;span style="color: #0000ff"&gt;else&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (jQuery(&lt;span style="color: #006080"&gt;"article .item-content .minihelix"&lt;/span&gt;).length != 0) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;         jQuery(&lt;span style="color: #006080"&gt;"article .item-content .minihelix"&lt;/span&gt;).first().height(currentHeight);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;         jQuery(&lt;span style="color: #006080"&gt;"article .item-content .minihelix"&lt;/span&gt;).first().width(currrentWidth);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;         jQuery(&lt;span style="color: #006080"&gt;"article .item-content .minihelix"&lt;/span&gt;).empty();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;         &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (helixAnim != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;             helixAnim.stopAnimation(); &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;     helixAnim = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Application1.HelixAnim();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;     helixAnim.loadcanvas();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;font color="#000000"&gt;On ajoute le code pour la navigation. L'idée est de stopper l'animation quand on quitte la page.&lt;/font&gt;&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;init: &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; (element, options) &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;     &lt;span style="color: #008000"&gt;// Hold onto bound copies of our navigation callback&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;     &lt;span style="color: #008000"&gt;// functions so that we can clean it up when navigated &lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;     &lt;span style="color: #008000"&gt;// away from.&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.navigated = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.navigated.bind(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;},&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;navigated: &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; (eventObject) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (cubeAnim != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;) &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    { &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;       cubeAnim.stopAnimation();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (helixAnim != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;) &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;       helixAnim.stopAnimation();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;},&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; unload: &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;     WinJS.Navigation.removeEventListener(&lt;span style="color: #006080"&gt;"navigated"&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.navigated);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;font color="#000000"&gt;et dans la fonction ready :&lt;/font&gt;&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;ready: &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; (element, options) &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; that = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; WinJS.Navigation.addEventListener(&lt;span style="color: #006080"&gt;"navigated"&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.navigated);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;...&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;font color="#000000"&gt;On peut maintenant lancer notre application en mode Debug. Lorsque l'on fait une recherche et que l'on clique sur une mini animation, on la lance en plein écran. Pour améliorer le programme, il faudrait ne lancer le plein écran que si une recherche a effectivement été lancée. Il faut également relancer l'application lorsque l'on revient sur le menu principal. cet article ne traite pas ces 2 points.&lt;/font&gt;&lt;/p&gt;

&lt;h3&gt;&lt;font color="#000000"&gt;Prise en compte de la rotation de la tablette avec WinJs&lt;/font&gt;&lt;/h3&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Pour ce dernier point, nous allons relancer l'application quand le support passe du mode portrait au mode paysage. Il y a plusieurs moyens de résoudre ce problème. On peut par exemple utiliser les capteurs de la tablette et s'abonner à des évènements déclenchés lors d'une rotation de l'écran. Le problème est le que le simulateur de tablette dans Visual Studio ne simule pas (ou pas encore) ces capteurs. Il est donc impossible de tester cette implémentation.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color="#000000"&gt;J'ai donc choisi de travailler avec l'évènement resize associé à la fenêtre. Toujours dans itemDetail.js, on crée 2 variables pour conserver les dimensions de la fenêtre.&lt;/font&gt;&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;var&lt;/span&gt; currentHeight &lt;span style="color: #006080"&gt;= null;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;var&lt;/span&gt; currrentWidth &lt;span style="color: #006080"&gt;= null;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;&lt;font color="#000000"&gt;On ajoute une fonction qui sera appelée au déclenchement de l'évènement resize :&lt;/font&gt;&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;function handleResize(eventArgs) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; currrentWidth &lt;span style="color: #006080"&gt;= eventArgs.view.outerWidth;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; currentHeight &lt;span style="color: #006080"&gt;= eventArgs.view.outerHeight;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; loadAnimation();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Dans la fonction ready, on initialise nos 2 variables :&lt;/font&gt;&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;currrentWidth &lt;span style="color: #006080"&gt;= window.innerWidth;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;currentHeight &lt;span style="color: #006080"&gt;= window.innerHeight;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;On s'abonne à l'évènement :&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;window&lt;span style="color: #cc6633"&gt;.addEventListener&lt;/span&gt;("resize", handleResize);&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;font color="#000000"&gt;on oublie pas de se désabonner lorsque l'on quitte la page dans la fonction unload.&lt;/font&gt;&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;window&lt;span style="color: #cc6633"&gt;.removeEventListener&lt;/span&gt;("resize", handleResize);&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Job done !!&lt;/p&gt;

&lt;p&gt;On peut lancer le debugger avec le simulateur de tablette :&lt;/p&gt;

&lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/Premiers-pas-avec-Windows-8-et-les-appli_D444/image_2.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://labs.bewise.fr/Media/Windows-Live-Writer/Premiers-pas-avec-Windows-8-et-les-appli_D444/image_thumb.png" width="244" height="163" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Lorsque l'on effectue une rotation de l'écran, l'animation est rechargée en tenant compte des nouvelles dimensions.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/Premiers-pas-avec-Windows-8-et-les-appli_D444/image_4.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://labs.bewise.fr/Media/Windows-Live-Writer/Premiers-pas-avec-Windows-8-et-les-appli_D444/image_thumb_1.png" width="203" height="191" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/Premiers-pas-avec-Windows-8-et-les-appli_D444/image_6.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://labs.bewise.fr/Media/Windows-Live-Writer/Premiers-pas-avec-Windows-8-et-les-appli_D444/image_thumb_2.png" width="244" height="197" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h3&gt;Conclusion :&lt;/h3&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Pour ceux qui comme moi viennent du monde du Web, il est possible de créer des applications Metro avec une bonne productivité en réutilisant les librairies Javascript reconnues telles que JQuery.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Il est probable que la combinaison Xaml / c# est plus riche pour la création d'animations mais l'emploi de librairies Js 2D et 3D reste un très bon moyen de créer des animations riches. Après tout, &lt;/font&gt;&lt;a href="http://www.cuttherope.ie/" target="_blank"&gt;&lt;font color="#000000"&gt;cute the rope&lt;/font&gt;&lt;/a&gt;&lt;font color="#000000"&gt; a été développé en html 5!&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color="#000000"&gt;WinJs apporte en plus de la rigueur dans l'organisation de la solution ainsi que des fonctionnalités avancées qui nécessitaient avant d'autres librairies (ex : binding). &lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Il faut rester vigilant à l'emploi de ces librairies car leur utilisation est parfois limitée par l'environnement. Enfin, il reste à passer les tests de Microsoft pour la publication d'applications dans le store !!!&lt;/font&gt;&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Default/Article/426/src/MyFirstApp_v1.0.zip" target="_blank"&gt;Source disponibles ici&lt;/a&gt;&lt;/p&gt;</description><a10:updated>2012-06-28T09:37:48+02:00</a10:updated></item><item><guid isPermaLink="false">430</guid><link>http://labs.bewise.fr//Article/premiers-pas-avec-windows-8-et-les-applications-metro-en-javascript-html-part-1-2</link><title>Premiers pas avec Windows 8 et les applications Metro en javascript / html (part1/2)</title><description>&lt;h3&gt;Introduction&lt;/h3&gt;  &lt;p&gt;Windows 8 et Metro sont arrivées et avec eux, la possibilité de créer des applications aux interfaces utilisateurs sexy sans avoir à apprendre le xaml. Issu du monde du développement Web Asp.net, j'ai abordé la création d'applications Metro avec l'idée de capitaliser sur mes connaissances de l'html 5 et du javascript.&lt;/p&gt;  &lt;p&gt;Cet article a pour vocation de tester l'utilisation de librairies javascript reconnues en complément de WinJS, l'api fournie par Microsoft. L'article est découpé en 2 parties avec dans un second temps, une attention particulière portée à l'animation 2D et 3D. Les sources sont disponibles sur le second article.&lt;/p&gt;  &lt;h4&gt;L'application&lt;/h4&gt;  &lt;p&gt;Pour cet article, j'ai créé une application qui a pour but de visualiser le résultat d'une recherche sur Tweeter en choisissant une animation 2d ou 3d.&lt;/p&gt;  &lt;p&gt;L'application doit permettre de lancer une recherche via l'api de tweeter depuis un menu contextuel. La page principale propose un menu de navigation avec le style Metro pour choisir une animation. Une fois la recherche lancée, les miniatures dynamiques des animations s'affichent dans le menu de navigation. En cliquant sur une miniature, on navigue vers une page en plein écran pour afficher l'animation.&lt;/p&gt;  &lt;h4&gt;Création de la solution avec Visual Studio&lt;/h4&gt;  &lt;p&gt;Pour accélérer le développement de cette application, je suis parti d'un modèle de Visual studio 12 avec un contrôle de navigation.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/e39f14bf286e_D29B/clip_image002_2.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image002" border="0" alt="clip_image002" src="http://labs.bewise.fr/Media/Windows-Live-Writer/e39f14bf286e_D29B/clip_image002_thumb.jpg" width="244" height="133" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Depuis le menu de Visual Studio 2012, créer un nouveau projet javascript de type Grid App.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/e39f14bf286e_D29B/clip_image004_2.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image004" border="0" alt="clip_image004" src="http://labs.bewise.fr/Media/Windows-Live-Writer/e39f14bf286e_D29B/clip_image004_thumb.jpg" width="244" height="170" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h4&gt;Utilisation des librairies reconnues&lt;/h4&gt;  &lt;h5&gt;JQuery&lt;/h5&gt;  &lt;h6&gt;Utilisation simple de jQuery&lt;/h6&gt;  &lt;p&gt;jQuery facilite énormément le développement d'applications en javascript en proposant des méthodes de haut niveau pour effectuer des actions récurrentes. Il est possible d'utiliser jQuery pour le développement d'application Metro. Il est préférable pour cela de télécharger la dernière version de jQuery pour l'intégrer aux fichiers de la solution. &lt;/p&gt;  &lt;p&gt;Ensuite, ajouter la librairie Jquery à la solution :&lt;/p&gt;  &lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/e39f14bf286e_D29B/clip_image005_2.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image005" border="0" alt="clip_image005" src="http://labs.bewise.fr/Media/Windows-Live-Writer/e39f14bf286e_D29B/clip_image005_thumb.png" width="244" height="171" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Dans la page par défaut de l'application (default.html), ajouter un référence vers la librairie jQuery.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/e39f14bf286e_D29B/clip_image006_2.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image006" border="0" alt="clip_image006" src="http://labs.bewise.fr/Media/Windows-Live-Writer/e39f14bf286e_D29B/clip_image006_thumb.png" width="244" height="94" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Editer la page qui sera la page d'accueil de notre application (référencé dans default.html) dans le contrôle de navigation : groupedItems.html.&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="contenthost"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;data-win-control&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="Application.PageControlNavigator"&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #ff0000"&gt;data-win-options&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="{home: '/pages/groupedItems/groupedItems.html'}"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Ajouter le code html suivant sous le body :&lt;/font&gt;&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="toppanel"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="panel"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="content clearfix"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="searchbox"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;input&lt;/span&gt; &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="text"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="txtSearch"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;value&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=""&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;input&lt;/span&gt; &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="button"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="btnSearch"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="btnSearch"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;value&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="Search"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;       &lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt; &lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="tab"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ul&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="login"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;li&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="left"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;li&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;li&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="toggle"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;a&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="open"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="open"&lt;/span&gt;&lt;span style="color: #ff0000"&gt;href&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="#"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;Recherche&lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;a&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;a&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="close"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;style&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="display: none;"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="close"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;href&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="#"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;Fermer&lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;a&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;li&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;li&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="right"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;li&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;ul&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Dans le fichier css associé à la page html, on décrit le style du panel qui va nous servir de menu contextuel. Ce style fait appel à des images que l'on a ajoutées dans la solution.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color="#000000"&gt;On va enfin ajouter au code javascript de la page les commandes jQuery qui vont commander la visibilité du panel. Ajouter le code suivant dans la méthode ready de la page. Cette méthode est exécutée quand le dom a été chargé.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Grâce à jQuery, on récupère facilement les éléments du code html via le sélecteur (plus court à écrire qu'avec WinJs) et on gère les animations du panel de recherche grâce aux méthodes slideDown, slideUp et toggle.&lt;/font&gt;&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;jQuery(&lt;span style="color: #006080"&gt;"#open"&lt;/span&gt;).click(&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    jQuery(&lt;span style="color: #006080"&gt;"div#panel"&lt;/span&gt;).slideDown(&lt;span style="color: #006080"&gt;"slow"&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;});&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;// Collapse Panel&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;jQuery(&lt;span style="color: #006080"&gt;"#close"&lt;/span&gt;).click(&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    jQuery(&lt;span style="color: #006080"&gt;"div#panel"&lt;/span&gt;).slideUp(&lt;span style="color: #006080"&gt;"slow"&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;});&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;// Switch buttons from "Log In | Register" to "Close Panel" on click&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;jQuery(&lt;span style="color: #006080"&gt;"#toggle a"&lt;/span&gt;).click(&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    jQuery(&lt;span style="color: #006080"&gt;"#toggle a"&lt;/span&gt;).toggle();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;});&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;font color="#000000"&gt;On exécute l'application en mode Debug :&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/e39f14bf286e_D29B/clip_image008_2.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image008" border="0" alt="clip_image008" src="http://labs.bewise.fr/Media/Windows-Live-Writer/e39f14bf286e_D29B/clip_image008_thumb.jpg" width="244" height="73" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/e39f14bf286e_D29B/clip_image010_2.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image010" border="0" alt="clip_image010" src="http://labs.bewise.fr/Media/Windows-Live-Writer/e39f14bf286e_D29B/clip_image010_thumb.jpg" width="244" height="43" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h6&gt;Premier piège avec jQuery.&lt;/h6&gt;

&lt;p&gt;&lt;font color="#000000"&gt;La prochaine étape consiste à utiliser jQuery pour faire un appel ajax à l'api de twitter. Si on faisait une page Web classique, il n'y aurait aucun problème mais dans notre cas, Microsoft a introduit une sécurité pour ne pas pouvoir modifier le dom avec une ressource externe. L'idée est de prévenir l'injection de code malicieux dans notre application contrairement au Web, notre application pourra avoir accès à notre machine. Du code Js « téléchargé » depuis l'extérieur pourrait donc compromettre notre machine.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color="#000000"&gt;On ne peut donc pas écrire :&lt;/font&gt;&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;$.ajax({ url: &lt;span style="color: #006080"&gt;"test.html"&lt;/span&gt;, context: document.body}).done(&lt;span style="color: #0000ff"&gt;function&lt;/span&gt;() { &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    $(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;).addClass(&lt;span style="color: #006080"&gt;"done"&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;});&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Nous allons donc pas pouvoir utiliser jQuery pour effectuer la requête. Il faut faire appel à WinJS.xhr. D'abord, on ajoute un nouveau fichier javascript nommé tweetsSearch.js. On créer une nouvelle classe tweetsSearch en utilisant le formalisme de WinJs. Cette classe aura une fonction asynchrone searchAsync qui va effectuer la requête, vérifier le statut de la réponse et retourner le résultat. On notera l'utilisation de &lt;/font&gt;&lt;a href="http://code.msdn.microsoft.com/windowsapps/Promise-e1571015"&gt;&lt;font color="#000000"&gt;WinJs.Promise&lt;/font&gt;&lt;/a&gt;&lt;font color="#000000"&gt; qui permet d'effectuer des appels asynchrones et de chaîner des fonctions.&lt;/font&gt;&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;searchAsync: &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; (_request, _numTweets) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; builder = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; urlBuilder(_request, _numTweets);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; promise = WinJS.xhr(&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        url: builder.searchUrl&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;promise = promise.then(&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; (response) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; result = &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (response &amp;&amp; (response.status === 200)) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            result = JSON.parse(response.response);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; (result);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    },&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;null&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;return&lt;/span&gt; (promise);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Dans le code javascript de la page groupedItems.html, nous allons déclencher l'appel à cette fonction sur le click du bouton de recherche en utilisant jQuery.&lt;/font&gt; &lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;jQuery(&lt;span style="color: #006080"&gt;"#btnSearch"&lt;/span&gt;).click(&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    Data.request = jQuery(&lt;span style="color: #006080"&gt;"#txtSearch"&lt;/span&gt;).val();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; searcher = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Application1.TweetsSearch();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; promise = searcher.searchAsync(Data.request, 8);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    promise.then(&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; (results) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (results) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            Data.tweets = results;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    });&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;});&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Le résultat de la recherche est stocké dans une variable globale de la classe Data. Il faut donc modifier data.js en conséquence.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color="#000000"&gt;On ajoute la variable request et la variable tweets :&lt;/font&gt;&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;var&lt;/span&gt; request = &lt;span style="color: #006080"&gt;""&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;var&lt;/span&gt; tweets = [] ;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;.&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;WinJS.Namespace.define(&lt;span style="color: #006080"&gt;"Data"&lt;/span&gt;, {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    items: groupedAnims,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    groups: groupedAnims.groups,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    getItemsFromGroup: getItemsFromGroup,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    getItemReference: getItemReference,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    resolveGroupReference: resolveGroupReference,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    resolveItemReference: resolveItemReference,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    updateTweets:updateTweets,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    request : request,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    tweets : tweets&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;});&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Il n'y a plus qu'à ajouter la référence à tweetsSearch.js dans default.html.&lt;/p&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Si on lance notre application et que l'on met un point d'arrêt sur le click du bouton, on devrait voir le résultat de notre recherche dans Data.tweets.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/e39f14bf286e_D29B/clip_image011_2.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image011" border="0" alt="clip_image011" src="http://labs.bewise.fr/Media/Windows-Live-Writer/e39f14bf286e_D29B/clip_image011_thumb.png" width="244" height="76" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/e39f14bf286e_D29B/clip_image013_2.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image013" border="0" alt="clip_image013" src="http://labs.bewise.fr/Media/Windows-Live-Writer/e39f14bf286e_D29B/clip_image013_thumb.jpg" width="244" height="68" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;Utilisation de linq avec jQuery&lt;/h5&gt;

&lt;p&gt;&lt;font color="#000000"&gt;La librairie &lt;/font&gt;&lt;a href="http://linqjs.codeplex.com/" target="_blank"&gt;&lt;font color="#000000"&gt;jquery.linq.min.js&lt;/font&gt;&lt;/a&gt;&lt;font color="#000000"&gt; est elle aussi  bien utile lorsque l'on vient du monde c# et que l'on manipule les données avec des "lambda expressions" et les "enumerables". Il s'agit d'une librairie qui a pour vocation de porter la puissance de linq du framework .Net au jacascript.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Dans notre projet, linq est utile pour sélectionner des sous ensemble de listes pour effectuer des opérations en évitant d'utiliser des boucles for. Une fois la librairie téléchargée, on l'ajoute dans le dossier js de notre projet et on ajoute la référence à cette librairie dans la page default.html.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Dans le code suivant par exemple, on cherche dans la liste plancontroller les éléments dont la propriété "generation" est égale à la generation courante -2. Pour chacun de ces éléments, on applique une fonction qui permet de supprimer de la scene l'objet plan de l'élément. Il s'agit en fait de retirer d'un canvas des "objets" qui n'apparaissent plus dans la scene.&lt;/font&gt;&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;jQuery.Enumerable.From(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.plancontroller)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;.Where(&lt;span style="color: #006080"&gt;"$.generation=="&lt;/span&gt; + (that.generation - 2).toString())&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;.TojQuery().each(&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; (i) { that.scene.remove(i.plan); });&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h4&gt;Création de classes avec WinjS&lt;/h4&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Pour la suite de l'exercice, nous allons créer un fichier javascript par animation. Chaque fichier contient une classe et un namespace. Les notions de classe et de namespace sont des artifices en javascript qui permettent d'organiser la solution. En effet, javascript est un langage flexible qui demande de la rigueur, notamment lorsqu'il s'agit de déclarer des variables globales.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Avec Winjs, il est possible de créer des variables dans un namespace.&lt;/font&gt;&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () { &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #006080"&gt;'use strict'&lt;/span&gt;; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #008000"&gt;// export this "enum" &lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; ShapeType = &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    Object.freeze({ &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        None: 0, &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        Line: 1, &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        Ellipse: 2, &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        Rectangle: 3, &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        Arc: 4, &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        Bezier: 5 &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    }); &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    WinJS.Namespace.define(&lt;span style="color: #006080"&gt;"Acme.Shapes"&lt;/span&gt;, { &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        ShapeType: ShapeType &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    }); &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;})();&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Le code suivant permet par exemple d'appeler une énumération de types de formes depuis n'importe quelle portion de code sous la forme suivante :&lt;/font&gt;&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;var&lt;/span&gt; type = Acme.Shapes.ShapeType.Arc;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;font color="#000000"&gt;La création de classe utilise la fonction &lt;/font&gt;&lt;a href="http://bit.ly/rKtESn"&gt;&lt;font color="#000000"&gt;WinJS.Class.define&lt;/font&gt;&lt;/a&gt;&lt;font color="#000000"&gt; qui prend 3 parametres : une fonction utilisée comme constructeur, un objet définissant les membres d'instances et un objet définissant les membres statiques. Le contenu du code suivant sera étudié dans la seconde partie de l'article à propose de l'utilisation de librairies dédiées aux animations 2d et 3d.&lt;/font&gt; &lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;(&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #006080"&gt;"use strict"&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #008000"&gt;// constructor function&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; init () {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.animationSpeed = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.getAnimationSpeed(0.5);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; that = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.container = document.createElement(&lt;span style="color: #006080"&gt;'div'&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; currentMain = jQuery(&lt;span style="color: #006080"&gt;".minicube"&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.viewPortWidth = currentMain.first().width();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.viewPortHeight = currentMain.first().height();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        currentMain.first().append(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.container);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.renderer = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; THREE.CanvasRenderer();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.renderer.setSize(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.viewPortWidth, &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.viewPortHeight);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.renderer.domElement.setAttribute(&lt;span style="color: #006080"&gt;'id'&lt;/span&gt;, &lt;span style="color: #006080"&gt;'surface'&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.scene = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; THREE.Scene();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.camera = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.buildCamera();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.cube = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.buildCube();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.checkTweets();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.scene.add(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.camera);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.scene.add(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.cube);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.scene.add(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.buildAmbientLight());&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.scene.add(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.buildDirectionalLight());&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.container.appendChild(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.renderer.domElement);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.calculateCube();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.cubeTextTimer = setInterval(&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () { that.checkTweets(); }, &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        5000);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.loadSlider();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; instanceMembers = {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #008000"&gt;// private member&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        container: &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        renderer: &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        cube: &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        angle: 1,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        scene: &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        camera: &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        viewPortWidth: window.innerWidth,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        viewPortHeight: window.innerHeight,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        requestId: 0,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        cubeTextTimer: &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        animationSpeed: undefined,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #008000"&gt;/*****/&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        };&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; staticMembers = {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    };&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; cubeAnime = WinJS.Class.define(init, instanceMembers, staticMembers);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    WinJS.Namespace.define(&lt;span style="color: #006080"&gt;"MyFirstApp"&lt;/span&gt;,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        CubeAnim: cubeAnime&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    });&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;})();&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Ici, nous créons une classe &lt;b&gt;CubeAnim&lt;/b&gt; dans le namespace &lt;b&gt;MyFirstApp&lt;/b&gt;. Le constructeur est la fonction init et la classe n'a pas de membres statiques.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Depuis le javascript de la page groupedItems.html, nous pouvons initialiser l'animation cube une fois la recherche lancée :&lt;/font&gt; &lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;jQuery(&lt;span style="color: #006080"&gt;"#btnSearch"&lt;/span&gt;).click(&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    Data.request = jQuery(&lt;span style="color: #006080"&gt;"#txtSearch"&lt;/span&gt;).val();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; searcher = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Application1.TweetsSearch();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; promise = searcher.searchAsync(Data.request, 8);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    promise.then(&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; (results) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (results) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            Data.tweets = results;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            that.cubeAnim = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; MyFirstApp.CubeAnim();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    });&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;});&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Lorsque la classe est instanciée, le constructeur initialise l'animation.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Pour rendre notre code plus propre, nous allons créer 3 fonctions dans groupedItems.js. La première aura pour objectif d'initialiser toutes les animations, la seconde arrêtera les animations en cours et la dernière servira à lancer la recherche et à réinitialiser toutes les animations.&lt;/font&gt;&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;loadAnimations: &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;try&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.cubeAnim = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; MyFirstApp.CubeAnim();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; (exception) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #008000"&gt;//notify the user&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;resetAnimation: &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;try&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.cubeAnim != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; container = jQuery(&lt;span style="color: #006080"&gt;".minicube"&lt;/span&gt;).first();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            container.empty();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.cubeAnim.stopAnimation();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; (exception) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #008000"&gt;//notify the user&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;launchSearch: &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; (value) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; that = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    Data.request = value;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (Data.request != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt; &amp;&amp; Data.request != &lt;span style="color: #006080"&gt;""&lt;/span&gt;) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; searcher = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Application1.TweetsSearch();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; promise = searcher.searchAsync(Data.request, 8);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        promise.then(&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; (results) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (results) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;                that.resetAnimation();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;                Data.tweets = results;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;                that.loadAnimations();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        });&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;Et finalement, dans la &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; ready :&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;jQuery(&lt;span style="color: #006080"&gt;"#btnSearch"&lt;/span&gt;).click(&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    that.launchSearch(jQuery(&lt;span style="color: #006080"&gt;"#txtSearch"&lt;/span&gt;).val());&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;});&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;h4&gt;Utilisation du contrat d'application&lt;/h4&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Ressources :&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/b/b8_fr/archive/2012/06/14/activation-des-contrats-windows-160-8-dans-votre-application.aspx"&gt;&lt;font color="#000000"&gt;http://blogs.msdn.com/b/b8_fr/archive/2012/06/14/activation-des-contrats-windows-160-8-dans-votre-application.aspx&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color="#000000"&gt;Cas d'utilisation, nous allons lancer la recherche twitter depuis la recherche de Windows 8.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color="#000000"&gt;1. Ajoutez la déclaration de recherche à votre manifeste en utilisant le concepteur de manifeste de Visual Studio.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/e39f14bf286e_D29B/clip_image015_2.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image015" border="0" alt="clip_image015" src="http://labs.bewise.fr/Media/Windows-Live-Writer/e39f14bf286e_D29B/clip_image015_thumb.png" width="244" height="193" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/e39f14bf286e_D29B/clip_image016_2.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image016" border="0" alt="clip_image016" src="http://labs.bewise.fr/Media/Windows-Live-Writer/e39f14bf286e_D29B/clip_image016_thumb.png" width="244" height="139" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color="#000000"&gt;2. Placer dans le code d'initialisation de l'application tout ce qui doit fonctionner au chargement de l'application quelque soit la façon dont elle a été lancée.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color="#000000"&gt;3. S'enregistrer à l'évènement d'activation de l'application et tester s'il s'agit d'une recherche.&lt;/font&gt;&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;else&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (eventObject.detail.kind === appModel.Activation.ActivationKind.search) &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;font color="#000000"&gt;4. Quand l'application est appelée pour un résultat de recherche, naviguer vers la page de résultats en passant en paramètre le paramètre de recherche récupéré.&lt;/font&gt;&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;args.setPromise(WinJS.UI.processAll().then(&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (args.detail.queryText === &lt;span style="color: #006080"&gt;""&lt;/span&gt;) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #008000"&gt;// Navigate to your landing page since the user is pre-scoping to your app.&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; nav.navigate(Application.navigator.home);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    } &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;else&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #008000"&gt;// Display results in UI for eventObject.detail.queryText and eventObject.detail.language.&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #008000"&gt;// eventObject.detail.language represents user's locale.&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; nav.navigate(Application.navigator.home, { queryText:args.detail.queryText });&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;});&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;h3&gt;Conclusion pour cette première partie&lt;/h3&gt;

&lt;p&gt;&lt;font color="#000000"&gt;WinJs associé à des librairies javascript reconnues permet de gagner en productivité pour la réalisation d'applications Metro. Toutefois, il faut rester prudent sur leur utilisation et garder à l'esprit que Microsoft interdit la modification du dom avec du code externe.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Default/Article/426/src/MyFirstApp_v1.0.zip" target="_blank"&gt;Sources disponibles ici&lt;/a&gt;&lt;/p&gt;</description><a10:updated>2012-06-28T09:37:16+02:00</a10:updated></item><item><guid isPermaLink="false">422</guid><link>http://labs.bewise.fr//Article/Hand-Tracking-avec-Kinect-et-XNA</link><title>Hand Tracking avec Kinect et XNA</title><description>&lt;p&gt;Afin de faire nos premi&amp;egrave;res armes avec le capteur Kinect de Microsoft, nous allons r&amp;eacute;aliser une petite d&amp;eacute;mo affichant l'image film&amp;eacute;e avec la main de l'utilisateur marqu&amp;eacute;e.&lt;/p&gt;
&lt;h2&gt;Comprendre Kinect&lt;/h2&gt;
&lt;p&gt;Ce que l'on appelle Kinect est en r&amp;eacute;alit&amp;eacute; l'agr&amp;eacute;gat de deux technologies :&lt;/p&gt;
&lt;p&gt;&amp;middot; Le &amp;laquo; &lt;strong&gt;Kinect Sensor&lt;/strong&gt; &amp;raquo;, une webcam agr&amp;eacute;ment&amp;eacute;e de deux cam&amp;eacute;ras infrarouges, d'un micro et d'un socle motoris&amp;eacute;.&lt;/p&gt;
&lt;p&gt;&amp;middot; La &amp;laquo; &lt;strong&gt;NUI API&lt;/strong&gt; &amp;raquo;, partie applicative qui nous permet de traiter les informations fournies par le capteur.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/e629fb97c018_F8A2/KinectSDKArchitecture.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border-width: 0px;" title="KinectSDKArchitecture" src="http://labs.bewise.fr/Media/Windows-Live-Writer/e629fb97c018_F8A2/KinectSDKArchitecture_thumb.png" border="0" alt="KinectSDKArchitecture" width="549" height="406" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Cr&amp;eacute;er le Projet&lt;/h2&gt;
&lt;p&gt;Kinect peut &amp;ecirc;tre utilis&amp;eacute; avec un vaste panel de technologies. Pour cette d&amp;eacute;mo, nous utiliserons le framework XNA pour sa simplicit&amp;eacute;.&lt;/p&gt;
&lt;p&gt;On va utiliser le template &lt;strong&gt;Windows Game&lt;/strong&gt; fournis avec XNA :&lt;/p&gt;
&lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/e629fb97c018_F8A2/clip_image001_2.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border: 0px;" title="clip_image001" src="http://labs.bewise.fr/Media/Windows-Live-Writer/e629fb97c018_F8A2/clip_image001_thumb.png" border="0" alt="clip_image001" width="610" height="118" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Pour utiliser le SDK Kinect, il suffit d'ajouter une r&amp;eacute;f&amp;eacute;rence &amp;agrave; &lt;strong&gt;Microsoft.Kinect&lt;/strong&gt; :&lt;/p&gt;
&lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/e629fb97c018_F8A2/image_2.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border: 0px;" title="image" src="http://labs.bewise.fr/Media/Windows-Live-Writer/e629fb97c018_F8A2/image_thumb.png" border="0" alt="image" width="595" height="417" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Initialiser le capteur&lt;/h2&gt;
&lt;p&gt;Il est possible de connecter et d'utiliser plusieurs capteurs Kinect sur une m&amp;ecirc;me machine. Chaque capteur sera g&amp;eacute;r&amp;eacute; gr&amp;acirc;ce &amp;agrave; une instance de la classe &lt;strong&gt;KinectSensor&lt;/strong&gt; :&lt;/p&gt;
&lt;div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;"&gt;
&lt;div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum1" style="color: #606060;"&gt;   1:&lt;/span&gt; KinectSensor sensor = KinectSensor.KinectSensors[0];&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Les flux d'images renvoy&amp;eacute;s par la webcam (&lt;strong&gt;ColorStream&lt;/strong&gt;) et les cam&amp;eacute;ras IR (&lt;strong&gt;DepthStream&lt;/strong&gt;) sont disponibles dans plusieurs formats &amp;agrave; plusieurs fr&amp;eacute;quences.&lt;/p&gt;
&lt;p&gt;Dans notre cas nous allons utiliser du 640 x 480 &amp;agrave; 30 images par seconde car il s'agit du seul format partag&amp;eacute; par les deux types de flux :&lt;/p&gt;
&lt;div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;"&gt;
&lt;div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum1" style="color: #606060;"&gt;   1:&lt;/span&gt; sensor.DepthStream.Enable ( DepthImageFormat.Resolution640x480Fps30 );&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum2" style="color: #606060;"&gt;   2:&lt;/span&gt; sensor.ColorStream.Enable ( ColorImageFormat.RgbResolution640x480Fps30 );&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Nous allons &amp;eacute;galement activer le tracking du squelette de l'utilisateur :&lt;/p&gt;
&lt;div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;"&gt;
&lt;div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum1" style="color: #606060;"&gt;   1:&lt;/span&gt; sensor.SkeletonStream.Enable ();&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Et d&amp;eacute;marrer le capteur :&lt;/p&gt;
&lt;div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;"&gt;
&lt;div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum1" style="color: #606060;"&gt;   1:&lt;/span&gt; sensor.Start ();&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;R&amp;eacute;cup&amp;eacute;rer les frames&lt;/h2&gt;
&lt;p&gt;Notre capteur va maintenant nous envoyer des images 30 fois par secondes. Comme nous avons sp&amp;eacute;cifi&amp;eacute; la m&amp;ecirc;me fr&amp;eacute;quence pour les deux flux, elles arriveront en m&amp;ecirc;me temps et nous pouvons donc les r&amp;eacute;cup&amp;eacute;rer en m&amp;ecirc;me temps en nous abonnant &amp;agrave; l'&amp;eacute;v&amp;egrave;nement &lt;strong&gt;AllFramesReady&lt;/strong&gt;.&lt;/p&gt;
&lt;div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;"&gt;
&lt;div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum1" style="color: #606060;"&gt;   1:&lt;/span&gt; sensor.AllFramesReady += &lt;span style="color: #0000ff;"&gt;new&lt;/span&gt; EventHandler ( OnFramesReady );&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;"&gt;
&lt;div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum1" style="color: #606060;"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;void&lt;/span&gt; OnFramesReady ( &lt;span style="color: #0000ff;"&gt;object&lt;/span&gt; sender , AllFramesReadyEventArgs e )&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum2" style="color: #606060;"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum3" style="color: #606060;"&gt;   3:&lt;/span&gt;     &lt;span style="color: #008000;"&gt;// Get the frames from Kinect&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum4" style="color: #606060;"&gt;   4:&lt;/span&gt;     ColorImageFrame imageFrame = e.OpenColorImageFrame ();&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum5" style="color: #606060;"&gt;   5:&lt;/span&gt;     SkeletonFrame skeletonFrame = e.OpenSkeletonFrame ();&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum6" style="color: #606060;"&gt;   6:&lt;/span&gt;     DepthImageFrame depthFrame = e.OpenDepthImageFrame ();&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum7" style="color: #606060;"&gt;   7:&lt;/span&gt;     &lt;span style="color: #0000ff;"&gt;if&lt;/span&gt; ( ( imageFrame != &lt;span style="color: #0000ff;"&gt;null&lt;/span&gt; ) &amp;amp;&amp;amp; ( skeletonFrame != &lt;span style="color: #0000ff;"&gt;null&lt;/span&gt; ) &amp;amp;&amp;amp; ( depthFrame != &lt;span style="color: #0000ff;"&gt;null&lt;/span&gt; ) )&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum8" style="color: #606060;"&gt;   8:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum9" style="color: #606060;"&gt;   9:&lt;/span&gt;     &lt;span style="color: #008000;"&gt;// A venir.&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum10" style="color: #606060;"&gt;  10:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum11" style="color: #606060;"&gt;  11:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum12" style="color: #606060;"&gt;  12:&lt;/span&gt; &lt;span style="color: #008000;"&gt;// Dispose of the frames&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum13" style="color: #606060;"&gt;  13:&lt;/span&gt;     &lt;span style="color: #0000ff;"&gt;if&lt;/span&gt; ( imageFrame != &lt;span style="color: #0000ff;"&gt;null&lt;/span&gt; ) imageFrame.Dispose ();&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum14" style="color: #606060;"&gt;  14:&lt;/span&gt;     &lt;span style="color: #0000ff;"&gt;if&lt;/span&gt; ( skeletonFrame != &lt;span style="color: #0000ff;"&gt;null&lt;/span&gt; ) skeletonFrame.Dispose ();&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum15" style="color: #606060;"&gt;  15:&lt;/span&gt;     &lt;span style="color: #0000ff;"&gt;if&lt;/span&gt; ( depthFrame != &lt;span style="color: #0000ff;"&gt;null&lt;/span&gt; ) depthFrame.Dispose ();&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum16" style="color: #606060;"&gt;  16:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Ces frames ne sont pas directement exploitables, il va falloir les copier dans nos propres tableaux :&lt;/p&gt;
&lt;div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;"&gt;
&lt;div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum1" style="color: #606060;"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;byte&lt;/span&gt;[] _pixelData = &lt;span style="color: #0000ff;"&gt;null&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum2" style="color: #606060;"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;short&lt;/span&gt;[] _depthData = &lt;span style="color: #0000ff;"&gt;null&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum3" style="color: #606060;"&gt;   3:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;private&lt;/span&gt; Skeleton[] _skeletons = &lt;span style="color: #0000ff;"&gt;new&lt;/span&gt; Skeleton[6];&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;On va ensuite s'assurer qu'ils soient bien allou&amp;eacute;s lors de la r&amp;eacute;ception des frames et copier les donn&amp;eacute;es :&lt;/p&gt;
&lt;div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;"&gt;
&lt;div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum1" style="color: #606060;"&gt;   1:&lt;/span&gt; &lt;span style="color: #008000;"&gt;// Allocate the buffers&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum2" style="color: #606060;"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;if&lt;/span&gt; ( _pixelData == &lt;span style="color: #0000ff;"&gt;null&lt;/span&gt; )&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum3" style="color: #606060;"&gt;   3:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum4" style="color: #606060;"&gt;   4:&lt;/span&gt;     _pixelData = &lt;span style="color: #0000ff;"&gt;new&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;byte&lt;/span&gt;[imageFrame.PixelDataLength];&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum5" style="color: #606060;"&gt;   5:&lt;/span&gt;     _depthData = &lt;span style="color: #0000ff;"&gt;new&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;short&lt;/span&gt;[depthFrame.PixelDataLength];&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum6" style="color: #606060;"&gt;   6:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum7" style="color: #606060;"&gt;   7:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum8" style="color: #606060;"&gt;   8:&lt;/span&gt; &lt;span style="color: #008000;"&gt;// Retreive the data&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum9" style="color: #606060;"&gt;   9:&lt;/span&gt; imageFrame.CopyPixelDataTo ( _pixelData );&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum10" style="color: #606060;"&gt;  10:&lt;/span&gt; depthFrame.CopyPixelDataTo ( _depthData );&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum11" style="color: #606060;"&gt;  11:&lt;/span&gt; skeletonFrame.CopySkeletonDataTo ( _skeletons );&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;Afficher l'image de fond&lt;/h2&gt;
&lt;p&gt;Ces donn&amp;eacute;es ne nous sont que de peu d'utilit&amp;eacute; si on ne les exploite pas. On va commencer par afficher l'image du flux couleur dans notre application.&lt;/p&gt;
&lt;p&gt;Pour cela, on va avoir besoin de deux objets : un buffer contenant des pixels et une texture.&lt;/p&gt;
&lt;div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;"&gt;
&lt;div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum1" style="color: #606060;"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;private&lt;/span&gt; Texture2D _cameraTexture = &lt;span style="color: #0000ff;"&gt;null&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum2" style="color: #606060;"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;private&lt;/span&gt; Color[] _colorData = &lt;span style="color: #0000ff;"&gt;new&lt;/span&gt; Color[640 * 480];&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;On instancie la texture dans &lt;strong&gt;LoadContent&lt;/strong&gt; :&lt;/p&gt;
&lt;div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;"&gt;
&lt;div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum1" style="color: #606060;"&gt;   1:&lt;/span&gt; _cameraTexture = &lt;span style="color: #0000ff;"&gt;new&lt;/span&gt; Texture2D ( GraphicsDevice , 640 , 480 , &lt;span style="color: #0000ff;"&gt;false&lt;/span&gt; , SurfaceFormat.Color );&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Le capteur Kinect nous envoie le flux d'image au format BGR, il va falloir le convertir au format RGBA utilis&amp;eacute; par XNA :&lt;/p&gt;
&lt;div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;"&gt;
&lt;div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum1" style="color: #606060;"&gt;   1:&lt;/span&gt; &lt;span style="color: #008000;"&gt;// Convert the color data to the proper format&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum2" style="color: #606060;"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;for&lt;/span&gt; ( &lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; i = 0 ; i &amp;lt; ( 640 * 480 ) ; ++i )&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum3" style="color: #606060;"&gt;   3:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum4" style="color: #606060;"&gt;   4:&lt;/span&gt;     &lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; b = _pixelData[( i * 4 )];&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum5" style="color: #606060;"&gt;   5:&lt;/span&gt;     &lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; g = _pixelData[( i * 4 ) + 1];&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum6" style="color: #606060;"&gt;   6:&lt;/span&gt;     &lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; r = _pixelData[( i * 4 ) + 2];&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum7" style="color: #606060;"&gt;   7:&lt;/span&gt;     _colorData[i] = &lt;span style="color: #0000ff;"&gt;new&lt;/span&gt; Color ( r , g , b , 255 );&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum8" style="color: #606060;"&gt;   8:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum9" style="color: #606060;"&gt;   9:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum10" style="color: #606060;"&gt;  10:&lt;/span&gt; &lt;span style="color: #008000;"&gt;// Copy it inside the texture&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum11" style="color: #606060;"&gt;  11:&lt;/span&gt; _cameraTexture.SetData ( _colorData );&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Enfin, dans la m&amp;eacute;thode &lt;strong&gt;Draw&lt;/strong&gt; nous allons simplement afficher la texture de fond :&lt;/p&gt;
&lt;div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;"&gt;
&lt;div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum1" style="color: #606060;"&gt;   1:&lt;/span&gt; spriteBatch.Begin ();&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum2" style="color: #606060;"&gt;   2:&lt;/span&gt; spriteBatch.Draw ( _cameraTexture , Vector2.Zero , Color.White );&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum3" style="color: #606060;"&gt;   3:&lt;/span&gt; spriteBatch.End ();&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum4" style="color: #606060;"&gt;   4:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum5" style="color: #606060;"&gt;   5:&lt;/span&gt; graphics.GraphicsDevice.Textures[0] = &lt;span style="color: #0000ff;"&gt;null&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;La derni&amp;egrave;re ligne s'assure que la texture n'est plus associ&amp;eacute;e avec le &lt;strong&gt;GraphicsDevice&lt;/strong&gt; au moment de modifier son contenu, autrement nous aurions une exception.&lt;/p&gt;
&lt;h2&gt;Skeleton Tracking&lt;/h2&gt;
&lt;p&gt;Kinect &amp;eacute;tant bien plus qu'une webcam, voyons comment r&amp;eacute;cup&amp;eacute;rer la position de la main droite de l'utilisateur.&lt;/p&gt;
&lt;p&gt;L'API NUI est charg&amp;eacute;e de reconstituer le squelette des utilisateurs en fonction du flux de profondeur fournis par les deux cam&amp;eacute;ras IR.&lt;/p&gt;
&lt;div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;"&gt;
&lt;div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum1" style="color: #606060;"&gt;   1:&lt;/span&gt; Skeleton skeleton = ( from s &lt;span style="color: #0000ff;"&gt;in&lt;/span&gt; _Skeletons &lt;span style="color: #0000ff;"&gt;where&lt;/span&gt; s.TrackingState == SkeletonTrackingState.Tracked select s ).FirstOrDefault ();&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum2" style="color: #606060;"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;if&lt;/span&gt; ( skeleton != &lt;span style="color: #0000ff;"&gt;null&lt;/span&gt; )&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum3" style="color: #606060;"&gt;   3:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum4" style="color: #606060;"&gt;   4:&lt;/span&gt;     Joint joint = skeleton.Joints[JointType.HandRight];                &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum5" style="color: #606060;"&gt;   5:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Notre application ne pr&amp;eacute;voit qu'un seul utilisateur, mais il est possible de traquer jusqu'&amp;agrave; 6 squelettes avec un seul capteur Kinect.&lt;/p&gt;
&lt;p&gt;Chaque squelette est compos&amp;eacute; de plusieurs articulations (&lt;em&gt;joints&lt;/em&gt;) identifi&amp;eacute;es comme suit :&lt;/p&gt;
&lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/e629fb97c018_F8A2/KinectJoints_2.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border: 0px;" title="KinectJoints" src="http://labs.bewise.fr/Media/Windows-Live-Writer/e629fb97c018_F8A2/KinectJoints_thumb.png" border="0" alt="KinectJoints" width="448" height="446" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Dans notre cas, nous r&amp;eacute;cup&amp;eacute;rons la position de la main droite de l'utilisateur. Toutefois cette position est tridimensionnelle et relative au squelette. Si on veut marquer l'emplacement de la main droite sur l'image film&amp;eacute;e, il va falloir faire correspondre les deux :&lt;/p&gt;
&lt;div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;"&gt;
&lt;div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum1" style="color: #606060;"&gt;   1:&lt;/span&gt; ColorImagePoint pt = sensor.MapSkeletonPointToColor ( joint.Position , imageFrame.Format );&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum2" style="color: #606060;"&gt;   2:&lt;/span&gt; _handPosition = &lt;span style="color: #0000ff;"&gt;new&lt;/span&gt; Vector2 ( pt.X , pt.Y );&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Cette position 2D correspond &amp;agrave; la position de la main droite sur l'image r&amp;eacute;cup&amp;eacute;r&amp;eacute;e par le capteur. Pour v&amp;eacute;rifier que cela fonctionne, on va dessiner un carr&amp;eacute; rouge &amp;agrave; cet endroit.&lt;/p&gt;
&lt;p&gt;Dans &lt;strong&gt;LoadContent&lt;/strong&gt;, on va cr&amp;eacute;er une texture d'un pixel :&lt;/p&gt;
&lt;div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;"&gt;
&lt;div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum1" style="color: #606060;"&gt;   1:&lt;/span&gt; _pixelTexture = &lt;span style="color: #0000ff;"&gt;new&lt;/span&gt; Texture2D ( GraphicsDevice , 1 , 1 , &lt;span style="color: #0000ff;"&gt;false&lt;/span&gt; , SurfaceFormat.Color );&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum2" style="color: #606060;"&gt;   2:&lt;/span&gt; _pixelTexture.SetData ( &lt;span style="color: #0000ff;"&gt;new&lt;/span&gt; Color[] { Color.White } );&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Et dans &lt;strong&gt;Draw&lt;/strong&gt;, on va dessiner notre carr&amp;eacute; :&lt;/p&gt;
&lt;div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;"&gt;
&lt;div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span id="lnum1" style="color: #606060;"&gt;   1:&lt;/span&gt; spriteBatch.Draw ( _pixelTexture , &lt;span style="color: #0000ff;"&gt;new&lt;/span&gt; Rectangle ( (&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt;)_handPosition.X - 8 , (&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt;)_handPosition.Y - 8 , 16 , 16 ) , Color.Red );&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;On peut d&amp;eacute;sormais tester le r&amp;eacute;sultat :&lt;/p&gt;
&lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/e629fb97c018_F8A2/KinectDemo_2.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border: 0px;" title="KinectDemo" src="http://labs.bewise.fr/Media/Windows-Live-Writer/e629fb97c018_F8A2/KinectDemo_thumb.png" border="0" alt="KinectDemo" width="532" height="425" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Vous savez d&amp;eacute;sormais rep&amp;eacute;rer la position de la main de l'utilisateur qui peut servir de curseur dans vos applications. Vous pouvez &amp;eacute;galement modifier le code de l'application pour vous entrainer et suivre plusieurs parties du corps voir m&amp;ecirc;me plusieurs utilisateurs.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://labs.bewise.fr/Download/Article-HandTrackingAvecKinectEtXNA.zip"&gt;T&amp;eacute;l&amp;eacute;charger les sources de la d&amp;eacute;mo&lt;/a&gt;&lt;/p&gt;</description><a10:updated>2012-05-14T17:51:28+02:00</a10:updated></item><item><guid isPermaLink="false">419</guid><link>http://labs.bewise.fr//Article/ma-premi%C3%A8re-application-metro-javascript.-partie-1-les-contr%C3%B4les</link><title>Ma première application Metro/Javascript. Partie 1 : les contrôles</title><description>&lt;p&gt;Cet article est le premier d&amp;rsquo;une s&amp;eacute;rie d&amp;rsquo;article de pr&amp;eacute;sentation du d&amp;eacute;veloppement d&amp;rsquo;application Metro, avec HTML et Javascript.&lt;/p&gt;
&lt;p&gt;Ces articles se concentreront principalement sur les sp&amp;eacute;cificit&amp;eacute;s de Windows 8, il est recommand&amp;eacute; de connaitre les bases du d&amp;eacute;veloppement web avec HTML et Javascript.&lt;/p&gt;
&lt;h2&gt;Pr&amp;eacute;sentation de la solution&lt;/h2&gt;
&lt;p&gt;Nous commen&amp;ccedil;ons par cr&amp;eacute;er un nouveau projet &amp;laquo; Windows Metro Style &amp;raquo;, utilisant le langage Javascript :&lt;/p&gt;
&lt;p&gt;&lt;img src="http://labs.bewise.fr/media/windows-live-writer/dveloppement_d705/image_2.png" alt="" width="605" height="418" /&gt;&lt;/p&gt;
&lt;p&gt;Lorsque le projet est cr&amp;eacute;&amp;eacute;, on se retrouve avec la structure suivante :&lt;/p&gt;
&lt;p&gt;&lt;img src="http://labs.bewise.fr/media/windows-live-writer/dveloppement_d705/clip_image001_2.png" alt="" width="336" height="294" /&gt;&lt;/p&gt;
&lt;p&gt;Hormis les deux derniers fichiers (manifest et certificats), on a vraiment un projet similaire &amp;agrave; un site web : des fichiers html, javascript, css, et des images.&lt;/p&gt;
&lt;p&gt;Nous allons d&amp;eacute;velopper notre application en HTML et Javascript, et le rendu sera g&amp;eacute;r&amp;eacute; par Internet Explorer 10.&lt;/p&gt;
&lt;h2&gt;Utilisation des contr&amp;ocirc;les HTML&lt;/h2&gt;
&lt;h3&gt;Contr&amp;ocirc;les HTML&lt;/h3&gt;
&lt;p&gt;&amp;Eacute;tant donn&amp;eacute; que nous d&amp;eacute;veloppons en HTML, nous allons donc pouvoir g&amp;eacute;rer notre affichage de la m&amp;ecirc;me mani&amp;egrave;re que dans un site web classique, &amp;agrave; l&amp;rsquo;aide des contr&amp;ocirc;les HTML que nous connaissons d&amp;eacute;j&amp;agrave;. On pourra par afficher un bouton avec le contr&amp;ocirc;le &amp;lt;button&amp;gt; :&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-fareast-language: EN-US; mso-highlight: white; mso-ansi-language: FR; mso-bidi-language: AR-SA;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: maroon; font-size: 9.5pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-fareast-language: EN-US; mso-highlight: white; mso-ansi-language: FR; mso-bidi-language: AR-SA;"&gt;button&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-fareast-language: EN-US; mso-highlight: white; mso-ansi-language: FR; mso-bidi-language: AR-SA;"&gt; &lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: red; font-size: 9.5pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-fareast-language: EN-US; mso-highlight: white; mso-ansi-language: FR; mso-bidi-language: AR-SA;"&gt;id&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-fareast-language: EN-US; mso-highlight: white; mso-ansi-language: FR; mso-bidi-language: AR-SA;"&gt;="bt"&amp;gt;&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-fareast-language: EN-US; mso-highlight: white; mso-ansi-language: FR; mso-bidi-language: AR-SA;"&gt;Un bouton&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-fareast-language: EN-US; mso-highlight: white; mso-ansi-language: FR; mso-bidi-language: AR-SA;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: maroon; font-size: 9.5pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-fareast-language: EN-US; mso-highlight: white; mso-ansi-language: FR; mso-bidi-language: AR-SA;"&gt;button&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-fareast-language: EN-US; mso-highlight: white; mso-ansi-language: FR; mso-bidi-language: AR-SA;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; color: blue; font-size: 9.5pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-fareast-language: EN-US; mso-ansi-language: FR; mso-bidi-language: AR-SA;"&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://labs.bewise.fr/media/windows-live-writer/dveloppement_d705/image_4.png" alt="" width="100" height="39" /&gt;&lt;/p&gt;
&lt;p&gt;Et comme les applications Metro utilisent un moteur de rendu compatible avec HTML5 (au moins en partie), nous allons pouvoir utiliser les nouveaux contr&amp;ocirc;les. Par exemple, nous pourrons utiliser un contr&amp;ocirc;le de type &amp;laquo; slider &amp;raquo; en faisant un input de type &amp;laquo; range &amp;raquo; :&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-fareast-language: EN-US; mso-highlight: white; mso-ansi-language: EN-US; mso-bidi-language: AR-SA;" lang="EN-US"&gt;&amp;lt;&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: maroon; font-size: 9.5pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-fareast-language: EN-US; mso-highlight: white; mso-ansi-language: EN-US; mso-bidi-language: AR-SA;" lang="EN-US"&gt;input&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-fareast-language: EN-US; mso-highlight: white; mso-ansi-language: EN-US; mso-bidi-language: AR-SA;" lang="EN-US"&gt; &lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: red; font-size: 9.5pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-fareast-language: EN-US; mso-highlight: white; mso-ansi-language: EN-US; mso-bidi-language: AR-SA;" lang="EN-US"&gt;type&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-fareast-language: EN-US; mso-highlight: white; mso-ansi-language: EN-US; mso-bidi-language: AR-SA;" lang="EN-US"&gt;="range"&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-fareast-language: EN-US; mso-highlight: white; mso-ansi-language: EN-US; mso-bidi-language: AR-SA;" lang="EN-US"&gt; &lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: red; font-size: 9.5pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-fareast-language: EN-US; mso-highlight: white; mso-ansi-language: EN-US; mso-bidi-language: AR-SA;" lang="EN-US"&gt;min&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-fareast-language: EN-US; mso-highlight: white; mso-ansi-language: EN-US; mso-bidi-language: AR-SA;" lang="EN-US"&gt;="0"&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-fareast-language: EN-US; mso-highlight: white; mso-ansi-language: EN-US; mso-bidi-language: AR-SA;" lang="EN-US"&gt; &lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: red; font-size: 9.5pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-fareast-language: EN-US; mso-highlight: white; mso-ansi-language: EN-US; mso-bidi-language: AR-SA;" lang="EN-US"&gt;max&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-fareast-language: EN-US; mso-highlight: white; mso-ansi-language: EN-US; mso-bidi-language: AR-SA;" lang="EN-US"&gt;="20"&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-fareast-language: EN-US; mso-highlight: white; mso-ansi-language: EN-US; mso-bidi-language: AR-SA;" lang="EN-US"&gt; &lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: red; font-size: 9.5pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-fareast-language: EN-US; mso-highlight: white; mso-ansi-language: EN-US; mso-bidi-language: AR-SA;" lang="EN-US"&gt;step&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-fareast-language: EN-US; mso-highlight: white; mso-ansi-language: EN-US; mso-bidi-language: AR-SA;" lang="EN-US"&gt;="2"&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-fareast-language: EN-US; mso-highlight: white; mso-ansi-language: EN-US; mso-bidi-language: AR-SA;" lang="EN-US"&gt; &lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-fareast-language: EN-US; mso-highlight: white; mso-ansi-language: EN-US; mso-bidi-language: AR-SA;" lang="EN-US"&gt;/&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://labs.bewise.fr/media/windows-live-writer/dveloppement_d705/image_6.png" alt="" width="304" height="77" /&gt;&lt;/p&gt;
&lt;h3&gt;Propri&amp;eacute;t&amp;eacute;s des contr&amp;ocirc;les, et &amp;eacute;v&amp;egrave;nements&lt;/h3&gt;
&lt;p&gt;Une fois qu&amp;rsquo;on a &amp;eacute;crit nos contr&amp;ocirc;les en HTML, on peut y acc&amp;eacute;der, lire et modifier les propri&amp;eacute;t&amp;eacute;s, &amp;agrave; l&amp;rsquo;aide de Javascript. Par exemple, si on veut afficher la valeur du slider, &amp;ccedil;a se passe comme &amp;ccedil;a :&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: maroon; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;button&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt; &lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: red; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;id&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;="bouton"&amp;gt;&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;Un bouton&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: maroon; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;button&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;&amp;gt;&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: maroon; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;input&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt; &lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: red; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;id&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;="slider"&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt; &lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: red; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;type&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;="range"&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt; &lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: red; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;min&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;="0"&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt; &lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: red; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;max&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;="20"&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt; &lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: red; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;step&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;="2"&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt; &lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0cm 0cm 10pt;"&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: maroon; font-size: 9.5pt; mso-highlight: white;"&gt;p&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: red; font-size: 9.5pt; mso-highlight: white;"&gt;id&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white;"&gt;="resultat"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: maroon; font-size: 9.5pt; mso-highlight: white;"&gt;p&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="mso-fareast-language: FR;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;Et dans le code Javascript (fichier data.js), on ajoute une fonction :&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;function&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt; buttonClick(mouseEvent) {&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;var&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt; output = document.getElementById(&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: maroon; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;"resultat"&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;);&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;var&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt; slider = document.getElementById(&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: maroon; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;"slider"&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;);&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white;"&gt;output.innerText = slider.value;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0cm 0cm 10pt;"&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white;"&gt;}&lt;/span&gt;&lt;span style="mso-fareast-language: FR;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;Et il faut s&amp;rsquo;abonner &amp;agrave; l&amp;rsquo;&amp;eacute;v&amp;egrave;nement &amp;laquo; click &amp;raquo; du bouton. Dans la fonction app.onactivated (lors de l&amp;rsquo;activation de l&amp;rsquo;application), on ajoute :&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;var&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt; bouton = document.getElementById(&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: maroon; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;"bouton"&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;);&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0cm 0cm 10pt;"&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;bouton.addEventListener(&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: maroon; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;"click"&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;, buttonClick, &lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;false&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;);&lt;/span&gt;&lt;span style="mso-fareast-language: FR; mso-ansi-language: EN-US;" lang="EN-US"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;Il est aussi possible de se baser sur des librairies Javascript externes. Le code Javascript aurait tout aussi bien pu s&amp;rsquo;&amp;eacute;crire de la mani&amp;egrave;re suivante, en utilisant jQuery :&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;$(&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: maroon; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;"#bouton"&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;).click(&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;function&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt; () {&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;var&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt; sliderValue = $(&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: maroon; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;"#slider"&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;).val();&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white;"&gt;$(&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: maroon; font-size: 9.5pt; mso-highlight: white;"&gt;"#resultat"&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white;"&gt;).text(sliderValue);&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0cm 0cm 10pt;"&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white;"&gt;});&lt;/span&gt;&lt;span style="mso-fareast-language: FR;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/p&gt;
&lt;h2&gt;Utilisation des contr&amp;ocirc;les WinJS&lt;/h2&gt;
&lt;p&gt;En plus des contr&amp;ocirc;les HTML classiques, nous avons la possibilit&amp;eacute; d&amp;rsquo;utiliser des contr&amp;ocirc;les suppl&amp;eacute;mentaires, fournis par la &amp;laquo; Microsoft Windows Library for Javascript &amp;raquo;. Pour pouvoir les utiliser, il faut r&amp;eacute;f&amp;eacute;rencer les fichiers javascript et css de cette librairie :&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: maroon; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;link&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt; &lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: red; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;href&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;="//Microsoft.WinJS.0.6/css/ui-dark.css"&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt; &lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: red; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;rel&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;="stylesheet"&amp;gt;&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: maroon; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;script&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt; &lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: red; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;src&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;="//Microsoft.WinJS.0.6/js/base.js"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: maroon; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;script&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;&amp;gt;&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0cm 0cm 10pt;"&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;&amp;lt;&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: maroon; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;script&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt; &lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: red; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;src&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;="//Microsoft.WinJS.0.6/js/ui.js"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: maroon; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;script&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;&amp;gt;&lt;/span&gt;&lt;span style="mso-fareast-language: FR; mso-ansi-language: EN-US;" lang="EN-US"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;Nous pouvons maintenant utiliser les contr&amp;ocirc;les WinJS dans notre application. La liste des contr&amp;ocirc;les utilisable (liste compl&amp;egrave;te, incluant les contr&amp;ocirc;les HTML) peut &amp;ecirc;tre consult&amp;eacute;e sur msdn &amp;agrave; cette adresse : &lt;a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh465453.aspx"&gt;http://msdn.microsoft.com/en-us/library/windows/apps/hh465453.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Contrairement aux contr&amp;ocirc;les HTML que nous avons vu en premi&amp;egrave;re partie, ces contr&amp;ocirc;les WinJS n&amp;rsquo;ont pas de balise associ&amp;eacute;e. Pour les utiliser, nous allons les embarquer dans une balise &amp;lt;div&amp;gt;, que nous allons configurer &amp;agrave; l&amp;rsquo;aide des attributs &amp;laquo; data-win-control &amp;raquo; et &amp;laquo; data-win-options &amp;raquo;.&lt;/p&gt;
&lt;p&gt;Ensuite, il faut appeler la m&amp;eacute;thode Javascript WinJS.UI.processAll(); qui va ins&amp;eacute;rer les contr&amp;ocirc;les dans les &amp;eacute;l&amp;eacute;ments div. Cette m&amp;eacute;thode est d&amp;eacute;j&amp;agrave; appel&amp;eacute;e dans les templates par d&amp;eacute;faut de Visual Studio.&lt;/p&gt;
&lt;p&gt;Par exemple, pour utiliser le contr&amp;ocirc;le DatePicker (&lt;a href="http://msdn.microsoft.com/en-us/library/windows/apps/br211681.aspx"&gt;http://msdn.microsoft.com/en-us/library/windows/apps/br211681.aspx&lt;/a&gt;), nous allons &amp;eacute;crire :&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0cm 0cm 10pt;"&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;&amp;lt;&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: maroon; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;div&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt; &lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: red; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;id&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;="datePicker"&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt; &lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: red; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;data-win-control&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;="WinJS.UI.DatePicker"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: maroon; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;div&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;&amp;gt;&lt;/span&gt;&lt;span style="mso-fareast-language: FR; mso-ansi-language: EN-US;" lang="EN-US"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Ce qui nous donnera le r&amp;eacute;sultat suivant :&lt;/p&gt;
&lt;p&gt;&lt;img src="http://labs.bewise.fr/media/windows-live-writer/dveloppement_d705/image_8.png" alt="" width="338" height="148" /&gt;&lt;/p&gt;
&lt;p&gt;Pour d&amp;eacute;finir les propri&amp;eacute;t&amp;eacute;s du contr&amp;ocirc;le, on utilise data-win-options. On pourra par exemple d&amp;eacute;finir l&amp;rsquo;ann&amp;eacute;e minimale et maximale de notre contr&amp;ocirc;le :&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0cm 0cm 10pt;"&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;&amp;lt;&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: maroon; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;div&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt; &lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: red; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;id&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;="datePicker"&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt; &lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: red; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;data-win-control&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;="WinJS.UI.DatePicker"&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt; &lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: red; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;data-win-options&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;="{minYear : 2011 , maxYear : 2013}"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: maroon; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;div&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;&amp;gt;&lt;/span&gt;&lt;span style="mso-fareast-language: FR; mso-ansi-language: EN-US;" lang="EN-US"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://labs.bewise.fr/media/windows-live-writer/dveloppement_d705/image_10.png" alt="" width="333" height="134" /&gt;&lt;/p&gt;
&lt;p&gt;Pour acc&amp;eacute;der au contr&amp;ocirc;le par code (en Javascript), il faut r&amp;eacute;cup&amp;eacute;rer la propri&amp;eacute;t&amp;eacute; winControl de l&amp;rsquo;&amp;eacute;l&amp;eacute;ment conteneur :&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0cm 0cm 10pt;"&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: blue; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;var&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt; control = document.getElementById(&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: maroon; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;"datePicker"&lt;/span&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;).winControl;&lt;/span&gt;&lt;span style="mso-ansi-language: EN-US;" lang="EN-US"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;On peut ensuite lire ou modifier ses propri&amp;eacute;t&amp;eacute;s :&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;document.getElementById(&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: maroon; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;"divResult"&lt;/span&gt;&lt;span style="font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;).innerText = control.current;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0cm 0cm 10pt;"&gt;&lt;span style="line-height: 115%; font-family: Consolas; background: white; color: black; font-size: 9.5pt; mso-highlight: white; mso-ansi-language: EN-US;" lang="EN-US"&gt;control.maxYear = 2020;&lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Nous avons vu dans ce premier article un premier aper&amp;ccedil;u des contr&amp;ocirc;les Windows 8 ; rendez-vous dans quelques jours pour la suite, avec une vue d'ensemble du binding dans les applications metro javascript.&lt;/p&gt;</description><a10:updated>2012-04-16T10:35:57+02:00</a10:updated></item><item><guid isPermaLink="false">418</guid><link>http://labs.bewise.fr//Article/RadioButton-et-RadioButtonList-en-XAML</link><title>RadioButton et RadioButtonList en XAML</title><description>&lt;h1&gt;Probl&amp;eacute;matique&lt;/h1&gt;
&lt;p&gt;L'utilisation de RadioButton en XAML s'av&amp;egrave;re g&amp;eacute;n&amp;eacute;ralement tr&amp;egrave;s difficile : impossible de binder sur une source de donn&amp;eacute;e, impossible de savoir lequel est s&amp;eacute;lectionn&amp;eacute;. On en arrive &amp;agrave; faire ce genre de chose :&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;StackPanel&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;RadioButton&lt;/span&gt; &lt;span class="attr"&gt;Content&lt;/span&gt;&lt;span class="kwrd"&gt;="Option1"&lt;/span&gt; &lt;span class="attr"&gt;IsChecked&lt;/span&gt;&lt;span class="kwrd"&gt;="{Binding IsOption1Checked}"&lt;/span&gt; &lt;span class="attr"&gt;GroupName&lt;/span&gt;&lt;span class="kwrd"&gt;="MyGroup"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;RadioButton&lt;/span&gt; &lt;span class="attr"&gt;Content&lt;/span&gt;&lt;span class="kwrd"&gt;="Option2"&lt;/span&gt; &lt;span class="attr"&gt;IsChecked&lt;/span&gt;&lt;span class="kwrd"&gt;="{Binding IsOption2Checked}"&lt;/span&gt; &lt;span class="attr"&gt;GroupName&lt;/span&gt;&lt;span class="kwrd"&gt;="MyGroup"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;RadioButton&lt;/span&gt; &lt;span class="attr"&gt;Content&lt;/span&gt;&lt;span class="kwrd"&gt;="Option3"&lt;/span&gt; &lt;span class="attr"&gt;IsChecked&lt;/span&gt;&lt;span class="kwrd"&gt;="{Binding IsOption3Checked}"&lt;/span&gt; &lt;span class="attr"&gt;GroupName&lt;/span&gt;&lt;span class="kwrd"&gt;="MyGroup"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&lt;span class="html"&gt;&lt;span class="kwrd"&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;StackPanel&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Visuellement on obtient &amp;ccedil;a :&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/82b86a467961_D02B/image_2.png"&gt;&lt;img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" src="http://labs.bewise.fr/Media/Windows-Live-Writer/82b86a467961_D02B/image_thumb.png" border="0" alt="image" width="144" height="65" /&gt;&lt;/a&gt;&lt;/pre&gt;
&lt;!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --&gt;
&lt;p&gt;R&amp;eacute;sultat : une mise en place pompeuse, peu maintenable, beaucoup de code pour bien peu de chose (on imagine quand il y a 10 &amp;eacute;l&amp;eacute;ments.).&lt;/p&gt;
&lt;p&gt;Essayons de trouver une mani&amp;egrave;re plus simple de faire un &amp;laquo; RadioButtonList &amp;raquo;.&lt;/p&gt;
&lt;h1&gt;Concept fondamental&lt;/h1&gt;
&lt;p&gt;Rappelons qu'en XAML le comportement et l'apparence des contr&amp;ocirc;les sont dissoci&amp;eacute;s. D'un c&amp;ocirc;t&amp;eacute; on a le comportement qui est d&amp;eacute;fini au niveau du code:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Une CheckBox se coche et se d&amp;eacute;coche,&lt;/li&gt;
&lt;li&gt;Un Button est cliquable,&lt;/li&gt;
&lt;li&gt;Une ListBox pr&amp;eacute;sente un ensemble d'&amp;eacute;l&amp;eacute;ments s&amp;eacute;lectionnables.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;De l'autre c&amp;ocirc;t&amp;eacute;, l'apparence qui est d&amp;eacute;finie par le Template.&lt;/p&gt;
&lt;p&gt;Ainsi il est possible de cr&amp;eacute;er des boutons ayant toujours le comportement &amp;laquo; cliquable &amp;raquo; mais qui sont visuellement totalement diff&amp;eacute;rent. De la m&amp;ecirc;me fa&amp;ccedil;on, on peut cr&amp;eacute;er une ListBox compl&amp;egrave;tement diff&amp;eacute;rente de l'id&amp;eacute;e qu'on se fait d'une ListBox.&lt;/p&gt;
&lt;h1&gt;Une solution&lt;/h1&gt;
&lt;p&gt;Partant de ce concept si on cherche &amp;agrave; d&amp;eacute;finir le comportement d'une RadioButtonList, on pourrait le d&amp;eacute;crire ainsi :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;C'est un ensemble d'&amp;eacute;l&amp;eacute;ments dont un et un seul est s&amp;eacute;lectionnable.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Cot&amp;eacute; visuel chaque &amp;eacute;l&amp;eacute;ment &amp;agrave; l'apparence d'un RadioButton.&lt;/p&gt;
&lt;p&gt;Bref, le contr&amp;ocirc;le RadioButtonList existe : c'est une ListBox ! Il suffit d'en modifier l'apparence &amp;agrave; l'aide d'un ControlTemplate adapt&amp;eacute;. Pour faire de ce RadioButtonList un contr&amp;ocirc;le r&amp;eacute;utilisable, je vais cr&amp;eacute;er un CustomControl et d&amp;eacute;riv&amp;eacute; de ListBox.&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; RadioButtonList : ListBox
{
    &lt;span class="kwrd"&gt;static&lt;/span&gt; RadioButtonList()
    {
        DefaultStyleKeyProperty.OverrideMetadata(&lt;span class="kwrd"&gt;typeof&lt;/span&gt;(RadioButtonList), &lt;span class="kwrd"&gt;new&lt;/span&gt; FrameworkPropertyMetadata(&lt;span class="kwrd"&gt;typeof&lt;/span&gt;(RadioButtonList)));
    }
}&lt;/pre&gt;
&lt;!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --&gt;
&lt;p&gt;Pour le visuel, il me reste &amp;agrave; d&amp;eacute;finir le Style par d&amp;eacute;faut :&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Style&lt;/span&gt; &lt;span class="attr"&gt;TargetType&lt;/span&gt;&lt;span class="kwrd"&gt;="local:RadioButtonList"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Setter&lt;/span&gt; &lt;span class="attr"&gt;Property&lt;/span&gt;&lt;span class="kwrd"&gt;="Template"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Setter.Value&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ControlTemplate&lt;/span&gt; &lt;span class="attr"&gt;TargetType&lt;/span&gt;&lt;span class="kwrd"&gt;="local:RadioButtonList"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ItemsPresenter&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class="kwrd"&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="html"&gt;ControlTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&lt;span class="kwrd"&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="html"&gt;Setter.Value&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="html"&gt;Setter&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Setter&lt;/span&gt; &lt;span class="attr"&gt;Property&lt;/span&gt;&lt;span class="kwrd"&gt;="ItemContainerStyle"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Setter.Value&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Style&lt;/span&gt; &lt;span class="attr"&gt;TargetType&lt;/span&gt;&lt;span class="kwrd"&gt;="ListBoxItem"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Setter&lt;/span&gt; &lt;span class="attr"&gt;Property&lt;/span&gt;&lt;span class="kwrd"&gt;="Template"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Setter.Value&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ControlTemplate&lt;/span&gt; &lt;span class="attr"&gt;TargetType&lt;/span&gt;&lt;span class="kwrd"&gt;="ListBoxItem"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;RadioButton&lt;/span&gt; &lt;span class="attr"&gt;Content&lt;/span&gt;&lt;span class="kwrd"&gt;="{TemplateBinding Content}"&lt;/span&gt;
                                                   &lt;span class="attr"&gt;ContentTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;="{TemplateBinding ContentTemplate}"&lt;/span&gt;
                                                   &lt;span class="attr"&gt;Margin&lt;/span&gt;&lt;span class="kwrd"&gt;="{TemplateBinding Padding}"&lt;/span&gt;
                                                   &lt;span class="attr"&gt;IsChecked&lt;/span&gt;&lt;span class="kwrd"&gt;="{Binding IsSelected, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span class="kwrd"&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="html"&gt;ControlTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class="kwrd"&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="html"&gt;Setter.Value&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="kwrd"&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="html"&gt;Setter&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="kwrd"&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="html"&gt;Style&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="html"&gt;Setter.Value&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span class="html"&gt;Setter&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&lt;span class="html"&gt;&lt;span class="kwrd"&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;Style&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --&gt;
&lt;p&gt;Terminons par un exemple d'utilisation du RadioButtonList :&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;RadioButtonListSample:RadioButtonList&lt;/span&gt;
                           &lt;span class="attr"&gt;ItemsSource&lt;/span&gt;&lt;span class="kwrd"&gt;="{Binding Options}"&lt;/span&gt;
                           &lt;span class="attr"&gt;SelectedItem&lt;/span&gt;&lt;span class="kwrd"&gt;="{Binding SelectedOption, Mode=TwoWay}"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --&gt;
&lt;h1&gt;Conclusion&lt;/h1&gt;
&lt;p&gt;La s&amp;eacute;paration nette entre comportement et l'apparence vous permettra de r&amp;eacute;soudre plus simplement certains probl&amp;egrave;mes. En effet il existe en XAML un nombre important de contr&amp;ocirc;le de base dans lesquels vous pouvez piocher.&lt;/p&gt;</description><a10:updated>2012-04-05T15:21:13+02:00</a10:updated></item><item><guid isPermaLink="false">401</guid><link>http://labs.bewise.fr//Article/Indexer-les-sources-d-un-serveur-TFS</link><title>Indexer les sources d’un serveur TFS</title><description>&lt;p&gt;Le contr&amp;ocirc;leur de source de votre entreprise renferme certainement plein d'informations et d'exemples de code en tout genre. Mais comment l'exploiter ? Comment rechercher efficacement dans toutes ces lignes de code ?&lt;/p&gt;
&lt;p&gt;Team Foundation Server ne propose aucune solution native de recherche dans le contr&amp;ocirc;leur de source, mais plusieurs solutions customs existent. Toutes ces solutions reposent en g&amp;eacute;n&amp;eacute;ral sur le m&amp;ecirc;me principe : stocker les sources dans un magasin tiers, puis indexation du contenu.&lt;/p&gt;
&lt;h1&gt;Les diff&amp;eacute;rentes solutions&lt;/h1&gt;
&lt;p&gt;Donc concr&amp;egrave;tement, nous pouvons stocker les sources dans le syst&amp;egrave;me de fichiers d'un serveur puis activer les services de recherche de Windows. Une autre solution serait de les indexer avec un serveur SharePoint.&lt;/p&gt;
&lt;p&gt;Et enfin, une derni&amp;egrave;re solution consisterait &amp;agrave; stocker les sources dans une base de donn&amp;eacute;es et activer la recherche Full Text.&lt;/p&gt;
&lt;p&gt;Quelque soit la solution que l'on choisit il nous faudra bien &amp;eacute;videmment r&amp;eacute;cup&amp;eacute;rer les derni&amp;egrave;res versions des sources &amp;agrave; intervalle r&amp;eacute;gulier.&lt;/p&gt;
&lt;p&gt;Je vous propose de d&amp;eacute;couvrir comment mettre en place l'indexation des sources d'un serveur TFS gr&amp;acirc;ce &amp;agrave; SQL Server pour le stockage et la recherche Full Text et gr&amp;acirc;ce &amp;agrave; Team Build pour la r&amp;eacute;cup&amp;eacute;ration des sources &amp;agrave; intervalle r&amp;eacute;gulier.&lt;/p&gt;
&lt;h1&gt;La base de donn&amp;eacute;es SQL Server d'indexation des sources TFS&lt;/h1&gt;
&lt;p&gt;Comme je vous le disais, TFS ne propose aucune solution pour la recherche dans le contr&amp;ocirc;leur de source. La cr&amp;eacute;ation d'un index Full Text sur la base de donn&amp;eacute;es de TFS n'est tout simplement pas possible et non support&amp;eacute;e. Nous allons donc cr&amp;eacute;er une base de donn&amp;eacute;es SQL Server afin d'y stocker un duplicat des derni&amp;egrave;res versions des sources. Cette base de donn&amp;eacute;es contient une seule table que voici :&lt;/p&gt;
&lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/Indexer-ses_C899/image_2.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://labs.bewise.fr/Media/Windows-Live-Writer/Indexer-ses_C899/image_thumb.png" border="0" alt="image" width="370" height="199" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Cette table poss&amp;egrave;de :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;une cl&amp;eacute; primaire : indispensable &amp;agrave; la cr&amp;eacute;ation d'un index Full Text &lt;/li&gt;
&lt;li&gt;une colonne Content : destin&amp;eacute;e &amp;agrave; stocker le contenu du fichier &lt;/li&gt;
&lt;li&gt;l'extension : correspond au type de contenu &amp;agrave; indexer, indispensable &amp;agrave; la cr&amp;eacute;ation d'un index Full Text &lt;/li&gt;
&lt;li&gt;CheckinDate : correspond &amp;agrave; la derni&amp;egrave;re date d'archivage du fichier dans TFS &lt;/li&gt;
&lt;li&gt;ServerItemId : identifiant de l'&amp;eacute;l&amp;eacute;ment dans la base SQL de TFS &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Une fois cette table cr&amp;eacute;&amp;eacute;e, il nous faut cr&amp;eacute;er l'index Full Text comme suit :&lt;/p&gt;
&lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/Indexer-ses_C899/image_4.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://labs.bewise.fr/Media/Windows-Live-Writer/Indexer-ses_C899/image_thumb_1.png" border="0" alt="image" width="491" height="424" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;La custom activit&amp;eacute; de r&amp;eacute;cup&amp;eacute;ration des sources&lt;/h1&gt;
&lt;p&gt;Maintenant que l'index Full Text et le catalogue sont cr&amp;eacute;&amp;eacute;s il nous faut d&amp;eacute;velopper une routine qui va r&amp;eacute;cup&amp;eacute;rer &amp;agrave; intervalle r&amp;eacute;gulier les derni&amp;egrave;res versions des sources de TFS et les stocker dans notre base de donn&amp;eacute;es. Pour cela nous allons nous appuyer sur Team Build.&lt;/p&gt;
&lt;p&gt;Tout d'abord, nous devons d&amp;eacute;velopper une custom activit&amp;eacute; de Workflow. Depuis Visual Studio nous cr&amp;eacute;ons donc un projet Workflow Foundation de type librairie d'activit&amp;eacute;s.&lt;/p&gt;
&lt;p&gt;Dans ce projet nous avons besoin :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;des r&amp;eacute;f&amp;eacute;rences vers les API TFS qui nous permettrons de nous connecter au serveur et de r&amp;eacute;cup&amp;eacute;rer les sources (Microsoft.TeamFoundation.Client, Microsoft.TeamFoundation.Build.Client, Microsoft.TeamFoundation.VersionControl.Client) &lt;/li&gt;
&lt;li&gt;d'un mod&amp;egrave;le Entity Framework pour se brancher sur notre base de donn&amp;eacute;es &lt;/li&gt;
&lt;li&gt;d'une classe SourceCodeImporter contenant la logique de r&amp;eacute;cup&amp;eacute;ration des sources de TFS &lt;/li&gt;
&lt;li&gt;d'une activit&amp;eacute; WF de type CodeActivity afin de brancher notre syst&amp;egrave;me d'importation dans le processus de build &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Voici &amp;agrave; quoi ressemble le projet :&lt;/p&gt;
&lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/Indexer-ses_C899/image_6.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://labs.bewise.fr/Media/Windows-Live-Writer/Indexer-ses_C899/image_thumb_2.png" border="0" alt="image" width="380" height="449" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Le mod&amp;egrave;le Entity Framework&lt;/h2&gt;
&lt;p&gt;Pour le mod&amp;egrave;le Entity Framework, rien de sp&amp;eacute;cial, il contient la table TfsFile que nous avons cr&amp;eacute;er auparavant :&lt;/p&gt;
&lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/Indexer-ses_C899/image_8.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://labs.bewise.fr/Media/Windows-Live-Writer/Indexer-ses_C899/image_thumb_3.png" border="0" alt="image" width="280" height="323" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;L'activit&amp;eacute; ProcessFilesActivity&lt;/h2&gt;
&lt;p&gt;L'activit&amp;eacute; ProcessFilesActivity se pr&amp;eacute;sente comme suit :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;l'attribut BuildActivity avec le param&amp;egrave;tre HostEnvironmentOption.All qui permet d'indiquer &amp;agrave; Team Build dans quel contexte s'ex&amp;eacute;cute cette activit&amp;eacute; (Controlleur, Agent ou les 2) &lt;/li&gt;
&lt;li&gt;2 arguments en entr&amp;eacute;e permettant de d&amp;eacute;finir le r&amp;eacute;pertoire de travail et l'URI de la collection de Team Project &amp;agrave; traiter &lt;/li&gt;
&lt;li&gt;l'impl&amp;eacute;mentation de la m&amp;eacute;thode Start &lt;/li&gt;
&lt;/ul&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;[BuildActivity(HostEnvironmentOption.All)]&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;sealed&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; ProcessFilesActivity : CodeActivity&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;{&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    [Browsable(&lt;span class="kwrd"&gt;true&lt;/span&gt;)]&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;    [RequiredArgument()]&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; InArgument&amp;lt;&lt;span class="kwrd"&gt;string&lt;/span&gt;&amp;gt; TempDirectory { get; set; }&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;    [Browsable(&lt;span class="kwrd"&gt;true&lt;/span&gt;)]&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    [RequiredArgument()]&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; InArgument&amp;lt;&lt;span class="kwrd"&gt;string&lt;/span&gt;&amp;gt; CollectionUri { get; set; }&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;    &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Execute(CodeActivityContext context)&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;    {&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;        var tempDirectory = context.GetValue(&lt;span class="kwrd"&gt;this&lt;/span&gt;.TempDirectory);&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;        var collectionUri = context.GetValue(&lt;span class="kwrd"&gt;this&lt;/span&gt;.CollectionUri);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;        SourceCodeImporter importer = &lt;span class="kwrd"&gt;new&lt;/span&gt; SourceCodeImporter(&lt;span class="kwrd"&gt;new&lt;/span&gt; Uri(collectionUri), tempDirectory);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;        importer.Start();&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;    }&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --&gt;
&lt;h2&gt;La classe SourceCodeImporter&lt;/h2&gt;
&lt;p&gt;Il ne reste plus qu'&amp;agrave; d&amp;eacute;velopper la classe SourceCodeImporter et sa logique de r&amp;eacute;cup&amp;eacute;ration et de stockages des sources.&lt;/p&gt;
&lt;p&gt;Dans un premier temps au niveau du constructeur on initialise :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;le r&amp;eacute;pertoire de travail, &lt;/li&gt;
&lt;li&gt;la collection TFS qui nous servira &amp;agrave; r&amp;eacute;cup&amp;eacute;rer le service de gestion du contr&amp;ocirc;leur de sources &lt;/li&gt;
&lt;li&gt;le contexte Entity Framework &lt;/li&gt;
&lt;/ul&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; SourceCodeImporter(Uri collectionUri, &lt;span class="kwrd"&gt;string&lt;/span&gt; tempDirectory)&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    _collection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(collectionUri);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    _server = (VersionControlServer)_collection.GetService(&lt;span class="kwrd"&gt;typeof&lt;/span&gt;(VersionControlServer));&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;    _tempDirectory = tempDirectory;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;    _ctx = &lt;span class="kwrd"&gt;new&lt;/span&gt; TfsAnalyzerEntities(_connectionString);&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --&gt;&lt;/p&gt;
&lt;p&gt;On peut &amp;eacute;galement d&amp;eacute;finir une constante contenant la liste des extensions de fichiers que l'on d&amp;eacute;sire indexer :&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;readonly&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt;[] _extensions = &lt;span class="kwrd"&gt;new&lt;/span&gt;[] { &lt;span class="str"&gt;".xaml"&lt;/span&gt;, &lt;span class="str"&gt;".cs"&lt;/span&gt;, &lt;span class="str"&gt;".vb"&lt;/span&gt;, &lt;span class="str"&gt;".csproj"&lt;/span&gt;, &lt;span class="str"&gt;".aspx"&lt;/span&gt;, &lt;span class="str"&gt;".ascx"&lt;/span&gt;, &lt;span class="str"&gt;".vbproj"&lt;/span&gt; };&lt;/pre&gt;
&lt;/div&gt;
&lt;!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --&gt;
&lt;p&gt;Maintenant, la logique de r&amp;eacute;cup&amp;eacute;ration et de stockage des sources. Il nous faut :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;parcourir tous les fichiers du source control, &lt;/li&gt;
&lt;li&gt;si l'extension du fichier correspond &amp;agrave; une extension contenu dans _extensions, t&amp;eacute;l&amp;eacute;charger le fichier dans le r&amp;eacute;pertoire de travail &lt;/li&gt;
&lt;li&gt;Ajouter ou mettre &amp;agrave; jour le fichier dans notre base de donn&amp;eacute;es SQL &lt;/li&gt;
&lt;li&gt;supprimer le fichier du r&amp;eacute;pertoire de travail &lt;/li&gt;
&lt;/ul&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Start()&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    &lt;span class="rem"&gt;// Get all last version files&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    var files = _server.GetItems(&lt;span class="str"&gt;"$/"&lt;/span&gt;, VersionSpec.Latest, RecursionType.Full,&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;                                              DeletedState.NonDeleted, ItemType.File, &lt;span class="kwrd"&gt;false&lt;/span&gt;);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (var item &lt;span class="kwrd"&gt;in&lt;/span&gt; files.Items)&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;    {&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;        var serverItem = item.ServerItem;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;        var projFile = Path.Combine(_tempDirectory, Path.GetFileName(serverItem));&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;        &lt;span class="kwrd"&gt;if&lt;/span&gt; (!_csExtensions.Contains(Path.GetExtension(serverItem)))&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;            &lt;span class="kwrd"&gt;continue&lt;/span&gt;;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;        &lt;span class="rem"&gt;// Retrieve file in search index db&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;        var file = _ctx.TfsFiles.Where(f =&amp;gt; f.ServerItemId == item.ItemId).SingleOrDefault();&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;        &lt;span class="rem"&gt;// Update or Create file in search index db&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;        item.DownloadFile(projFile);&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;        InsertCodeFile(projFile, serverItem, item.CheckinDate, item.ItemId, file);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;        File.Delete(projFile);&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;    }&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --&gt;&lt;/p&gt;
&lt;p&gt;Et le code de la m&amp;eacute;thode InsertCodeFile qui ins&amp;egrave;re ou met &amp;agrave; jour le fichier :&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; InsertCodeFile(&lt;span class="kwrd"&gt;string&lt;/span&gt; file, &lt;span class="kwrd"&gt;string&lt;/span&gt; serverPath, DateTime checkinDate, &lt;span class="kwrd"&gt;int&lt;/span&gt; serverItemId, TfsFile tfsFile)&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (tfsFile != &lt;span class="kwrd"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    {&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;        tfsFile.Content = File.ReadAllBytes(file);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;        tfsFile.CheckinDate = checkinDate;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    }&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;    &lt;span class="kwrd"&gt;else&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    {&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;        _ctx.TfsFiles.AddObject(&lt;span class="kwrd"&gt;new&lt;/span&gt; TfsFile&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;                                    {&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;                                        Content = File.ReadAllBytes(file),&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;                                        FileName = Path.GetFileName(file),&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;                                        Extension = &lt;span class="str"&gt;".cs"&lt;/span&gt;,&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;                                        FileId = Guid.NewGuid(),&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;                                        ServerItemId = serverItemId,&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;                                        CheckinDate = checkinDate&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;                                    });&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;    }&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;    _ctx.SaveChanges();&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --&gt;&lt;/p&gt;
&lt;h1&gt;D&amp;eacute;ploiement de l'assembly de l'activit&amp;eacute; custom&lt;/h1&gt;
&lt;p&gt;Il nous faut maintenant compiler et d&amp;eacute;ployer notre assembly afin de l'utiliser dans un mod&amp;egrave;le de Build.&lt;/p&gt;
&lt;p&gt;Le d&amp;eacute;ploiement de l'assembly consiste &amp;agrave; le stocker dans le source control de TFS. Puis, dans la console d'administration de TFS, au niveau des param&amp;eacute;tres du contr&amp;ocirc;leur de Build, configurer le champ "fVersion Control path to custom assemblies" :&lt;/p&gt;
&lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/Indexer-ses_C899/image_10.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" src="http://labs.bewise.fr/Media/Windows-Live-Writer/Indexer-ses_C899/image_thumb_4.png" border="0" alt="image" width="472" height="488" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;D&amp;eacute;finition du template de build&lt;/h1&gt;
&lt;p&gt;Une fois notre activit&amp;eacute; custom d&amp;eacute;ploy&amp;eacute;e, il nous faut d&amp;eacute;finir un template de build avec notre activit&amp;eacute;. Le process est extr&amp;ecirc;mement simple puisqu'il ne contient qu'une activit&amp;eacute; :&lt;/p&gt;
&lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/Indexer-ses_C899/image23.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" src="http://labs.bewise.fr/Media/Windows-Live-Writer/Indexer-ses_C899/image23_thumb.png" border="0" alt="image" width="335" height="233" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Il nous faut ajouter 2 arguments au process de Build qui nous permettent de d&amp;eacute;finir les 2 param&amp;egrave;tres d'entr&amp;eacute;e de l'activit&amp;eacute; ProcessFilesActivity :&lt;/p&gt;
&lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/Indexer-ses_C899/image_14.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://labs.bewise.fr/Media/Windows-Live-Writer/Indexer-ses_C899/image_thumb_6.png" border="0" alt="image" width="897" height="119" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Une fois ces arguments cr&amp;eacute;&amp;eacute;s, il faut les passer &amp;agrave; l'activit&amp;eacute;. Depuis les propri&amp;eacute;t&amp;eacute;s de l'activit&amp;eacute; :&lt;/p&gt;
&lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/Indexer-ses_C899/image31.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" src="http://labs.bewise.fr/Media/Windows-Live-Writer/Indexer-ses_C899/image31_thumb.png" border="0" alt="image" width="470" height="161" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;D&amp;eacute;finition de la Build&lt;/h1&gt;
&lt;p&gt;Notre template de Build est termin&amp;eacute; et notre base de donn&amp;eacute;es est pr&amp;ecirc;te.&lt;/p&gt;
&lt;p&gt;La derni&amp;egrave;re &amp;eacute;tape consiste &amp;agrave; d&amp;eacute;finir une Build qui s'ex&amp;eacute;cutera par exemple chaque nuit. Depuis Visual Studio, ouvrir Team Explorer puis cr&amp;eacute;er une nouvelle d&amp;eacute;finition de build.&lt;/p&gt;
&lt;p&gt;Dans la section Trigger, nous planifions l'ex&amp;eacute;cution de notre build chaque nuit :&lt;/p&gt;
&lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/Indexer-ses_C899/image_18.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" src="http://labs.bewise.fr/Media/Windows-Live-Writer/Indexer-ses_C899/image_thumb_8.png" border="0" alt="image" width="715" height="332" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Dans la section Process, il faut s&amp;eacute;lectionner le template que nous venons de cr&amp;eacute;er et d&amp;eacute;finir les 2 param&amp;egrave;tres d'entr&amp;eacute;e :&lt;/p&gt;
&lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/Indexer-ses_C899/image_20.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" src="http://labs.bewise.fr/Media/Windows-Live-Writer/Indexer-ses_C899/image_thumb_9.png" border="0" alt="image" width="676" height="287" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;La d&amp;eacute;finition de la Build est termin&amp;eacute;e. Pour v&amp;eacute;rifier que tout fonctionne bien nous pouvons d&amp;eacute;clencher manuellement la build et v&amp;eacute;rifier le r&amp;eacute;sultat :&lt;/p&gt;
&lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/Indexer-ses_C899/image_22.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" src="http://labs.bewise.fr/Media/Windows-Live-Writer/Indexer-ses_C899/image_thumb_10.png" border="0" alt="image" width="543" height="265" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;Exemple de recherche dans les sources&lt;/h1&gt;
&lt;p&gt;Maintenant que nos sources sont index&amp;eacute;es, nous pouvons effectuer des recherches Full Text dans notre base de donn&amp;eacute;es. L'exemple ci-dessous recherche tous les fichiers de code C# qui contiennent une impl&amp;eacute;mentation de l'interface IValueConverter :&lt;/p&gt;
&lt;p&gt;select * from TfsFile where FileName like '%.cs' AND FREETEXT([Content], ':IValueConverter')&lt;/p&gt;
&lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/Indexer-ses_C899/image_24.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" src="http://labs.bewise.fr/Media/Windows-Live-Writer/Indexer-ses_C899/image_thumb_11.png" border="0" alt="image" width="561" height="375" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;Conclusion&lt;/h1&gt;
&lt;p&gt;Peu importe la solution que nous mettons en oeuvre. Ce qu'il faut garder en t&amp;ecirc;te c'est que nos contr&amp;ocirc;leurs de source contiennent une multitude d'exemples de code et m&amp;ecirc;me de codes pr&amp;ecirc;ts &amp;agrave; &amp;ecirc;tre r&amp;eacute;utilis&amp;eacute;s. Mais encore faut-il pour cela pouvoir les exploiter facilement!&lt;/p&gt;</description><a10:updated>2011-12-23T11:08:17+01:00</a10:updated></item><item><guid isPermaLink="false">382</guid><link>http://labs.bewise.fr//Article/L-asynchronisme-avec-Async-CTP</link><title>L’asynchronisme avec Async CTP</title><description>&lt;h1&gt;Async CTP&lt;/h1&gt;
&lt;p&gt;A moins d'un an de la sortie de Visual Studio VNext, je vous propose de d&amp;eacute;couvrir le nouveau mod&amp;egrave;le d'asynchronisme qui sera disponible avec le Framework .Net 4.5 ainsi que WinRT.&lt;/p&gt;
&lt;p&gt;L'Async CTP propose une nouvelle fonctionnalit&amp;eacute; aux langages C# et VB.net, qui permet d'&amp;eacute;crire du code asynchrone d'une mani&amp;egrave;re diff&amp;eacute;rente.&lt;/p&gt;
&lt;p&gt;Afin de l'utiliser, vous devez avoir Visual Studio 2010 avec le SP1, et t&amp;eacute;l&amp;eacute;charger l'installeur &amp;agrave; l'adresse suivante : &lt;a href="http://www.microsoft.com/download/en/details.aspx?id=9983"&gt;http://www.microsoft.com/download/en/details.aspx?id=9983&lt;/a&gt;. Une fois install&amp;eacute;, vous trouverez les librairies ainsi que des exemples de code dans le dossier "Microsoft Visual Studio Async CTP", situ&amp;eacute; dans "Mes Documents".&lt;/p&gt;
&lt;p&gt;Vous pouvez utiliser Async CTP dans n'importe quelle application bas&amp;eacute;e sur le framework .net 4.0, Silverlight ou Windows Phone. Comme son nom l'indique, ceci est une CTP (Community Technology Preview), et m&amp;ecirc;me si la licence autorise son utilisation en production, c'est vivement d&amp;eacute;conseill&amp;eacute;, et non support&amp;eacute; par Microsoft. La version finale&amp;nbsp;sera int&amp;eacute;gr&amp;eacute;e dans le framework .net 4.5.&lt;/p&gt;
&lt;h2&gt;Pourquoi l'asynchronisme ?&lt;/h2&gt;
&lt;p&gt;L'asynchronisme consiste &amp;agrave; avoir plusieurs t&amp;acirc;ches qui s'ex&amp;eacute;cutent en m&amp;ecirc;me temps, dans des threads diff&amp;eacute;rents. Le premier gain &amp;eacute;vident &amp;agrave; faire de la programmation asynchrone est bien s&amp;ucirc;r le gain de performance, surtout avec les ordinateurs actuels qui ont de plus en plus souvent des processeurs multi-coeurs : la cr&amp;eacute;ation de plusieurs threads permets de tous les utiliser. Il est aussi important pour l'utilisateur de ne pas bloquer l'interface : en effet, lorsqu'on fait des calculs lourds dans le m&amp;ecirc;me thread que celui qui g&amp;egrave;re l'interface utilisateur, l'application sera fig&amp;eacute;e tant que les calculs ne seront pas termin&amp;eacute;s.&lt;/p&gt;
&lt;h1&gt;L'asynchronisme en .net&lt;/h1&gt;
&lt;p&gt;Le framework .net fournit d&amp;eacute;j&amp;agrave; les outils n&amp;eacute;cessaires pour faire de l'asynchronisme. Vous pouvez sans probl&amp;egrave;me cr&amp;eacute;er des threads pour effectuer de longs calculs, ou utiliser le &lt;em&gt;ThreadPool&lt;/em&gt; (un ensemble de threads d&amp;eacute;j&amp;agrave; cr&amp;eacute;&amp;eacute;s, pr&amp;ecirc;ts &amp;agrave; &amp;ecirc;tre utilis&amp;eacute;s), de la mani&amp;egrave;re suivante :&lt;/p&gt;
&lt;div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;"&gt;
&lt;pre id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #0000ff;"&gt;void&lt;/span&gt; LongWork(&lt;span style="color: #0000ff;"&gt;object&lt;/span&gt; o)&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: #008000;"&gt;// Ici on aura nos calculs qui peuvent prendre du temps&lt;/span&gt;&lt;br /&gt;    Thread.Sleep(2000);&lt;br /&gt;}&lt;br /&gt;&lt;span style="color: #0000ff;"&gt;void&lt;/span&gt; button_Click(&lt;span style="color: #0000ff;"&gt;object&lt;/span&gt; sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;    ThreadPool.QueueUserWorkItem(LongWork);&lt;br /&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Une fois les calculs termin&amp;eacute;s, si on veut r&amp;eacute;cup&amp;eacute;rer le r&amp;eacute;sultat et l'afficher &amp;agrave; l'utilisateur, nous allons avoir besoin d'ajouter un &amp;eacute;v&amp;egrave;nement (ce n'est pas n&amp;eacute;cessaire dans cet exemple, puisqu'on reste dans la m&amp;ecirc;me classe, mais &amp;ccedil;a peut &amp;ecirc;tre utile pour des cas plus compliqu&amp;eacute;s), de s'y abonner pour &amp;ecirc;tre notifi&amp;eacute; de la fin des calculs, et de mettre &amp;agrave; jour l'interface utilisateur.&lt;/p&gt;
&lt;p&gt;De plus, les contr&amp;ocirc;les ne sont pas &lt;em&gt;thread-safe&lt;/em&gt; : vous ne pouvez pas les modifier depuis un autre thread que celui dans lequel ils ont &amp;eacute;t&amp;eacute; cr&amp;eacute;&amp;eacute;s. Si vous voulez mettre &amp;agrave; jour l'affichage, il faudra utiliser la m&amp;eacute;thode &lt;strong&gt;Invoke&lt;/strong&gt; des contr&amp;ocirc;les pour que la mise &amp;agrave; jour soit faite dans le thread de l'UI :&lt;/p&gt;
&lt;div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;"&gt;
&lt;pre id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #0000ff;"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;event&lt;/span&gt; EventHandler WorkFinished;&lt;br /&gt;&lt;span style="color: #0000ff;"&gt;void&lt;/span&gt; LongWork(&lt;span style="color: #0000ff;"&gt;object&lt;/span&gt; o)&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: #008000;"&gt;// Ici on aura nos calculs qui peuvent prendre du temps&lt;/span&gt;&lt;br /&gt;    Thread.Sleep(2000);&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #0000ff;"&gt;if&lt;/span&gt; (WorkFinished != &lt;span style="color: #0000ff;"&gt;null&lt;/span&gt;)&lt;br /&gt;        WorkFinished(&lt;span style="color: #0000ff;"&gt;this&lt;/span&gt;, &lt;span style="color: #0000ff;"&gt;new&lt;/span&gt; LongWorkEventArgs { Result = &lt;span style="color: #006080;"&gt;"r&amp;eacute;sultat"&lt;/span&gt; });&lt;br /&gt;}&lt;br /&gt;&lt;span style="color: #0000ff;"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;void&lt;/span&gt; button_Click(&lt;span style="color: #0000ff;"&gt;object&lt;/span&gt; sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;    WorkFinished += &lt;span style="color: #0000ff;"&gt;new&lt;/span&gt; EventHandler(MainWindow_WorkFinished);&lt;br /&gt;    ThreadPool.QueueUserWorkItem(LongWork);&lt;br /&gt;}&lt;br /&gt;&lt;span style="color: #0000ff;"&gt;void&lt;/span&gt; MainWindow_WorkFinished(&lt;span style="color: #0000ff;"&gt;object&lt;/span&gt; sender, LongWorkEventArgs e)&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: #0000ff;"&gt;this&lt;/span&gt;.Invoke(&lt;span style="color: #0000ff;"&gt;new&lt;/span&gt; Action(() =&amp;gt;&lt;br /&gt;    {&lt;br /&gt;        logTextbox.Text = e.Result;&lt;br /&gt;    }));&lt;br /&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Ceci est un exemple en Winform, pour effectuer la m&amp;ecirc;me chose en WPF, nous avons un objet &lt;strong&gt;Dispatcher&lt;/strong&gt; :&lt;/p&gt;
&lt;div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;"&gt;
&lt;pre id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #0000ff;"&gt;void&lt;/span&gt; MainWindow_WorkFinished(&lt;span style="color: #0000ff;"&gt;object&lt;/span&gt; sender, LongWorkEventArgs e)&lt;br /&gt;{&lt;br /&gt;    Dispatcher.BeginInvoke(&lt;span style="color: #0000ff;"&gt;new&lt;/span&gt; Action(() =&amp;gt;&lt;br /&gt;                               {&lt;br /&gt;                                   logTextbox.Text = e.Result;&lt;br /&gt;                               }));&lt;br /&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;On peut utiliser par exemple un &lt;strong&gt;WebClient&lt;/strong&gt; de cette mani&amp;egrave;re pour t&amp;eacute;l&amp;eacute;charger de mani&amp;egrave;re asynchrone une page web :&lt;/p&gt;
&lt;div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;"&gt;
&lt;pre id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #0000ff;"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;void&lt;/span&gt; Button_Click(&lt;span style="color: #0000ff;"&gt;object&lt;/span&gt; sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;    WebClient client = &lt;span style="color: #0000ff;"&gt;new&lt;/span&gt; WebClient();&lt;br /&gt;    client.DownloadStringCompleted += &lt;span style="color: #0000ff;"&gt;new&lt;/span&gt; DownloadStringCompletedEventHandler(client_DownloadStringCompleted);&lt;br /&gt;    client.DownloadStringAsync(&lt;span style="color: #0000ff;"&gt;new&lt;/span&gt; Uri(&lt;span style="color: #006080;"&gt;"http://www.bewise.fr"&lt;/span&gt;));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff;"&gt;void&lt;/span&gt; client_DownloadStringCompleted(&lt;span style="color: #0000ff;"&gt;object&lt;/span&gt; sender, DownloadStringCompletedEventArgs e)&lt;br /&gt;{&lt;br /&gt;    logTextbox.Text = e.Result;&lt;br /&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Ici nous avons une diff&amp;eacute;rence avec l'exemple pr&amp;eacute;c&amp;eacute;dent, puisque c'est le &lt;strong&gt;WebClient&lt;/strong&gt; qui va automatiquement se remettre dans le thread appelant avant d'appeler l'&amp;eacute;v&amp;egrave;nement &lt;strong&gt;DownloadStringCompleted&lt;/strong&gt;. Hormis cette subtilit&amp;eacute;, l'usage est le m&amp;ecirc;me.&lt;/p&gt;
&lt;h1&gt;Appels asynchrones avec Async CTP&lt;/h1&gt;
&lt;p&gt;Async CTP nous propose une nouvelle fa&amp;ccedil;on de faire des appels asynchrones. Si le principe est le m&amp;ecirc;me (utilisation d'un autre thread, r&amp;eacute;cup&amp;eacute;ration de la r&amp;eacute;ponse lorsque le travail est termin&amp;eacute;), nous avons maintenant une nouvelle syntaxe.&lt;/p&gt;
&lt;p&gt;Prenons un exemple avec le WebClient. Avant de commencer, il faut r&amp;eacute;f&amp;eacute;rencer la librairie "AsyncCtpLibrary", qui doit se trouver si vous n'avez pas chang&amp;eacute; le r&amp;eacute;pertoire d'installation dans votre dosser Documents, sous le chemin : "\Microsoft Visual Studio Async CTP\Samples\AsyncCtpLibrary.dll".&lt;/p&gt;
&lt;p&gt;Une fois r&amp;eacute;f&amp;eacute;renc&amp;eacute;, des m&amp;eacute;thodes d'extensions se sont ajout&amp;eacute;es &amp;agrave; la classe &lt;strong&gt;WebClient&lt;/strong&gt;, et on peut utiliser les nouveaux mots cl&amp;eacute;s "&lt;strong&gt;async&lt;/strong&gt;" et "&lt;strong&gt;await&lt;/strong&gt;" pour faire notre appel asynchrone :&lt;/p&gt;
&lt;div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;"&gt;
&lt;pre id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #0000ff;"&gt;private&lt;/span&gt; async &lt;span style="color: #0000ff;"&gt;void&lt;/span&gt; Button_Click(&lt;span style="color: #0000ff;"&gt;object&lt;/span&gt; sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;    WebClient client = &lt;span style="color: #0000ff;"&gt;new&lt;/span&gt; WebClient();&lt;br /&gt;    String result = await client.DownloadStringTaskAsync(&lt;span style="color: #0000ff;"&gt;new&lt;/span&gt; Uri(&lt;span style="color: #006080;"&gt;"http://www.bewise.fr"&lt;/span&gt;));&lt;br /&gt;    logTextbox.Text = result;&lt;br /&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Comme vous pouvez le voir, le code est beaucoup plus simple qu'avant : on a l'impression d'&amp;eacute;crire du code synchrone. Et pourtant, c'est bien asynchrone, l'interface ne sera pas bloqu&amp;eacute;e pendant le temps de t&amp;eacute;l&amp;eacute;chargement. C'est le compilateur qui va s'occuper de cr&amp;eacute;er un thread, et de revenir dans le thread courant une fois la t&amp;acirc;che termin&amp;eacute;e.&lt;/p&gt;
&lt;p&gt;Pour faire &amp;ccedil;a, nous avons donc du modifier notre code :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Utiliser une nouvelle m&amp;eacute;thode de notre WebClient : &lt;strong&gt;DownloadStringTaskAsync()&lt;/strong&gt;. On sait que cette m&amp;eacute;thode est asynchrone car elle renvoie un objet de type &lt;strong&gt;Task&lt;/strong&gt;, au lieu d'un &lt;strong&gt;String&lt;/strong&gt;. &lt;/li&gt;
&lt;li&gt;Le mot cl&amp;eacute; "&lt;strong&gt;await&lt;/strong&gt;" permets de faire l'appel asynchrone. Elle permets d'ex&amp;eacute;cuter la t&amp;acirc;che dans un nouveau thread, et un callback sera fait automatiquement lorsque la t&amp;acirc;che sera termin&amp;eacute;e pour ex&amp;eacute;cuter le reste du code de la m&amp;eacute;thode. &lt;/li&gt;
&lt;li&gt;La m&amp;eacute;thode est marqu&amp;eacute;e avec le mot cl&amp;eacute; "&lt;strong&gt;async&lt;/strong&gt;", pour notifier au compilateur qu'il va devoir transformer une partie de la m&amp;eacute;thode en callback. &lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Usages avanc&amp;eacute;s&lt;/h1&gt;
&lt;h2&gt;Cr&amp;eacute;er ses propres t&amp;acirc;ches&lt;/h2&gt;
&lt;p&gt;Async CTP fournit une liste de m&amp;eacute;thodes d'extensions sur divers objets du framework, comme sur notre WebClient, mais nous n'avons pas encore vu comment effectuer nos propres t&amp;acirc;ches asynchrones.&lt;/p&gt;
&lt;p&gt;Pour pouvoir cr&amp;eacute;er une t&amp;acirc;che, nous allons utiliser les m&amp;eacute;thodes fournies dans la classe &lt;strong&gt;TaskEx&lt;/strong&gt; :&lt;/p&gt;
&lt;div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;"&gt;
&lt;pre id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #0000ff;"&gt;private&lt;/span&gt; Task&amp;lt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt;&amp;gt; WaitNSecondsAsync(&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; n)&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: #0000ff;"&gt;return&lt;/span&gt; TaskEx.Run&amp;lt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt;&amp;gt;(() =&amp;gt;&lt;br /&gt;                   {&lt;br /&gt;                       Thread.Sleep(TimeSpan.FromSeconds(n));&lt;br /&gt;                       &lt;span style="color: #0000ff;"&gt;return&lt;/span&gt; n;&lt;br /&gt;                   });&lt;br /&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;La m&amp;eacute;thode &lt;strong&gt;TaskEx.Run()&lt;/strong&gt; renvoie une t&amp;acirc;che, qui va ex&amp;eacute;cuter notre code de mani&amp;egrave;re asynchrone. Par convention, nous avons nomm&amp;eacute; la m&amp;eacute;thode qui retourne cette t&amp;acirc;che avec le suffixe &lt;em&gt;Async&lt;/em&gt;.&lt;/p&gt;
&lt;h2&gt;Synchronisation de plusieurs threads&lt;/h2&gt;
&lt;p&gt;Nous avons vu l'usage de base qui consiste &amp;agrave; utiliser le mot cl&amp;eacute; await pour attendre qu'une t&amp;acirc;che se termine, mais nous avons la possibilit&amp;eacute; de travailler avec plusieurs t&amp;acirc;ches &amp;agrave; la fois gr&amp;acirc;ce &amp;agrave; deux m&amp;eacute;thodes de TaskEx : &lt;strong&gt;TaskEx.WhenAny&lt;/strong&gt; et &lt;strong&gt;TaskEx.WhenAll&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;TaskEx.WhenAny()&lt;/strong&gt; prends en param&amp;egrave;tre une liste de t&amp;acirc;ches (&lt;strong&gt;IEnumerable&lt;/strong&gt; ou une liste de param&amp;egrave;tres &lt;strong&gt;Task&lt;/strong&gt;), et retourne une t&amp;acirc;che qui se termine lorsqu'une des t&amp;acirc;ches pass&amp;eacute;e en param&amp;egrave;tre se termine. Son r&amp;eacute;sultat est la t&amp;acirc;che qui s'est termin&amp;eacute;e.&lt;/p&gt;
&lt;div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;"&gt;
&lt;pre id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #0000ff;"&gt;private&lt;/span&gt; async &lt;span style="color: #0000ff;"&gt;void&lt;/span&gt; Button_Click(&lt;span style="color: #0000ff;"&gt;object&lt;/span&gt; sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;    Task&amp;lt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt;&amp;gt; t1 = WaitNSecondsAsync(5);&lt;br /&gt;    Task&amp;lt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt;&amp;gt; t2 = WaitNSecondsAsync(7);&lt;br /&gt;    Task&amp;lt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt;&amp;gt; t3 = WaitNSecondsAsync(2);&lt;br /&gt;        &lt;br /&gt;    Task&amp;lt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt;&amp;gt; resultTask = await TaskEx.WhenAny(t1, t2, t3);&lt;br /&gt;    &lt;span style="color: #008000;"&gt;// resultTask est ici t3, la premi&amp;egrave;re t&amp;acirc;che &amp;agrave; s'&amp;ecirc;tre termin&amp;eacute;&lt;/span&gt;&lt;br /&gt;    MessageBox.Show(resultTask.Result.ToString());&lt;br /&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;TaskEx.WhenAll()&lt;/strong&gt; prends en param&amp;egrave;tre une liste de t&amp;acirc;ches, et retourne une t&amp;acirc;che qui se termine lorsque &lt;em&gt;toutes &lt;/em&gt;les t&amp;acirc;ches sont termin&amp;eacute;es. Si toutes les t&amp;acirc;ches retournent le m&amp;ecirc;me type d'objets, on peut r&amp;eacute;cup&amp;eacute;rer tous les r&amp;eacute;sultats sous forme de tableau.&lt;/p&gt;
&lt;div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;"&gt;
&lt;pre id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #0000ff;"&gt;private&lt;/span&gt; async &lt;span style="color: #0000ff;"&gt;void&lt;/span&gt; Button_Click(&lt;span style="color: #0000ff;"&gt;object&lt;/span&gt; sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;    Task&amp;lt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt;&amp;gt; t1 = WaitNSecondsAsync(5);&lt;br /&gt;    Task&amp;lt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt;&amp;gt; t2 = WaitNSecondsAsync(7);&lt;br /&gt;    Task&amp;lt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt;&amp;gt; t3 = WaitNSecondsAsync(2);            &lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #0000ff;"&gt;int&lt;/span&gt;[] results = await TaskEx.WhenAll(t1, t2, t3);&lt;br /&gt;    &lt;span style="color: #008000;"&gt;// results contient les r&amp;eacute;sultats de toutes les t&amp;acirc;ches&lt;/span&gt;&lt;br /&gt;    MessageBox.Show(String.Format(&lt;span style="color: #006080;"&gt;"{0} - {1} - {2}"&lt;/span&gt;, results[0], results[1], results[2]));&lt;br /&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;h1&gt;Conclusion&lt;/h1&gt;
&lt;p&gt;Avec simplement 2 nouveaux mots cl&amp;eacute;s ajout&amp;eacute;s au langage, nous voyons que la programmation asynchrone a &amp;eacute;t&amp;eacute; grandement facilit&amp;eacute;e, et son int&amp;eacute;gration dans la version 4.5 du framework .net devrait inciter les d&amp;eacute;veloppeurs &amp;agrave; utiliser les diff&amp;eacute;rents coeurs de nos processeurs.&lt;/p&gt;</description><a10:updated>2011-12-05T11:44:44+01:00</a10:updated></item><item><guid isPermaLink="false">397</guid><link>http://labs.bewise.fr//Article/la-r%C3%A9ussite-de-vos-projets-sharepoint-passe-par-une-int%C3%A9gration-continue-part-2-2</link><title>La réussite de vos projets SharePoint passe par une intégration continue (Part 2/2)</title><description>&lt;p&gt;La première partie de cet article se trouve ici : &lt;a href="http://labs.bewise.fr/Article/La-reussite-de-vos-projets-SharePoint-passe-par-une-integration-continue--Part-1-2-/"&gt;http://labs.bewise.fr/Article/La-reussite-de-vos-projets-SharePoint-passe-par-une-integration-continue--Part-1-2-/&lt;/a&gt;&lt;/p&gt;  &lt;h2&gt;4 - Le projet SharePoint de démo&lt;/h2&gt;  &lt;p&gt;Le projet de démo est simplissime et se présente ainsi :&lt;/p&gt;  &lt;p&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image001" border="0" alt="clip_image001" src="http://labs.bewise.fr/Media/Windows-Live-Writer/La-russite-de-vos-projets-SharePoint-pas_107AF/clip_image001_3.png" width="836" height="319" /&gt;&lt;/p&gt;  &lt;p&gt;Un WebPart qui affiche une interface pour saisir une addition avec un bouton qui permet de lancer le calcul :&lt;/p&gt;  &lt;p&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image002" border="0" alt="clip_image002" src="http://labs.bewise.fr/Media/Windows-Live-Writer/La-russite-de-vos-projets-SharePoint-pas_107AF/clip_image002_3.png" width="452" height="127" /&gt;&lt;/p&gt;  &lt;p&gt;Et une classe "outil" dans une dll externe permettant de réaliser le calcul à proprement dit :&lt;/p&gt;  &lt;p&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image003" border="0" alt="clip_image003" src="http://labs.bewise.fr/Media/Windows-Live-Writer/La-russite-de-vos-projets-SharePoint-pas_107AF/clip_image003_3.png" width="341" height="257" /&gt;&lt;/p&gt;  &lt;p&gt;L'objectif étant de valider le fonctionnement du process complet, il nous faut un petit projet simple mais si possible représentatif.&lt;/p&gt;  &lt;p&gt;Vous remarquerez que le projet SharePoint contient aussi un fichier "Deploy.ps1". Il contient le script PowerShell décris au chapitre précédent. ATTENTION à penser à indiquer que ce fichier doit être copié dans le dossier de sortie lors de la compilation ! Nous allons en avoir besoin côté "Contrôleur de Build". :&lt;/p&gt;  &lt;p&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image004" border="0" alt="clip_image004" src="http://labs.bewise.fr/Media/Windows-Live-Writer/La-russite-de-vos-projets-SharePoint-pas_107AF/clip_image004_3.png" width="529" height="549" /&gt;&lt;/p&gt;  &lt;p&gt;Enfin qui dit intégration continue dit tests unitaires, tout du moins tests automatisés. J'ai donc ajouté un projet de type "Tests" avec :    &lt;br /&gt;un test unitaire qui test les méthodes de la classe Computing     &lt;br /&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image005" border="0" alt="clip_image005" src="http://labs.bewise.fr/Media/Windows-Live-Writer/La-russite-de-vos-projets-SharePoint-pas_107AF/clip_image005_3.png" width="918" height="442" /&gt;     &lt;br /&gt;et un WebTest qui valide la partie IHM de la calculette à la recherche du bouton ''='     &lt;br /&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image006" border="0" alt="clip_image006" src="http://labs.bewise.fr/Media/Windows-Live-Writer/La-russite-de-vos-projets-SharePoint-pas_107AF/clip_image006_3.png" width="614" height="479" /&gt;&lt;/p&gt;  &lt;p&gt;Cependant les WebTest (ou web performance tests) ne sont pas exécutés lors d'un déploiement par une Build Auto. Seuls les tests par code et tests "code UI" le sont. Heureusement pour nous il est possible à partir d'un WebTest de générer une classe faisant la même chose, mais par code ! Donc on retrouve ici la classe WebTest1Coded.&lt;/p&gt;  &lt;h2&gt;5 - Mise en place de la Build&lt;/h2&gt;  &lt;p&gt;Nous pouvons maintenant paramétrer la Build. En plus du paramétrage de base vous aurez 2 étapes importantes à faire :&lt;/p&gt;  &lt;p&gt;· ajouter le paramètre MSBuild pour générer le WSP&lt;/p&gt;  &lt;p&gt;· modifier le workflow pour intégrer l'appel au batch Deploy.ps1&lt;/p&gt;  &lt;p&gt;Commencez par créer la Build en passant par le Team Explorer et en faisant un clic droite sur le noud "Build" puis "New Build Definition":&lt;/p&gt;  &lt;p&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image007" border="0" alt="clip_image007" src="http://labs.bewise.fr/Media/Windows-Live-Writer/La-russite-de-vos-projets-SharePoint-pas_107AF/clip_image007_3.png" width="336" height="236" /&gt;&lt;/p&gt;  &lt;p&gt;Donnez-lui un nom puis passez à l'étape suivante permettant de choisir à quel moment la Build peut se déclencher :&lt;/p&gt;  &lt;p&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image008" border="0" alt="clip_image008" src="http://labs.bewise.fr/Media/Windows-Live-Writer/La-russite-de-vos-projets-SharePoint-pas_107AF/clip_image008_3.png" width="830" height="392" /&gt;&lt;/p&gt;  &lt;p&gt;Selon vos besoins la Build peut être lancée uniquement manuellement, de manière régulière ou bien à chaque check in d'un développeur.&lt;/p&gt;  &lt;p&gt;Notez la nouveauté de la version 2010 qui propose le "Gated Check-in" qui permet de réaliser la compilation et les tests avec la version que le développeur vient d'archiver, donc déclenchement automatique, mais si la Build fini en erreur, l'archivage est annulé. Donc en cas d'archivage une version d'une source disons "pas compatible" avec le reste du projet, nous n'aurons pas les autres développeurs de l'équipe impactés.&lt;/p&gt;  &lt;p&gt;A l'étape suivante vous indiquez quel contrôleur de Build va prendre en charge cette Build :&lt;/p&gt;  &lt;p&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image009" border="0" alt="clip_image009" src="http://labs.bewise.fr/Media/Windows-Live-Writer/La-russite-de-vos-projets-SharePoint-pas_107AF/clip_image009_3.png" width="570" height="294" /&gt;&lt;/p&gt;  &lt;p&gt;Il faut aussi fournir un dossier partagé où les fichiers de sortie sont stockés sur le serveur de Build. En principe lors de l'installation de TFS Build Service ce dossier est créé et par défaut correspond au C:\Builds\&lt;/p&gt;  &lt;p&gt;Il est nécessaire que les membres de l'équipe aient accès en lecture à ce partage réseau pour qu'ils puissent consulter les logs des Builds par exemple.&lt;/p&gt;  &lt;p&gt;Enfin la page de configuration la plus importante est la configuration du process :&lt;/p&gt;  &lt;p&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image010" border="0" alt="clip_image010" src="http://labs.bewise.fr/Media/Windows-Live-Writer/La-russite-de-vos-projets-SharePoint-pas_107AF/clip_image010_3.png" width="802" height="469" /&gt;&lt;/p&gt;  &lt;p&gt;Ici vous choisissez quels projets sont compilés et si il faut exécuter les tests. Par défaut c'est le cas, à partir du moment où le nom de votre projet de test contient le mot "Test".&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Premier point important&lt;/strong&gt;, ajoutez l'argument MSBuild suivant : &lt;strong&gt;/p:IsPackaging=True&lt;/strong&gt;     &lt;br /&gt;Cet argument permet de dire à MSBuild de faire l'équivalent de ce que fait Visual Studio lorsque vous faites un clic droite / deploy sur un projet de type SharePoint.&lt;/p&gt;  &lt;p&gt;Second point, il faut un modèle de process. Ce process est un workflow (WF 4.0) qui réalise toutes les étapes de la Build : récupération des dernières sources, nettoyage des binaires, compilation, exécution des tests, création de WorkItems, etc. C'est ici qu'il faut rajouter l'exécution de notre script PowerShell qui va déployer notre solution SharePoint. L'emplacement idéal étant après la compilation '(et donc packaging) et avant l'exécution des tests.&lt;/p&gt;  &lt;p&gt;Commencez par créer un nouveau modèle à partir de celui par défaut :&lt;/p&gt;  &lt;p&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image011" border="0" alt="clip_image011" src="http://labs.bewise.fr/Media/Windows-Live-Writer/La-russite-de-vos-projets-SharePoint-pas_107AF/clip_image011_3.png" width="798" height="510" /&gt;&lt;/p&gt;  &lt;p&gt;Avant d'éditer ce nouveau modèle vous pouvez configurer la politique de rétention des Builds et de leur résultat (attention à l'espace disque !) et enfin enregistrer cette définition de Build.&lt;/p&gt;  &lt;p&gt;Le fichier correspondant au workflow se trouve dans un dossier nommé "BuildProcessTemplates" à la racine du projet TFS :&lt;/p&gt;  &lt;p&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image012" border="0" alt="clip_image012" src="http://labs.bewise.fr/Media/Windows-Live-Writer/La-russite-de-vos-projets-SharePoint-pas_107AF/clip_image012_3.png" width="610" height="158" /&gt;&lt;/p&gt;  &lt;p&gt;Pensez à faire un "check out" avant de l'ouvrir dans Visual Studio.&lt;/p&gt;  &lt;p&gt;Une fois le fichier chargé (c'est assez long) il faut repérer le bon emplacement. Ce n'est pas forcément évident du premier abord vu la quantité d'étapes et de conditions imbriquées. Trouvez le bloc "Try Compile, Test, and Associate Changesets and Work Items " qui se trouve en seconde moitié du workflow (attention pas celui de l'étape de "Clean" se trouvant un peu avant)&lt;/p&gt;  &lt;p&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image013" border="0" alt="clip_image013" src="http://labs.bewise.fr/Media/Windows-Live-Writer/La-russite-de-vos-projets-SharePoint-pas_107AF/clip_image013_3.png" width="757" height="233" /&gt;&lt;/p&gt;  &lt;p&gt;Puis juste un peu plus bas vous trouverez la boucle qui exécute MSBuild pour chaque projet, suivi de l'étape qui va gérer l'exécution des tests :&lt;/p&gt;  &lt;p&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image014" border="0" alt="clip_image014" src="http://labs.bewise.fr/Media/Windows-Live-Writer/La-russite-de-vos-projets-SharePoint-pas_107AF/clip_image014_3.png" width="759" height="633" /&gt;&lt;/p&gt;  &lt;p&gt;Il faut donc ajouter à cet emplacement intermédiaire l'appel à notre script PowerShell. Pour cela il faut utiliser une activité "InvokeProcess" &lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/La-russite-de-vos-projets-SharePoint-pas_107AF/clip_image015_2.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image015" border="0" alt="clip_image015" src="http://labs.bewise.fr/Media/Windows-Live-Writer/La-russite-de-vos-projets-SharePoint-pas_107AF/clip_image015_thumb.png" width="128" height="33" /&gt;&lt;/a&gt;fournie dans les "Team Foundation Build Activities". Faites la glisser à l'emplacement repéré précédemment.&lt;/p&gt;  &lt;p&gt;L'utilisation de cette activité est assez simple. Il faut lui fournir un "filename" c'est à dire l'exécutable, ici "powershell", ainsi que les paramètres de ligne de commande. Concernant ces derniers nous allons pouvoir utiliser une variable disponible dans le Workflow qui est "outputDirectory". Comme vous vous en doutez, cette variable contient le chemin où les binaires sont placés lors de la compilation.&lt;/p&gt;  &lt;p&gt;Il se trouve que si vous avez bien suivi les étapes précédentes, ce dossier contiendra le ou les fichiers wsp de votre/vos projets SharePoint, ainsi que le fichier "Deploy.ps1". Pour rappel ce dernier attend en entrée un dossier contenant des wsp.&lt;/p&gt;  &lt;p&gt;Il ne reste plus qu'à utiliser tout ça dans la propriété "Arguments" : &lt;strong&gt;"-Command ""&amp; '" &amp; outputDirectory &amp; "\Deploy.ps1' '" &amp; outputDirectory &amp; "\'"""&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Attention : les propriétés de l'activité doivent être renseignées avec du code VB.NET. D'où le &amp; pour la concaténation de chaines.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://labs.bewise.fr/Media/Windows-Live-Writer/La-russite-de-vos-projets-SharePoint-pas_107AF/image_3.png" width="1134" height="334" /&gt;&lt;/p&gt;  &lt;p&gt;Vous pouvez maintenant enregistrer le fichier. &lt;strong&gt;Pensez à faire un "check in" &lt;/strong&gt;sans quoi la Build sera exécutée avec la précédente version de ce workflow.&lt;/p&gt;  &lt;h2&gt;6 - Tests du processus mis en place&lt;/h2&gt;  &lt;p&gt;Avant d'exécuter une première Build, il faut prévoir le déploiement de la solution sur le serveur d'intégration, l'activation de la feature, la création d'une page de webpart contenant la calculette. Tout cela est faisable soit dans le script PowerShell soit pourquoi pas directement dans l'initialisation des tests unitaires en utilisant le modèle objet de SharePoint.&lt;/p&gt;  &lt;p&gt;Afin de simplifier l'exemple j'ai fait un premier déploiement manuel et j'ai créé une page de test. J'ai d'ailleurs modifié mon test web "codé" pour lui donner l'adresse de cette page sur le serveur d'intégration.&lt;/p&gt;  &lt;p&gt;Vous pouvez lancer une première Build en passant par le "Team Explorer / Build / votrebuild" et en faisant un clic droite / queue new Build :&lt;/p&gt;  &lt;p&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image017" border="0" alt="clip_image017" src="http://labs.bewise.fr/Media/Windows-Live-Writer/La-russite-de-vos-projets-SharePoint-pas_107AF/clip_image017_3.png" width="330" height="411" /&gt;&lt;/p&gt;  &lt;p&gt;Validez le paramétrage et faites "Queue"&lt;/p&gt;  &lt;p&gt;Vous arrivez ensuite sur la fenêtre "Build Explorer" vous permettant de voir la liste des Builds en cours :&lt;/p&gt;  &lt;p&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image018" border="0" alt="clip_image018" src="http://labs.bewise.fr/Media/Windows-Live-Writer/La-russite-de-vos-projets-SharePoint-pas_107AF/clip_image018_3.png" width="645" height="202" /&gt;&lt;/p&gt;  &lt;p&gt;Un double clic sur la Build vous permet de consulter l'évolution en direct :&lt;/p&gt;  &lt;p&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image019" border="0" alt="clip_image019" src="http://labs.bewise.fr/Media/Windows-Live-Writer/La-russite-de-vos-projets-SharePoint-pas_107AF/clip_image019_3.png" width="649" height="520" /&gt;&lt;/p&gt;  &lt;p&gt;Une fois la compilation terminée, si tout se passe bien, vous retrouvez un résumé indiquant le résultat de la compilation et des tests:&lt;/p&gt;  &lt;p&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image020" border="0" alt="clip_image020" src="http://labs.bewise.fr/Media/Windows-Live-Writer/La-russite-de-vos-projets-SharePoint-pas_107AF/clip_image020_3.png" width="656" height="523" /&gt;&lt;/p&gt;  &lt;p&gt;Vous avez même la possibilité de consulter le résultat des tests en détails !&lt;/p&gt;  &lt;p&gt;Afin de vérifier l'efficacité de mon process de Build, je vais introduire 2 "erreurs" dans le projet:&lt;/p&gt;  &lt;p&gt;· une erreur de code dans la classe Computing :    &lt;br /&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image021" border="0" alt="clip_image021" src="http://labs.bewise.fr/Media/Windows-Live-Writer/La-russite-de-vos-projets-SharePoint-pas_107AF/clip_image021_3.png" width="376" height="150" /&gt;&lt;/p&gt;  &lt;p&gt;· une erreur d'ihm dans le webpart :    &lt;br /&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image022" border="0" alt="clip_image022" src="http://labs.bewise.fr/Media/Windows-Live-Writer/La-russite-de-vos-projets-SharePoint-pas_107AF/clip_image022_3.png" width="371" height="97" /&gt;&lt;/p&gt;  &lt;p&gt;Je fais un "check in" de tout ça et je relance la Build. Après quelque minute le résultat tombe : la Build est en échec car des tests ont échoués. En regardant dans le détail j'ai la raison de l'échec de ces tests :&lt;/p&gt;  &lt;p&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image023" border="0" alt="clip_image023" src="http://labs.bewise.fr/Media/Windows-Live-Writer/La-russite-de-vos-projets-SharePoint-pas_107AF/clip_image023_3.png" width="624" height="461" /&gt;&lt;/p&gt;  &lt;p&gt;Un double clic sur le WebTest me permet d'aller voir en détail la raison de son échec :&lt;/p&gt;  &lt;p&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image024" border="0" alt="clip_image024" src="http://labs.bewise.fr/Media/Windows-Live-Writer/La-russite-de-vos-projets-SharePoint-pas_107AF/clip_image024_3.png" width="848" height="247" /&gt;&lt;/p&gt;  &lt;p&gt;On constate qu'effectivement le signe = dans le bouton n'est pas trouvé. C'est bien que ma nouvelle version "bugée" a bien été correctement déployée sur mon serveur d'intégration.&lt;/p&gt;  &lt;h2&gt;Conclusion&lt;/h2&gt;  &lt;p&gt;Dans cet article je me suis focalisé sur la mise en place de l'aspect Build automatique et exécution des tests unitaires. Je vous ai montré comment installer les outils nécessaires ainsi que le paramétrage et les techniques utiles.&lt;/p&gt;  &lt;p&gt;Cependant tout ceci n'est qu'une introduction au regard de ce que propose cet outil d'intégration continue en particulier sur les possibilités de personnalisation du workflow du processus d'intégration continue lui-même.&lt;/p&gt;  &lt;p&gt;L'avènement de Visual Studio 2010 et l'intégration efficace d'outils dédiés aux développements SharePoint 2010 ainsi que cette souplesse et ces nombreuses options permettent d'adapter assez simplement de telles pratiques (industrialisation, processus qualité, tests, etc.) à des projets SharePoint. Et c'est tout simplement une révolution !&lt;/p&gt;  &lt;p&gt;Merci à ceux qui m'ont soutenu, aidé, relu, en particulier : Ben, Stephan, Alex et Alain !&lt;/p&gt;</description><a10:updated>2011-11-11T18:56:09+01:00</a10:updated></item><item><guid isPermaLink="false">396</guid><link>http://labs.bewise.fr//Article/La-reussite-de-vos-projets-SharePoint-passe-par-une-integration-continue--Part-1-2-</link><title>La réussite de vos projets SharePoint passe par une intégration continue (Part 1/2)</title><description>&lt;p&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left;" src="http://images.discountasp.net/tfs-newsletter/2011-06/tfsBuildlogo.png" alt="" align="left" /&gt;Connaissez-vous l'int&amp;eacute;gration continue ? Avez-vous des doutes sur ses int&amp;eacute;r&amp;ecirc;ts et avantages ? Je ne chercherais pas &amp;agrave; r&amp;eacute;pondre &amp;agrave; ces questions dans cet article car vous en trouverez certainement des dizaines voire m&amp;ecirc;me des centaines bien plus pertinents que le mien. Malgr&amp;eacute; tout, afin de planter un minimum le d&amp;eacute;cor, voici pour faire simple la d&amp;eacute;finition de Wikip&amp;eacute;dia :&lt;/p&gt;
&lt;p&gt;&lt;a href="http://fr.wikipedia.org/wiki/Int%C3%A9gration_continue"&gt;&amp;laquo; L'int&amp;eacute;gration continue est un ensemble de pratiques utilis&amp;eacute;es en g&amp;eacute;nie logiciel. Elles consistent &amp;agrave; v&amp;eacute;rifier &amp;agrave; chaque modification de code source que le r&amp;eacute;sultat des modifications ne produit pas de r&amp;eacute;gression de l'application en cours de d&amp;eacute;veloppement. &amp;raquo;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Par contre, une fois que vous aurez fait ces recherches, je ne doute pas que vous soyez au moins autant convaincu que moi. Alors peut-&amp;ecirc;tre &amp;agrave; ce moment vous vous demanderez : &amp;laquo; Comment mettre en place ce type de processus d'int&amp;eacute;gration continue avec des projets SharePoint ? &amp;raquo;. Dans ce cas, cet article est pour vous !&lt;/p&gt;
&lt;p&gt;Je vais vous guider sur les outils &amp;agrave; utiliser et comment les utiliser pour mettre en place une compilation, un d&amp;eacute;ploiement et des tests, tout ceci de mani&amp;egrave;re automatique, pour vos projets d&amp;eacute;di&amp;eacute;s &amp;agrave; la plateforme SharePoint 2010.&lt;/p&gt;
&lt;p&gt;Ce processus fera appel &amp;agrave; la plateforme Team Foundation Server, en particulier l'aspect "Build" automatique permettant de s&amp;eacute;quencer un ensemble d'actions telles que &amp;laquo; compilation &amp;raquo;, &amp;laquo; ex&amp;eacute;cution de processus externe &amp;raquo;, &amp;laquo; cr&amp;eacute;ation de WorkItems &amp;raquo;, &amp;laquo; ex&amp;eacute;cution de tests unitaires &amp;raquo;.&lt;/p&gt;
&lt;h2&gt;1 - Pr&amp;eacute; Requis&lt;/h2&gt;
&lt;h3&gt;&lt;a name="_Toc308798781"&gt;&lt;span style="color: #000000;"&gt;Ferme SharePoint :&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Le but du jeu est de pouvoir compiler une solution de code pour SharePoint 2010. Les projets Visual Studio 2010 pour SharePoint 2010 sont des projets de type Libraire de classes (DLL .NET) "classique", ou presque. En g&amp;eacute;n&amp;eacute;ral le code embarqu&amp;eacute; dans ces solutions utilise l'API SharePoint 2010. Donc il faut que ce code soit compil&amp;eacute; et &amp;eacute;ventuellement ex&amp;eacute;cut&amp;eacute; sur un serveur SharePoint pour bien fonctionner. Sinon le processus MSBuild ne va pas trouver les r&amp;eacute;f&amp;eacute;rences de notre projet et donc la compilation &amp;eacute;chouera.&lt;/p&gt;
&lt;p&gt;Il est donc n&amp;eacute;cessaire de disposer d'une ferme SharePoint 2010, &amp;agrave; minima une seule machine, qui va &amp;ecirc;tre d&amp;eacute;di&amp;eacute;e &amp;agrave; cette phase d'int&amp;eacute;gration continue. Selon votre politique et fr&amp;eacute;quence de compilation de vos projets, vous pouvez (ou pas) pr&amp;eacute;voir d'utiliser cette ferme pour que les testeurs fonctionnels viennent tester directement les d&amp;eacute;veloppements int&amp;eacute;gr&amp;eacute;s. Cependant soyez vigilants de ne pas leur compliquer la t&amp;acirc;che en leur demandant de r&amp;eacute;aliser des tests alors que des compilations, d&amp;eacute;ploiements, tests unitaires peuvent &amp;ecirc;tre d&amp;eacute;clench&amp;eacute;s au m&amp;ecirc;me moment par le processus d'int&amp;eacute;gration continue.    &lt;br /&gt;Je ne d&amp;eacute;taillerai pas l'installation de SharePoint, ce n'est pas le sujet de l'article, mais il vous faut une installation correspondant &amp;agrave; vos besoins d'int&amp;eacute;gration, donc dans la mesure du possible qui se rapproche d'assez pr&amp;egrave;s &amp;agrave; la ferme de production finale.&lt;/p&gt;
&lt;h3&gt;&lt;a name="_Toc308798782"&gt;&lt;span style="color: #000000;"&gt;Visual Studio :&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;span style="color: #000000;"&gt;Vous devez installer un Visual Studio 2010 sur la machine que vous d&amp;eacute;diez &amp;agrave; l'int&amp;eacute;gration afin que l'agent de Build soit capable de compiler correctement vos projets. De plus il est recommand&amp;eacute; que la version du Visual studio soit la m&amp;ecirc;me que celle de votre &amp;eacute;quipe de dev en particulier en terme de service pack.&lt;/span&gt;&lt;/p&gt;
&lt;h3&gt;&lt;a name="_Toc308798783"&gt;&lt;span style="color: #000000;"&gt;Team Foundation Server 2010 :&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;span style="color: #000000;"&gt;Enfin vous devez aussi disposer d'une plateforme Team Foundation 2010 avec le contr&amp;ocirc;leur de code sources, les WorkItems, les tests, etc. L&amp;agrave; encore je ne d&amp;eacute;taillerai pas la partie installation de TFS Server. &lt;/span&gt;&lt;/p&gt;
&lt;h3&gt;&lt;a name="_Toc308798784"&gt;&lt;span style="color: #000000;"&gt;Compte utilisateur :&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;span style="color: #000000;"&gt;Il vous faudra un compte de service&lt;/span&gt; (compte A.D.) qui sera &amp;agrave; la fois :&lt;/p&gt;
&lt;p&gt;&amp;middot; &lt;strong&gt;membre du groupe TFS autorisant l'ex&amp;eacute;cution de Builds&lt;/strong&gt; (et &amp;agrave; fortiori acc&amp;egrave;s aux sources des projets &amp;agrave; compiler)&lt;/p&gt;
&lt;p&gt;&amp;middot; membre du groupe &lt;strong&gt;administrateurs de la ferme&lt;/strong&gt; sur votre SharePoint d'int&amp;eacute;gration (afin d'autoriser le d&amp;eacute;ploiement des solutions SharePoint)&lt;/p&gt;
&lt;p&gt;De plus afin de permettre &amp;agrave; cet utilisateur d'ex&amp;eacute;cuter des op&amp;eacute;rations SharePoint via PowerShell (ce qui nous sera utile)&lt;strong&gt; il faut pr&amp;eacute;voir de lui accorder les droits via la commande Add-SPShellAdmin&lt;/strong&gt;. (Voir KB &lt;a href="http://labs.bewise.fr/kb/Donne-moi-les-droits-de-developper-sur-mon-serveur-SharePoint-2010/"&gt;http://labs.bewise.fr/kb/Donne-moi-les-droits-de-developper-sur-mon-serveur-SharePoint-&lt;span style="color: #000000;"&gt;2010/&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #000000;"&gt;)&lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;2 - Installation de Visual Studio Team Foundation Server 2010 (Build Service)&lt;/h2&gt;
&lt;p&gt;Vous devez installer, sur l'un des serveurs frontaux de votre ferme SharePoint, Visual Studio 2010 et Team Foundation Server (uniquement le Build Service). Cette &amp;eacute;tape est relativement simple. Il vous faut le programme d'installation de Microsoft Team Foundation Server 2010 qui inclut la partie "service de Build". Ce service est un ex&amp;eacute;cutable capable de piloter les processus MSBuild et MSTest.&lt;/p&gt;
&lt;p&gt;L'installation de TFS 2010 est simple, il faut suivre les &amp;eacute;tapes de l'assistant&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="clip_image001" src="http://labs.bewise.fr/Media/Windows-Live-Writer/fe9c56fd5fba_10545/clip_image001_3.png" border="0" alt="clip_image001" width="677" height="517" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="clip_image002" src="http://labs.bewise.fr/Media/Windows-Live-Writer/fe9c56fd5fba_10545/clip_image002_3.png" border="0" alt="clip_image002" width="682" height="521" /&gt;&lt;/p&gt;
&lt;p&gt;A cette &amp;eacute;tape il ne faut s&amp;eacute;lectionner que la partie "Build Service"&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="clip_image003" src="http://labs.bewise.fr/Media/Windows-Live-Writer/fe9c56fd5fba_10545/clip_image003_3.png" border="0" alt="clip_image003" width="695" height="531" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="clip_image004" src="http://labs.bewise.fr/Media/Windows-Live-Writer/fe9c56fd5fba_10545/clip_image004_3.png" border="0" alt="clip_image004" width="696" height="535" /&gt;&lt;/p&gt;
&lt;p&gt;A la fin de l'installation, v&amp;eacute;rifiez que vous avez coch&amp;eacute; la case permettant de lancer l'assistant de configuration de TFS :&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="clip_image005" src="http://labs.bewise.fr/Media/Windows-Live-Writer/fe9c56fd5fba_10545/clip_image005_3.png" border="0" alt="clip_image005" width="706" height="536" /&gt;&lt;/p&gt;
&lt;p&gt;L'assistant va vous permettre de configurer le contr&amp;ocirc;leur et l'agent et de d&amp;eacute;cider sur quel serveur TFS vous vous connecterez :&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="clip_image006" src="http://labs.bewise.fr/Media/Windows-Live-Writer/fe9c56fd5fba_10545/clip_image006_3.png" border="0" alt="clip_image006" width="715" height="543" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="clip_image007" src="http://labs.bewise.fr/Media/Windows-Live-Writer/fe9c56fd5fba_10545/clip_image007_3.png" border="0" alt="clip_image007" width="728" height="544" /&gt;&lt;/p&gt;
&lt;p&gt;Premi&amp;egrave;re &amp;eacute;tape : on choisit &amp;agrave; quel serveur TFS on se connecte :&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="clip_image008" src="http://labs.bewise.fr/Media/Windows-Live-Writer/fe9c56fd5fba_10545/clip_image008_3.png" border="0" alt="clip_image008" width="717" height="548" /&gt;&lt;/p&gt;
&lt;p&gt;2nd &amp;eacute;tape : on choisit sur qu'elle collection on travaille. Cela signifie que le contr&amp;ocirc;leur de Build ne pourra d&amp;eacute;clencher des Builds sur ce serveur que si les sources sont plac&amp;eacute;es dans cette collection. Pour le coup la notion de collection dans TFS nous permet de "limiter" quels projets peuvent &amp;ecirc;tres compil&amp;eacute;s sur quels serveurs.&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="clip_image009" src="http://labs.bewise.fr/Media/Windows-Live-Writer/fe9c56fd5fba_10545/clip_image009_3.png" border="0" alt="clip_image009" width="728" height="550" /&gt;&lt;/p&gt;
&lt;p&gt;Une &amp;eacute;tape de recherche d'&amp;eacute;ventuels autres contr&amp;ocirc;leurs / agents&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="clip_image010" src="http://labs.bewise.fr/Media/Windows-Live-Writer/fe9c56fd5fba_10545/clip_image010_3.png" border="0" alt="clip_image010" width="737" height="560" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="clip_image011" src="http://labs.bewise.fr/Media/Windows-Live-Writer/fe9c56fd5fba_10545/clip_image011_3.png" border="0" alt="clip_image011" width="746" height="567" /&gt;&lt;/p&gt;
&lt;p&gt;Ici on configure le nombre d'agents. Ce qu'il faut savoir &amp;agrave; ce propos:&lt;/p&gt;
&lt;p&gt;&amp;middot; il n'y a qu'un seul contr&amp;ocirc;leur : c'est lui qui "d&amp;eacute;clenche" et pilote les Builds&lt;/p&gt;
&lt;p&gt;&amp;middot; il y a de un &amp;agrave; N agents : ce sont eux qui ex&amp;eacute;cutent &amp;agrave; proprement parl&amp;eacute; les Builds et donc qui consomment de la ressource syst&amp;egrave;me. Le nombre d'agent vous permet de d&amp;eacute;terminer le nombre de processus de Build qui peuvent tourner en parall&amp;egrave;le. Il vous faut donc trouver un juste milieu entre "temps d'attente" pour les d&amp;eacute;veloppeurs (qui attendent de voir si la compil est pass&amp;eacute;e ou pas) et "performance" du serveur. De toute fa&amp;ccedil;on les agents peuvent &amp;ecirc;tre ajout&amp;eacute;s apr&amp;egrave;s coup, donc commencez par la valeur par d&amp;eacute;faut:&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="clip_image012" src="http://labs.bewise.fr/Media/Windows-Live-Writer/fe9c56fd5fba_10545/clip_image012_3.png" border="0" alt="clip_image012" width="756" height="571" /&gt;&lt;/p&gt;
&lt;p&gt;Il vous faut ici un compte utilisateur qui a acc&amp;egrave;s aux sources dans votre serveur TFS mais aussi &amp;agrave; qui vous devrez donner acc&amp;egrave;s type "Administrateur de la ferme" &amp;agrave; vos sites SharePoint sur lesquels seront ex&amp;eacute;cut&amp;eacute;s les d&amp;eacute;ploiements et tests automatiques (voir Pr&amp;eacute; requis) :&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="clip_image013" src="http://labs.bewise.fr/Media/Windows-Live-Writer/fe9c56fd5fba_10545/clip_image013_3.png" border="0" alt="clip_image013" width="767" height="573" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="clip_image014" src="http://labs.bewise.fr/Media/Windows-Live-Writer/fe9c56fd5fba_10545/clip_image014_3.png" border="0" alt="clip_image014" width="768" height="580" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="clip_image015" src="http://labs.bewise.fr/Media/Windows-Live-Writer/fe9c56fd5fba_10545/clip_image015_3.png" border="0" alt="clip_image015" width="774" height="578" /&gt;&lt;/p&gt;
&lt;p&gt;Cette &amp;eacute;tape lance une s&amp;eacute;rie de v&amp;eacute;rifications afin de valider votre configuration :&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="clip_image016" src="http://labs.bewise.fr/Media/Windows-Live-Writer/fe9c56fd5fba_10545/clip_image016_3.png" border="0" alt="clip_image016" width="789" height="596" /&gt;&lt;/p&gt;
&lt;p&gt;Si tout c'est bien pass&amp;eacute; vous avez droit &amp;agrave; cet &amp;eacute;cran :&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="clip_image017" src="http://labs.bewise.fr/Media/Windows-Live-Writer/fe9c56fd5fba_10545/clip_image017_3.png" border="0" alt="clip_image017" width="800" height="604" /&gt;&lt;/p&gt;
&lt;p&gt;Enfin vous pouvez lancer la console d'administration de TFS :&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="clip_image018" src="http://labs.bewise.fr/Media/Windows-Live-Writer/fe9c56fd5fba_10545/clip_image018_3.png" border="0" alt="clip_image018" width="809" height="450" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000000;"&gt;Cette console vous permet de v&amp;eacute;rifier que le contr&amp;ocirc;leur et le(s) agent(s) sont op&amp;eacute;rationnels. Vous pouvez aussi modifier ici les propri&amp;eacute;t&amp;eacute;s que vous aviez configur&amp;eacute;es via l'assistant.&lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;3 - Mise en place du script de d&amp;eacute;ploiement de wsp pour SharePoint 2010&lt;/h2&gt;
&lt;p&gt;&lt;span style="color: #000000;"&gt;Le processus de compilation automatique saura compiler notre projet SharePoint 2010 : il sera ex&amp;eacute;cut&amp;eacute; sur un serveur o&amp;ugrave; sont install&amp;eacute;s SharePoint et Visual Studio.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000000;"&gt;Le processus d'ex&amp;eacute;cution des tests unitaires saura ex&amp;eacute;cuter nos tests unitaires : encore une fois nous avons les pr&amp;eacute;requis n&amp;eacute;cessaires.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000000;"&gt;Mais il nous manque une &amp;eacute;tape interm&amp;eacute;diaire afin que les tests soient pertinents : &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000000;"&gt;Le d&amp;eacute;ploiement de la solution SharePoint. En effet suite &amp;agrave; la compilation, un fichier WSP est produit. Ce WSP doit &amp;ecirc;tre d&amp;eacute;ploy&amp;eacute; au sein de la ferme SharePoint. Ce d&amp;eacute;ploiement peut &amp;ecirc;tre fait via stsadm ou bien depuis 2010 via PowerShell. Ici l'objectif &amp;eacute;tant d'automatiser au maximum, nous allons utiliser un script PowerShell qui va d&amp;eacute;terminer s'il s'agit du 1er d&amp;eacute;ploiement de ce WSP ou d'une mise &amp;agrave; jour par exemple. Vous pouvez aussi avoir besoin d'activer des features qui sont d&amp;eacute;ploy&amp;eacute;es via cette solution. Selon les types d'&amp;eacute;l&amp;eacute;ments dans votre projet, les param&amp;egrave;tres utilis&amp;eacute;s lors du d&amp;eacute;ploiement sont &amp;agrave; sp&amp;eacute;cifier. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000000;"&gt;Bref il est difficile d'imaginer un script qui prend en charge tous les cas. Le mieux que j'ai trouv&amp;eacute; pour l'instant est de m'imposer une r&amp;egrave;gle de nommage sur un fichier ps1 qui sera inclus dans mon projet. Comme cela, pour chaque projet SharePoint diff&amp;eacute;rent, les d&amp;eacute;veloppeurs peuvent inclure dans ce fichier le script adapt&amp;eacute;&lt;/span&gt; sp&amp;eacute;cifiquement au d&amp;eacute;ploiement de ce projet, et c&amp;ocirc;t&amp;eacute; Build on cherchera syst&amp;eacute;matiquement un fichier ps1 d'un nom particulier (par exemple deploy.ps1) et on l'ex&amp;eacute;cutera.&lt;/p&gt;
&lt;p&gt;A titre d'exemple je vous propose ici un script qui prends en entr&amp;eacute;e un chemin de r&amp;eacute;pertoire et qui cherche &amp;agrave; d&amp;eacute;ployer tous les WSP pr&amp;eacute;sents dans ce r&amp;eacute;pertoire :&lt;/p&gt;
&lt;div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;"&gt;
&lt;pre id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;$snappin = &lt;span style="color: #0000ff;"&gt;get&lt;/span&gt;-pssnapin | where-&lt;span style="color: #0000ff;"&gt;object&lt;/span&gt; {$_.Name -eq &lt;span style="color: #006080;"&gt;"Microsoft.SharePoint.PowerShell"&lt;/span&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff;"&gt;if&lt;/span&gt;($snappin -eq $null)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;&amp;amp; &lt;span style="color: #006080;"&gt;"C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\POWERSHELL\Registration\sharepoint.ps1"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$initialDirectory = $args[0]&lt;br /&gt;&lt;br /&gt;Write-Host &lt;span style="color: #006080;"&gt;"Searching wsp in "&lt;/span&gt; $initialDirectory&lt;br /&gt;&lt;br /&gt;$wsps = &lt;span style="color: #0000ff;"&gt;Get&lt;/span&gt;-ChildItem $initialDirectory\*.wsp&lt;br /&gt;&lt;br /&gt;foreach($wsp &lt;span style="color: #0000ff;"&gt;in&lt;/span&gt; $wsps)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff;"&gt;if&lt;/span&gt;($wsp -ne $null)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;Write-Host &lt;span style="color: #006080;"&gt;"Start installation process for solution "&lt;/span&gt; $wsp.Name &lt;span style="color: #006080;"&gt;"..."&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;$solution = &lt;span style="color: #0000ff;"&gt;Get&lt;/span&gt;-SPSolution | where-&lt;span style="color: #0000ff;"&gt;object&lt;/span&gt; {$_.Name -eq $wsp.Name}&lt;br /&gt;&lt;br /&gt;# check &lt;span style="color: #0000ff;"&gt;to&lt;/span&gt; see &lt;span style="color: #0000ff;"&gt;if&lt;/span&gt; solution package has been installed&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff;"&gt;if&lt;/span&gt; ($solution -ne $null) &lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;# check &lt;span style="color: #0000ff;"&gt;to&lt;/span&gt; see &lt;span style="color: #0000ff;"&gt;if&lt;/span&gt; solution package &lt;span style="color: #0000ff;"&gt;is&lt;/span&gt; currently deployed&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff;"&gt;if&lt;/span&gt;($solution.Deployed -eq $&lt;span style="color: #0000ff;"&gt;true&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;Write-Host &lt;span style="color: #006080;"&gt;"retracting "&lt;/span&gt; $solution.Name&lt;br /&gt;&lt;br /&gt;Uninstall-SPSolution $solution.Name -AllWebApplications -confirm:$&lt;span style="color: #0000ff;"&gt;false&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff;"&gt;while&lt;/span&gt; ( $solution.JobExists )&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;Write-Host &lt;span style="color: #006080;"&gt;"."&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;sleep 1&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Write-Host &lt;span style="color: #006080;"&gt;"uninstalling "&lt;/span&gt; $solution.Name&lt;br /&gt;&lt;br /&gt;Remove-SPSolution $solution.Name -confirm:$&lt;span style="color: #0000ff;"&gt;false&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Write-Host &lt;span style="color: #006080;"&gt;"installing "&lt;/span&gt; $wsp.Name&lt;br /&gt;&lt;br /&gt;Add-SPSolution $wsp&lt;br /&gt;&lt;br /&gt;$solution = &lt;span style="color: #0000ff;"&gt;Get&lt;/span&gt;-SPSolution | where-&lt;span style="color: #0000ff;"&gt;object&lt;/span&gt; {$_.Name -eq $wsp.Name}&lt;br /&gt;&lt;br /&gt;Write-Host &lt;span style="color: #006080;"&gt;"deploying "&lt;/span&gt; $solution.Name &lt;span style="color: #006080;"&gt;" on all webapps"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Install-SPSolution -Identity $solution.Name -GACDeployment -AllWebApplications -Force&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff;"&gt;while&lt;/span&gt; ( $solution.JobExists )&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;Write-Host &lt;span style="color: #006080;"&gt;"."&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;sleep 1&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$solution = &lt;span style="color: #0000ff;"&gt;Get&lt;/span&gt;-SPSolution | where-&lt;span style="color: #0000ff;"&gt;object&lt;/span&gt; {$_.Name -eq $wsp.Name}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff;"&gt;if&lt;/span&gt;($solution.Deployed -ne $&lt;span style="color: #0000ff;"&gt;true&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;Write-Host &lt;span style="color: #006080;"&gt;"deploying "&lt;/span&gt; $solution.Name &lt;span style="color: #006080;"&gt;" on no webapp"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Install-SPSolution -Identity $solution.Name -GACDeployment -Force&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff;"&gt;while&lt;/span&gt; ( $solution.JobExists )&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;Write-Host &lt;span style="color: #006080;"&gt;"."&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;sleep 1&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Write-Host &lt;span style="color: #006080;"&gt;"Ended installation process for solution "&lt;/span&gt; $wsp.Name&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Nous verrons plus loin comment on utilise ce script.&lt;/p&gt;
&lt;p&gt;Suite de l'article ici :&amp;nbsp;&lt;a href="http://labs.bewise.fr/Article/la-r%C3%A9ussite-de-vos-projets-sharepoint-passe-par-une-int%C3%A9gration-continue-part-2-2/"&gt;http://labs.bewise.fr/Article/la-r%C3%A9ussite-de-vos-projets-sharepoint-passe-par-une-int%C3%A9gration-continue-part-2-2/&lt;/a&gt;&lt;/p&gt;</description><a10:updated>2011-11-11T18:43:44+01:00</a10:updated></item><item><guid isPermaLink="false">390</guid><link>http://labs.bewise.fr//Article/Un-peu-de-genericite-</link><title>Un peu de généricité.</title><description>&lt;p align="justify"&gt;En tant que graphiste, je suis souvent confrontés à des retours de mes développeurs adorés. En effet, il n'est pas rare que ces derniers doivent reprendre telle ou telle partie du code généré par Blend, que ce soit pour de l'UI SIlverlight ou WPF. Et généralement, le code est repris car les standards de classement, d'organisation, d'optimisation et de référencement sont rarement identiques entre les "Artistes" et les "Codeurs".&lt;/p&gt;  &lt;p align="justify"&gt;Avec le souci de faire baisser le nombre de ces retours, il est primordial que le graphiste pense "généricité" dés le tout début de la conception. Cela lui permettra de définir et d'organiser les ressources graphiques dont il aura besoin, mais aussi de planifier et d'articuler sa production. Par exemple en systématisant l'emploi de dictionnaires de ressources (en WPF), en stockant une palette de couleurs dans une collection de &lt;em&gt;brushes&lt;/em&gt; (elle-même incluse dans un dictionnaire spécifique) ou encore utilisant au maximum ce que les contrôles ont à offrir en matière de généricité.&lt;/p&gt;  &lt;p align="justify"&gt;Pour illustrer un peu plus finement ce propos, laissez moi vous parler d'un contrôle bien particulier : Le bouton.&lt;/p&gt;  &lt;p align="justify"&gt;Beaucoup de graphistes insèrent des boutons dans leurs design et, puisque c'est ancré leur adn et leur contrat de travail, font tout leur possible pour modifier le look &amp; feel de ce contrôle. Pour faire ceci, le graphiste édite généralement le &lt;em&gt;control template&lt;/em&gt; du bouton. Le &lt;em&gt;template &lt;/em&gt;est le gabarit du contrôle que nous utilisons. Si nous modifions ce gabarit, il faut aussi garder à l'esprit que ce bouton pourra être appliqué de nombreuses fois dans notre fichier (un bouton pour le "next" et un autre pour le "back", par exemple). Il convient donc d'être "générique" afin de pouvoir employer ce &lt;em&gt;template&lt;/em&gt; dans le plus grand nombre de configurations.&lt;/p&gt;  &lt;p align="justify"&gt;Etudions tout d'abord ce que contient ce &lt;em&gt;control template&lt;/em&gt;. Pour commencer, ouvrons Blend 4,  créons une nouvelle application WPF et ajoutons un contrôle de type "bouton" dans notre planche de travail.&lt;/p&gt;  &lt;p align="justify"&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/Un-peu-de-gnricit_A3EE/Newone_2.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Newone" border="0" alt="Newone" src="http://labs.bewise.fr/Media/Windows-Live-Writer/Un-peu-de-gnricit_A3EE/Newone_thumb.jpg" width="244" height="208" /&gt;&lt;/a&gt;  &lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/Un-peu-de-gnricit_A3EE/Boutoncreate_2.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Boutoncreate" border="0" alt="Boutoncreate" src="http://labs.bewise.fr/Media/Windows-Live-Writer/Un-peu-de-gnricit_A3EE/Boutoncreate_thumb.jpg" width="244" height="82" /&gt;&lt;/a&gt;  &lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/Un-peu-de-gnricit_A3EE/Btncree_2.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Btncree" border="0" alt="Btncree" src="http://labs.bewise.fr/Media/Windows-Live-Writer/Un-peu-de-gnricit_A3EE/Btncree_thumb.jpg" width="244" height="188" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p align="justify"&gt;Le bouton vient avec un aspect graphique que nous allons légèrement remanier. Pour ce faire, nous sélectionnons le bouton, faisons un clic droit et choisissons &lt;em&gt;Edit Template-&gt; Edit a copy&lt;/em&gt;. Cela nous ouvre le capot du contrôle en question et nous permet de voir graphiquement de quoi celui-ci est constitué. &lt;/p&gt;  &lt;p align="justify"&gt;Dans notre cas, nous voyons un item de type &lt;em&gt;Chrome&lt;/em&gt; et un &lt;em&gt;control presenter&lt;/em&gt;.  Ce dernier item est un exemple de généricité appliqué, puisqu'il permet , lorsqu'il est présent, de faire remonter au niveau des propriétés du bouton une valeur, en l'occurrence le label "Button" que porte actuellement le bouton. Cela permet donc de changer la valeur du label du bouton sans avoir a attaquer le&lt;em&gt; control template&lt;/em&gt;. En le racontant d'une autre manière, je dirais que le bouton hérite de la propriété "content" du &lt;em&gt;content presenter&lt;/em&gt; placé dans son &lt;em&gt;template&lt;/em&gt;.&lt;/p&gt;  &lt;p align="justify"&gt; &lt;/p&gt;  &lt;p align="justify"&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/Un-peu-de-gnricit_A3EE/Template-ed_2.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Template-ed" border="0" alt="Template-ed" src="http://labs.bewise.fr/Media/Windows-Live-Writer/Un-peu-de-gnricit_A3EE/Template-ed_thumb.jpg" width="244" height="203" /&gt;&lt;/a&gt;  &lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/Un-peu-de-gnricit_A3EE/Btntemplate_2.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Btntemplate" border="0" alt="Btntemplate" src="http://labs.bewise.fr/Media/Windows-Live-Writer/Un-peu-de-gnricit_A3EE/Btntemplate_thumb.jpg" width="244" height="175" /&gt;&lt;/a&gt;  &lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/Un-peu-de-gnricit_A3EE/Contentprop_2.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Contentprop" border="0" alt="Contentprop" src="http://labs.bewise.fr/Media/Windows-Live-Writer/Un-peu-de-gnricit_A3EE/Contentprop_thumb.jpg" width="244" height="96" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="justify"&gt; &lt;/p&gt;  &lt;p align="justify"&gt;Supprimons l'élément &lt;em&gt;Chrome&lt;/em&gt;. C'est, dans le &lt;em&gt;template&lt;/em&gt;, ce qui gère l'aspect graphique que nous souhaitons faire évoluer. Comme le &lt;em&gt;content presenter&lt;/em&gt; lui est lié, celui-ci disparait aussi. Nous le recréerons plus tard. Pour l'instant, ajoutons dans notre template une Grid - une grille pour "cadrer" notre bouton- et un rectangle dans cette grille pour donner un fond à notre bouton. On veillera, justement dans un souci de généricité, à bien spécifier des tailles d'éléments relatives. Généralement, les objets seront posés en "&lt;em&gt;Stretch/Sretch&lt;/em&gt;" , c'est à dire qu'ils vont venir s'ajuster à leur contenant dans la largeur et la hauteur. SI l'on souhaite un débord, on pourra le régler via les &lt;em&gt;Margins&lt;/em&gt; de l'élément. Enfin, ajoutons dans notre grille et sous le rectangle un élément &lt;em&gt;content presenter&lt;/em&gt;  (notez que pour que le label du bouton soit en son centre, cette fois on devra le caler en &lt;em&gt;Center/center&lt;/em&gt;, sans marge et avec la taille en Auto). &lt;/p&gt;  &lt;p align="justify"&gt;Dans les propriétés du rectangle, changeons la valeur&lt;em&gt; fill&lt;/em&gt; et choisissons un bleu clair.&lt;/p&gt;  &lt;p align="justify"&gt; &lt;/p&gt;  &lt;p align="justify"&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/Un-peu-de-gnricit_A3EE/Stretch_2.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Stretch" border="0" alt="Stretch" src="http://labs.bewise.fr/Media/Windows-Live-Writer/Un-peu-de-gnricit_A3EE/Stretch_thumb.jpg" width="244" height="77" /&gt;&lt;/a&gt;  &lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/Un-peu-de-gnricit_A3EE/Templatedefini_2.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Templatedefini" border="0" alt="Templatedefini" src="http://labs.bewise.fr/Media/Windows-Live-Writer/Un-peu-de-gnricit_A3EE/Templatedefini_thumb.jpg" width="244" height="185" /&gt;&lt;/a&gt;  &lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/Un-peu-de-gnricit_A3EE/1bouton_2.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="1bouton" border="0" alt="1bouton" src="http://labs.bewise.fr/Media/Windows-Live-Writer/Un-peu-de-gnricit_A3EE/1bouton_thumb.jpg" width="244" height="184" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="justify"&gt; &lt;/p&gt;  &lt;p align="justify"&gt;Revenez à la page principale (par le bouton se trouvant à gauche du nom de votre &lt;em&gt;template&lt;/em&gt; dans le panneau &lt;em&gt;Objects and timeline&lt;/em&gt;). Notre bouton apparait, mais est bien fade tout bleu sur blanc. De plus, si nous essayons de changer la propriété "&lt;em&gt;background&lt;/em&gt;" de ce bouton, rien ne semble se passer. &lt;/p&gt;  &lt;p align="justify"&gt;Ajoutons un nouveau bouton maintenant. En faisant un clic droit dessus, nous pouvons appliquer à bouton le gabarit que nous venons d'éditer (&lt;em&gt;Edit template&lt;/em&gt; -&gt; &lt;em&gt;Apply ressource&lt;/em&gt;-&gt; le style de votre bouton). Ce nouveau bouton prend le design du bouton  précédent. A ce niveau là, si je change la valeur &lt;em&gt;fill&lt;/em&gt; dans le &lt;em&gt;template&lt;/em&gt; du bouton, cette couleur changera pour les deux boutons. Ceci est sans doute très générique, mais est un peu extrême tout de même.&lt;/p&gt;  &lt;p align="justify"&gt;Retournons dans le &lt;em&gt;control template&lt;/em&gt; du bouton (clic droit sur le bouton-&gt; &lt;em&gt;Edit template&lt;/em&gt;-&gt;&lt;em&gt;Edit Current&lt;/em&gt;), pointons vers le rectangle et surtout sa propriété Fill qui conditionne sa couleur (qui doit être bleue). Le principal défaut de cette option est qu'elle est inscrite "en dur" dans le &lt;em&gt;template&lt;/em&gt; du bouton. Et le but d'un &lt;em&gt;template&lt;/em&gt; est d'être générique, nous l'avons vu. Dans l'idéal,il nous faudrait trouver un moyen de conserver le &lt;em&gt;template &lt;/em&gt;édité, tout en obtenant la capacité de pouvoir simplement changer la valeur &lt;em&gt;fill&lt;/em&gt;,  et sans pour cela changer cette valeur pour tout les autres boutons de notre application qui partagent le gabarit. Imaginez aussi que le graphiste stockent tout ses templates dans un dictionnaire de ressources à part (comme il devrait toujours le faire). Si un développeur doit changer la valeur &lt;em&gt;background&lt;/em&gt; d'un bouton pour une raison ou une autre, il doit sortir de la page en cours, chercher, trouver et ouvrir le dictionnaire, isoler l'entrée du bouton, modifier le bouton, ce qui modifiera les autres.bref, un cauchemar.&lt;/p&gt;  &lt;p align="justify"&gt; &lt;/p&gt;  &lt;p align="justify"&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/Un-peu-de-gnricit_A3EE/Fill_2.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Fill" border="0" alt="Fill" src="http://labs.bewise.fr/Media/Windows-Live-Writer/Un-peu-de-gnricit_A3EE/Fill_thumb.jpg" width="244" height="134" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="justify"&gt; &lt;/p&gt;  &lt;p align="justify"&gt;Heureusement, le graphiste pourra trouver son bonheur en cliquant sur le petit carré jouxtant la case de couleur du&lt;em&gt; fill&lt;/em&gt;. Ce carré donne accès aux options avancées de la valeur et notamment aux contraintes (&lt;em&gt;bindings&lt;/em&gt;) que l'on peu associer à cette valeur. Dans le panneau déroulant, choisissez &lt;em&gt;Template binding&lt;/em&gt;. Cela permet de faire le tour des options pré-définies possibles pour la valeur &lt;em&gt;fill &lt;/em&gt;dans le &lt;em&gt;template &lt;/em&gt;natif de type bouton. Choisissez "&lt;em&gt;Background&lt;/em&gt;". Le petit carré et sa valeur sont dorénavant encadré de jaune. Cela signifie que nous avons contraint la valeur &lt;em&gt;fill&lt;/em&gt; à respecter une règle de type &lt;em&gt;background &lt;/em&gt;qui existe dans le &lt;em&gt;template&lt;/em&gt; natif du bouton. Pour simplifier, nous venons de recréer la liaison entre notre bouton et sa valeur &lt;em&gt;background&lt;/em&gt; native. Nous observons aussi que la couleur a changé et doit être maintenant affichée sous l'aspect d'un dégradé.&lt;/p&gt;  &lt;p align="justify"&gt; &lt;/p&gt;  &lt;p align="justify"&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/Un-peu-de-gnricit_A3EE/Binding_2.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Binding" border="0" alt="Binding" src="http://labs.bewise.fr/Media/Windows-Live-Writer/Un-peu-de-gnricit_A3EE/Binding_thumb.jpg" width="244" height="226" /&gt;&lt;/a&gt;  &lt;/p&gt;  &lt;p align="justify"&gt; &lt;/p&gt;  &lt;p&gt;Remontons encore une fois au niveau de notre interface et observons nos deux boutons. Ceux-ci partagent toujours le même gabarit, et sont donc bien génériques, mais disposent aussi de paramètres propres comme le "background". Nous venons donc de factoriser le gabarit de notre bouton et cela deviendra de plus en plus appréciable, au fur et à mesure que nous lui ajouterons du détail (comme des comportements sur des évènements de type roll-over, par exemple, ou encore des animations). Et plus le graphiste câblera les propriétés qu'il édite sur celles du contrôle natif, plus le développeur sera content. &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://labs.bewise.fr/Media/Windows-Live-Writer/Un-peu-de-gnricit_A3EE/Btn-fin_2.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Btn-fin" border="0" alt="Btn-fin" src="http://labs.bewise.fr/Media/Windows-Live-Writer/Un-peu-de-gnricit_A3EE/Btn-fin_thumb.jpg" width="244" height="183" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;De la généricité, encore et toujours, en somme.&lt;/p&gt;</description><a10:updated>2011-08-26T08:21:04+02:00</a10:updated></item></channel></rss>
