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

<channel>
	<title>THE .NET WAY &#187; C#</title>
	<atom:link href="http://www.thedotnetway.net/tag/c/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thedotnetway.net</link>
	<description>El blog Tecnológico de Emilio Torrens y Jordi Cladera</description>
	<lastBuildDate>Thu, 29 Jul 2010 08:27:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Persistencia de Objetos con XPO</title>
		<link>http://www.thedotnetway.net/2010/07/29/persistencia-de-objetos-con-xpo/</link>
		<comments>http://www.thedotnetway.net/2010/07/29/persistencia-de-objetos-con-xpo/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 08:18:22 +0000</pubDate>
		<dc:creator>Emilio Torrens</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Herramientas]]></category>
		<category><![CDATA[RAD]]></category>
		<category><![CDATA[SQLServer]]></category>

		<guid isPermaLink="false">http://www.thedotnetway.net/2010/07/29/persistencia-de-objetos-con-xpo/</guid>
		<description><![CDATA[Estos días estoy probando varias soluciones de persistencia de Objetos ya que estoy pensando seriamente dejar de usar Deklarit porque van muy lentos con las versiones. El primero que he probado ha sido XPO de DevExpress, es bastante potente y fácil de usar aunque el generador de clases desde una BD existente es un poco [...]]]></description>
			<content:encoded><![CDATA[<p><img style="margin: 0px 5px 0px 0px; display: inline;" src="http://boxcabi.files.wordpress.com/2010/01/devexpress.jpg" alt="" width="164" height="82" align="left" />Estos días estoy probando varias soluciones de persistencia de Objetos ya que estoy pensando seriamente dejar de usar <a href="http://www.deklarit.com" target="_blank">Deklarit</a> porque van muy lentos con las versiones.</p>
<p>El primero que he probado ha sido <a href="http://www.devexpress.com/Products/NET/ORM/" target="_blank">XPO</a> de <a href="http://www.devexpress.com/" target="_blank">DevExpress</a>, es bastante potente y fácil de usar aunque el generador de clases desde una BD existente es un poco pobre, no te genera las relaciones ni las tablas cuya PK este compuesta por varios campos, eso tendremos que solucionarlo a mano, aquí podéis ver como.</p>
<p>El tema de PK por múltiples campos se soluciona creando una estructura donde definimos la clave primaria y luego en la clase que mapeamos a la tabla definimos esa estructura como PK</p>
<div id="codeSnippetWrapper">
<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;">
<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;">
<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;"><span style="color: #0000ff;">public</span> <span style="color: #0000ff;">struct</span> MyTablePK</pre>
<p><!--CRLF--></p>
<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;">{</pre>
<p><!--CRLF--></p>
<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;">    [Persistent(<span style="color: #006080;">"Field1"</span>)]</pre>
<p><!--CRLF--></p>
<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;">    <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">string</span> FieldKey1;</pre>
<p><!--CRLF--></p>
<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;">    [Persistent(<span style="color: #006080;">"Field2"</span>)]</pre>
<p><!--CRLF--></p>
<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;">    <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">string</span> FiledKey2;</pre>
<p><!--CRLF--></p>
<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;">}</pre>
<p><!--CRLF--></p>
<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;"></pre>
<p><!--CRLF--></p>
<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;">[OptimisticLocking(<span style="color: #0000ff;">false</span>)]</pre>
<p><!--CRLF--></p>
<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;">[Persistent(<span style="color: #006080;">"Table"</span>)]</pre>
<p><!--CRLF--></p>
<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;"><span style="color: #0000ff;">public</span> <span style="color: #0000ff;">class</span> MyTable : XPBaseObject</pre>
<p><!--CRLF--></p>
<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;">{</pre>
<p><!--CRLF--></p>
<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;">    [Key(), Persistent()]</pre>
<p><!--CRLF--></p>
<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;">    <span style="color: #0000ff;">public</span> MyTablePK PK;</pre>
<p><!--CRLF--></p>
<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;">    <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">string</span> Field3;</pre>
<p><!--CRLF--></p>
<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;">    <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">string</span> Field4;</pre>
<p><!--CRLF--></p>
<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;">    <span style="color: #0000ff;">public</span> MyTable(Session session) : <span style="color: #0000ff;">base</span>(session) { }</pre>
<p><!--CRLF--></p>
<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;">    <span style="color: #0000ff;">public</span> MyTable() : <span style="color: #0000ff;">base</span>(Session.DefaultSession) { }</pre>
<p><!--CRLF--></p>
<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;">    <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">override</span> <span style="color: #0000ff;">void</span> AfterConstruction() { <span style="color: #0000ff;">base</span>.AfterConstruction(); }</pre>
<p><!--CRLF--></p>
<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;">}</pre>
<p><!--CRLF--></p>
</div>
</div>
</div>
<p>El tema de la relaciones se soluciona utilizando el atributo [Association] en la propiedad donde definimos la colección de objetos hijos indicándole el nombre que le hemos dado en el SQL al FK</p>
<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;">
<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;">
<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;">[OptimisticLocking(<span style="color: #0000ff;">false</span>)]</pre>
<p><!--CRLF--></p>
<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;">[Persistent(<span style="color: #006080;">"Table"</span>)]</pre>
<p><!--CRLF--></p>
<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;"><span style="color: #0000ff;">public</span> <span style="color: #0000ff;">class</span> MyTable : XPBaseObject</pre>
<p><!--CRLF--></p>
<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;">{</pre>
<p><!--CRLF--></p>
<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;">    [Key(<span style="color: #0000ff;">true</span>)]</pre>
<p><!--CRLF--></p>
<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;">    <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">int</span> PK;</pre>
<p><!--CRLF--></p>
<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;">    <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">string</span> Field1;</pre>
<p><!--CRLF--></p>
<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;">    <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">string</span> Field2;</pre>
<p><!--CRLF--></p>
<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;"></pre>
<p><!--CRLF--></p>
<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;">    [Association(<span style="color: #006080;">"Table-ChildTable"</span>, <span style="color: #0000ff;">typeof</span>(MyChildTable)), Aggregated]</pre>
<p><!--CRLF--></p>
<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;">    <span style="color: #0000ff;">public</span> XPCollection Childs</pre>
<p><!--CRLF--></p>
<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;">    {</pre>
<p><!--CRLF--></p>
<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;">        get { <span style="color: #0000ff;">return</span> GetCollection(<span style="color: #006080;">"MyChildTable"</span>); }</pre>
<p><!--CRLF--></p>
<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;">    }</pre>
<p><!--CRLF--></p>
<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;"></pre>
<p><!--CRLF--></p>
<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;">    <span style="color: #0000ff;">public</span> MyTable(Session session) : <span style="color: #0000ff;">base</span>(session) { }</pre>
<p><!--CRLF--></p>
<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;">    <span style="color: #0000ff;">public</span> MyTable() : <span style="color: #0000ff;">base</span>(Session.DefaultSession) { }</pre>
<p><!--CRLF--></p>
<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;">    <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">override</span> <span style="color: #0000ff;">void</span> AfterConstruction() { <span style="color: #0000ff;">base</span>.AfterConstruction(); }</pre>
<p><!--CRLF--></p>
<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;">}</pre>
<p><!--CRLF--></p>
<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;"></pre>
<p><!--CRLF--></p>
<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;"></pre>
<p><!--CRLF--></p>
<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;">[OptimisticLocking(<span style="color: #0000ff;">false</span>)]</pre>
<p><!--CRLF--></p>
<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;">[Persistent(<span style="color: #006080;">"ChilTable"</span>)]</pre>
<p><!--CRLF--></p>
<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;"><span style="color: #0000ff;">public</span> <span style="color: #0000ff;">class</span> MyChildTable : XPBaseObject</pre>
<p><!--CRLF--></p>
<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;">{</pre>
<p><!--CRLF--></p>
<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;">    <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">int</span> FK;</pre>
<p><!--CRLF--></p>
<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;">    <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">int</span> PK;</pre>
<p><!--CRLF--></p>
<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;">    <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">string</span> Field1;</pre>
<p><!--CRLF--></p>
<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;">    <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">string</span> Field2;</pre>
<p><!--CRLF--></p>
<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;">    <span style="color: #0000ff;">public</span> MyChildTable(Session session) : <span style="color: #0000ff;">base</span>(session) { }</pre>
<p><!--CRLF--></p>
<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;">    <span style="color: #0000ff;">public</span> MyChildTable() : <span style="color: #0000ff;">base</span>(Session.DefaultSession) { }</pre>
<p><!--CRLF--></p>
<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;">    <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">override</span> <span style="color: #0000ff;">void</span> AfterConstruction() { <span style="color: #0000ff;">base</span>.AfterConstruction(); }</pre>
<p><!--CRLF--></p>
<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;">}</pre>
<p><!--CRLF--></p>
</div>
</div>
<p>Pues nada, sigo probando cosas, ya iré comentando <img src='http://www.thedotnetway.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.thedotnetway.net/2010/07/29/persistencia-de-objetos-con-xpo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Control Silverlight RichtTextBox</title>
		<link>http://www.thedotnetway.net/2010/07/21/control-silverlight-richttextbox/</link>
		<comments>http://www.thedotnetway.net/2010/07/21/control-silverlight-richttextbox/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 14:11:54 +0000</pubDate>
		<dc:creator>Mario Andujar</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Controles]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Trucos]]></category>

		<guid isPermaLink="false">http://www.thedotnetway.net/2010/07/21/control-silverlight-richttextbox/</guid>
		<description><![CDATA[El otro día en el trabajo me pidieron si podía crear dos controles nuevos en Silverlight para poder introducir texto formateado y poder visionarlo. Buscando por la red encontré una opción gratuita bastante buena para lo que me pedían. El control en si se encuentra en http://www.vectorlight.net/demos/richtextbox.aspx y es un editor de texto bastante completo [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.thedotnetway.net/wp-content/uploads/2010/07/image.png"><img style="border-right-width: 0px; margin: 0px 5px 0px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" align="left" src="http://www.thedotnetway.net/wp-content/uploads/2010/07/image_thumb.png" width="205" height="161" /></a></p>
<p>El otro día en el trabajo me pidieron si podía crear dos controles nuevos en Silverlight para poder introducir texto formateado y poder visionarlo.</p>
<p>Buscando por la red encontré una opción gratuita bastante buena para lo que me pedían. El control en si se encuentra en <a href="http://www.vectorlight.net/demos/richtextbox.aspx">http://www.vectorlight.net/demos/richtextbox.aspx</a> y es un editor de texto bastante completo (tiene incluso un diccionario ortográfico para corregir errores de escritura y agregar nuevas definiciones). Solo con cambiar y poner las cuatro opciones que me pedían ya quedaron realizados estos dos controles.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thedotnetway.net/2010/07/21/control-silverlight-richttextbox/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Trabajar con Listas (Skip, Take y OrderBy)</title>
		<link>http://www.thedotnetway.net/2010/06/30/trabajar-con-listas-skip-take-y-orderby/</link>
		<comments>http://www.thedotnetway.net/2010/06/30/trabajar-con-listas-skip-take-y-orderby/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 11:00:15 +0000</pubDate>
		<dc:creator>Emilio Torrens</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[Trucos]]></category>

		<guid isPermaLink="false">http://www.thedotnetway.net/2010/06/30/trabajar-con-listas-skip-take-y-orderby/</guid>
		<description><![CDATA[Un poco de código para trabajar con listas. &#160; El otro día nos llegaba, en una lista de int, las edades de los paxes y querían que ordenáramos las de los niños de menor a mayor, de eso se puede sacar un ejemplo de uso de Take y Skip, G1 seria el numero de Adultos [...]]]></description>
			<content:encoded><![CDATA[<div id="codeSnippetWrapper"> Un poco de código para trabajar con listas.</div>
<div>&#160;</div>
<div>El otro día nos llegaba, en una lista de int, las edades de los paxes y querían que ordenáramos las de los niños de menor a mayor, de eso se puede sacar un ejemplo de uso de Take y Skip, G1 seria el numero de Adultos en la lista, G2 niños y G3 Bebes.</div>
<div>&#160;</div>
<div>
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">int</span> G1 = 2;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">int</span> G2 = 3;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">int</span> G3 = 1;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">List&lt;<span style="color: #0000ff">int</span>&gt; Valores = <span style="color: #0000ff">new</span> List&lt;<span style="color: #0000ff">int</span>&gt;() { 35, 25, 9, 4, 5, 0 };</pre>
<p><!--CRLF--><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #008000">//Cogemos los valores del segundo Grupo, los ordenamos y los metemos en </span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #008000">//una nueva lista</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">List&lt;<span style="color: #0000ff">int</span>&gt; ValoresG2 = Valores.Skip(G1).Take(G2).OrderBy(c =&gt; c).ToList();</pre>
<p><!--CRLF--><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #008000">//Creamos la lista resultado con los valores del Grupo 1, los del Grupo 2 </span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #008000">//Ordenado y el Grupo 3</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">List&lt;<span style="color: #0000ff">int</span>&gt; result = <span style="color: #0000ff">new</span> List&lt;<span style="color: #0000ff">int</span>&gt;();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">result.AddRange(Valores.Take(G1));</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">result.AddRange(ValoresG2);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">result.AddRange(Valores.Skip(G1 + G2));</pre>
<p><!--CRLF--></div>
</div>
<div>Ya se que se puede hacer en menos líneas, pero es un ejemplo !!!!! <img src='http://www.thedotnetway.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </div>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.thedotnetway.net/2010/06/30/trabajar-con-listas-skip-take-y-orderby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Objetos 2 byte[]</title>
		<link>http://www.thedotnetway.net/2010/05/11/objetos-2-byte/</link>
		<comments>http://www.thedotnetway.net/2010/05/11/objetos-2-byte/#comments</comments>
		<pubDate>Tue, 11 May 2010 09:26:40 +0000</pubDate>
		<dc:creator>Emilio Torrens</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Trucos]]></category>

		<guid isPermaLink="false">http://www.thedotnetway.net/2010/05/11/objetos-2-byte/</guid>
		<description><![CDATA[Estoy haciendo unas pruebas con un servicio de cache propio en el que guardamos los datos en byte[] en unos diccionarios, así que a quien pueda interesar, aquí os dejo los métodos de serializacion y desserializacion: public static byte[] ToByteArray(Object obj) { if (obj == null) return null; MemoryStream ms = new MemoryStream(); BinaryFormatter b [...]]]></description>
			<content:encoded><![CDATA[<p>Estoy haciendo unas pruebas con un servicio de cache propio en el que guardamos los datos en byte[] en unos diccionarios, así que a quien pueda interesar, aquí os dejo los métodos de serializacion y desserializacion:</p>
<pre class="code"><span style="color: blue">public static byte</span>[] ToByteArray(<span style="color: #2b91af">Object </span>obj)
{
    <span style="color: blue">if </span>(obj == <span style="color: blue">null</span>) <span style="color: blue">return null</span>;

    <span style="color: #2b91af">MemoryStream </span>ms = <span style="color: blue">new </span><span style="color: #2b91af">MemoryStream</span>();
    <span style="color: #2b91af">BinaryFormatter </span>b = <span style="color: blue">new </span><span style="color: #2b91af">BinaryFormatter</span>();
    b.Serialize(ms, obj);
    <span style="color: blue">byte</span>[] data = ms.ToArray();
    ms.Close();
    <span style="color: blue">return </span>data;
}

<span style="color: blue">public static </span>T ToObjectSerialize&lt;T&gt;(<span style="color: blue">byte</span>[] serializedObject)
{
    <span style="color: blue">if </span>(serializedObject == <span style="color: blue">null</span>) <span style="color: blue">return default</span>(T);

    <span style="color: #2b91af">MemoryStream </span>ms = <span style="color: blue">new </span><span style="color: #2b91af">MemoryStream</span>();
    ms.Write(serializedObject, 0, serializedObject.Length);
    ms.Seek(0, 0);
    <span style="color: #2b91af">BinaryFormatter </span>b = <span style="color: blue">new </span><span style="color: #2b91af">BinaryFormatter</span>();
    <span style="color: #2b91af">Object </span>obj = b.Deserialize(ms);
    ms.Close();
    <span style="color: blue">return </span>(T)obj;
}</pre>
<p><a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.thedotnetway.net/2010/05/11/objetos-2-byte/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cliente C# para Velocity</title>
		<link>http://www.thedotnetway.net/2010/04/14/cliente-c-para-velocity/</link>
		<comments>http://www.thedotnetway.net/2010/04/14/cliente-c-para-velocity/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 13:20:26 +0000</pubDate>
		<dc:creator>Emilio Torrens</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Microsoft App Fabric]]></category>
		<category><![CDATA[Trucos]]></category>
		<category><![CDATA[Velocity]]></category>

		<guid isPermaLink="false">http://www.thedotnetway.net/2010/04/14/cliente-c-para-velocity/</guid>
		<description><![CDATA[Hoy he estado liado con este tema con unas pruebas básicas para probar el Cache del AppFabric El Windows Server AppFabric Beta 2 lo he instalado en un Windows Server 2008 con el Framework 4.0 RC, ojo que tiene que ser el RC no puede ser el final, además tiene otros requisitos con el Windows [...]]]></description>
			<content:encoded><![CDATA[<p><img style="display: inline; margin-left: 0px; margin-right: 0px" align="left" src="http://t0.gstatic.com/images?q=tbn:-glskV4UnGZV6M:http://blogs.msdn.com/photos/skaufman/images/9948637/original.aspx" />Hoy he estado liado con este tema con unas pruebas básicas para probar el Cache del <a href="http://msdn.microsoft.com/en-us/windowsserver/ee695849.aspx" target="_blank">AppFabric</a></p>
<p>El <a href="http://go.microsoft.com/fwlink/?LinkID=169435" target="_blank">Windows Server AppFabric Beta 2</a> lo he instalado en un Windows Server 2008 con el Framework 4.0 RC, ojo que tiene que ser el RC no puede ser el final, además tiene otros requisitos con el Windows Power Shell 2.0 RTM y algunas cosas mas, pero el instalador te avisa y te dice de donde bajarlos.</p>
<p>El cliente en C# con VS2010 y Framework 4.0, recién salido del horno <img src='http://www.thedotnetway.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Creamos el proyecto cliente y le añadimos esta referencias del AppFabric (Encontraremos las dll en la carpeta C:\Windows\System32\AppFabric del servidor donde lo hayamos instalado</p>
<ul>
<li>Microsoft.ApplicationServer.Caching.Client.dll </li>
<li>Microsoft.ApplicationServer.Caching.Core.dll </li>
<li>Microsoft.WindowsFabric.Common.dll </li>
<li>Microsoft.WindowsFabric.Data.Common.dll </li>
</ul>
<p>Podemos configurar el cliente por código o en el AppConfig.</p>
<p>Por código:</p>
<pre class="code"><span style="color: blue">private </span><span style="color: #2b91af">DataCache </span>Client
 {
     <span style="color: blue">get
     </span>{
         <span style="color: blue">if </span>(dataCache != <span style="color: blue">null</span>) <span style="color: blue">return </span>dataCache;

         <span style="color: green">// Aqui los servidores de cache en este caso 1.
         </span><span style="color: #2b91af">DataCacheServerEndpoint</span>[] servers = <span style="color: blue">new </span><span style="color: #2b91af">DataCacheServerEndpoint</span>[1];
         servers[0] = <span style="color: blue">new </span><span style="color: #2b91af">DataCacheServerEndpoint</span>(<span style="color: #a31515">&quot;CACHESERVER&quot;</span>, 22233);

         <span style="color: #2b91af">DataCacheFactoryConfiguration </span>factoryConfig =
                                       <span style="color: blue">new </span><span style="color: #2b91af">DataCacheFactoryConfiguration</span>();
         factoryConfig.Servers = servers;

         <span style="color: #2b91af">DataCacheFactory </span>mycacheFactory = <span style="color: blue">new </span><span style="color: #2b91af">DataCacheFactory</span>(factoryConfig);

         <span style="color: green">//El Cache, en este caso el que pone por defecto al instalarlo
         </span><span style="color: #2b91af">DataCache </span>myDefaultCache = mycacheFactory.GetCache(<span style="color: #a31515">&quot;default&quot;</span>);

         dataCache = myDefaultCache;
         <span style="color: blue">return </span>dataCache;
     }
 }</pre>
<p>Por configuración:</p>
<p>App.config:</p>
<pre class="code"><span style="color: blue">&lt;?</span><span style="color: #a31515">xml </span><span style="color: red">version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0</span>&quot; <span style="color: red">encoding</span><span style="color: blue">=</span>&quot;<span style="color: blue">utf-8</span>&quot; <span style="color: blue">?&gt;
&lt;</span><span style="color: #a31515">configuration</span><span style="color: blue">&gt;
  &lt;!--</span><span style="color: green">configSections must be the FIRST element </span><span style="color: blue">--&gt;
  &lt;</span><span style="color: #a31515">configSections</span><span style="color: blue">&gt;
    &lt;!-- </span><span style="color: green">required to read the &lt;dataCacheClient&gt; element </span><span style="color: blue">--&gt;
    &lt;</span><span style="color: #a31515">section </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">dataCacheClient</span>&quot;
       <span style="color: red">type</span><span style="color: blue">=</span>&quot;<span style="color: blue">Microsoft.ApplicationServer.Caching.DataCacheClientSection,
            Microsoft.ApplicationServer.Caching.Core, Version=1.0.0.0,
            Culture=neutral, PublicKeyToken=31bf3856ad364e35</span>&quot;
       <span style="color: red">allowLocation</span><span style="color: blue">=</span>&quot;<span style="color: blue">true</span>&quot;
       <span style="color: red">allowDefinition</span><span style="color: blue">=</span>&quot;<span style="color: blue">Everywhere</span>&quot;<span style="color: blue">/&gt;
  &lt;/</span><span style="color: #a31515">configSections</span><span style="color: blue">&gt;

  &lt;</span><span style="color: #a31515">dataCacheClient</span><span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">hosts</span><span style="color: blue">&gt;
      &lt;</span><span style="color: #a31515">host </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">CACHESERVER</span>&quot; <span style="color: red">cachePort</span><span style="color: blue">=</span>&quot;<span style="color: blue">22233</span>&quot;<span style="color: blue">/&gt;
    &lt;/</span><span style="color: #a31515">hosts</span><span style="color: blue">&gt;
  &lt;/</span><span style="color: #a31515">dataCacheClient</span><span style="color: blue">&gt;
&lt;/</span><span style="color: #a31515">configuration</span><span style="color: blue">&gt;
</span></pre>
<p>Codigo:</p>
<pre class="code"><span style="color: blue">private </span><span style="color: #2b91af">DataCache </span>Client
      {
          <span style="color: blue">get
          </span>{
              <span style="color: blue">if </span>(dataCache != <span style="color: blue">null</span>) <span style="color: blue">return </span>dataCache;

              <span style="color: green">//Configurado en el app.config
              </span><span style="color: #2b91af">DataCacheFactory </span>mycacheFactory = <span style="color: blue">new </span><span style="color: #2b91af">DataCacheFactory</span>();

              <span style="color: green">// Get a cache client for the cache &quot;default&quot;.
              </span><span style="color: #2b91af">DataCache </span>myDefaultCache = mycacheFactory.GetCache(<span style="color: #a31515">&quot;default&quot;</span>);

              dataCache = myDefaultCache;
              <span style="color: blue">return </span>dataCache;
          }
      }</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>Y listo para probarlo:</p>
<pre class="code"><span style="color: blue">private void </span>Test()
{
    <span style="color: #2b91af">DataCache </span>cliente = Client;

    cliente.Add(<span style="color: #a31515">&quot;key&quot;</span>, <span style="color: #a31515">&quot;data&quot;</span>);
    <span style="color: blue">object </span>data = cliente.Get(<span style="color: #a31515">&quot;key&quot;</span>);
    cliente.Remove(<span style="color: #a31515">&quot;key&quot;</span>);
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.thedotnetway.net/2010/04/14/cliente-c-para-velocity/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Capturar evento click derecho con SilverLight</title>
		<link>http://www.thedotnetway.net/2010/03/17/capturar-evento-click-derecho/</link>
		<comments>http://www.thedotnetway.net/2010/03/17/capturar-evento-click-derecho/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 15:40:31 +0000</pubDate>
		<dc:creator>Emilio Torrens</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET Framework]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Trucos]]></category>

		<guid isPermaLink="false">http://www.thedotnetway.net/2010/03/17/capturar-evento-click-derecho/</guid>
		<description><![CDATA[Aquí vemos como capturar el evento del botón derecho en silverlight. Este evento desde la salida de silverlight ha estado inactivo, y dicen que en la siguiente versión, silverlight 4, estará disponible (también dijeron eso en la versión 3). Cuando haces click derecho en la aplicación Silverlight te muestra un menú contextual y un dialogo [...]]]></description>
			<content:encoded><![CDATA[<p>Aquí vemos como capturar el evento del botón derecho en silverlight.</p>
<p>Este evento desde la salida de silverlight ha estado inactivo, y dicen que en la siguiente versión, silverlight 4, estará disponible (también dijeron eso en la versión 3).</p>
<p>Cuando haces click derecho en la aplicación Silverlight te muestra un menú contextual y un dialogo de configuración.</p>
<p>¿Y si quieres usar el botón derecho en tu aplicación silverlight? El proceso es muy sencillo, y aquí os detallare unos pasos que deberéis de seguir para poder utilizar dicho evento y mostrar un menú contextual propio.</p>
<p><strong>Paso 1: </strong>Tenemos que establecer el control de Silverlight para ventanas. En la pagina web del proyecto (suele ser default.aspx) que contiene el control Silverlight añadir la etiqueta<em>windowless=&#8221;true&#8221;. </em></p>
<p><strong>Paso 2: </strong>Introducimos el contextmenu donde queramos capturar el evento click derecho. Dentro del xaml creamos una nueva clase llamada ContextMenuInterceptor. En el constructor de esta clase capturamos un evento llamado &#8220;OnContextMenu&#8221; con HtmlPage.Document.AttachEvent (deberás agregar la referencia System.Window.Browser).</p>
<p>Dentro de este evento llamamos a e.PeventDefault(). Esto cancela la propagación del evento click derecho para que silverlight no lo reciba (así no mostrará su menu contextual).</p>
<p>En este punto, es cuando usted esta capturando el evento y podra mostrar o hacer cualquier cosa. En el ejemplo que pongo a continuación utilizo yo un TextBlock para mostrar cuando capturamos el click derecho.</p>
<p>Page.xml.cs</p>
<pre class="csharpcode"><span class="kwrd">using</span> System;
<span class="kwrd">using</span> System.Collections.Generic;
<span class="kwrd">using</span> System.Linq;
<span class="kwrd">using</span> System.Net;
<span class="kwrd">using</span> System.Windows;
<span class="kwrd">using</span> System.Windows.Controls;
<span class="kwrd">using</span> System.Windows.Documents;
<span class="kwrd">using</span> System.Windows.Input;
<span class="kwrd">using</span> System.Windows.Media;
<span class="kwrd">using</span> System.Windows.Media.Animation;
<span class="kwrd">using</span> System.Windows.Shapes;
<span class="kwrd">using</span> System.Windows.Browser;

<span class="kwrd">namespace</span> SilverlightApplication15
{
    <span class="kwrd">public</span> <span class="kwrd">partial</span> <span class="kwrd">class</span> Page : UserControl
    {
        ContextMenuInterceptor _cmi = <span class="kwrd">null</span>;
        <span class="kwrd">public</span> Page()
        {
            InitializeComponent();
            _cmi = <span class="kwrd">new</span> ContextMenuInterceptor(MyField);
        }
    }       

    <span class="kwrd">public</span> <span class="kwrd">class</span> ContextMenuInterceptor
    {
        TextBlock TextField;

        <span class="kwrd">public</span> ContextMenuInterceptor(TextBlock textField)
        {
            TextField = textField;
            HtmlPage.Document.AttachEvent(<span class="str">"oncontextmenu"</span>, <span class="kwrd">this</span>.OnContextMenu);
        }

        <span class="kwrd">private</span> <span class="kwrd">void</span> OnContextMenu(<span class="kwrd">object</span> sender, HtmlEventArgs e)
        {
            TextField.Text = <span class="str">"Right Clicked Blocked at "</span>+e.OffsetX+<span class="str">","</span>+e.OffsetY;
            e.PreventDefault();
        }
    }
}<!-- .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; } --></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.thedotnetway.net/2010/03/17/capturar-evento-click-derecho/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dependency Injection con Microsoft.Practices.Unity</title>
		<link>http://www.thedotnetway.net/2010/03/11/dependency-injection-con-microsoft-practices-unity/</link>
		<comments>http://www.thedotnetway.net/2010/03/11/dependency-injection-con-microsoft-practices-unity/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 11:43:00 +0000</pubDate>
		<dc:creator>Emilio Torrens</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET Framework]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Trucos]]></category>

		<guid isPermaLink="false">http://www.thedotnetway.net/2010/03/11/dependency-injection-con-microsoft-practices-unity/</guid>
		<description><![CDATA[Microsoft.Practices.Unity&#160; nos permite mapear una Clase a un Interface a través de una configuración en el .config de la aplicación, de esta manera podemos cambiar el comportamiento o el escenario en el que esta se ejecuta la aplicación tocando solo esa configuración. Aquí dejo un ejemplo básico: 1-Creamos el Interface public interface IMessage { string [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://unity.codeplex.com/" target="_blank">Microsoft.Practices.Unity</a>&#160; nos permite mapear una Clase a un Interface a través de una configuración en el .config de la aplicación, de esta manera podemos cambiar el comportamiento o el escenario en el que esta se ejecuta la aplicación tocando solo esa configuración.</p>
<p>Aquí dejo un ejemplo básico:</p>
<p>1-Creamos el Interface </p>
<pre class="csharpcode"><span class="kwrd">public</span> <span class="kwrd">interface</span> IMessage
{
    <span class="kwrd">string</span> Get();
}</pre>
<style type="text/css">
<p>.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; }</style>
<p>2-Creamos las clases que implementan el interface </p>
<pre class="csharpcode"><span class="kwrd">public</span> <span class="kwrd">class</span> Message1 : IMessage
{
    <span class="kwrd">public</span> <span class="kwrd">string</span> Get()
    {
        <span class="kwrd">return</span> <span class="str">&quot;Desde Message 1&quot;</span>;
    }
}

<span class="kwrd">public</span> <span class="kwrd">class</span> Message2 : IMessage
{
    <span class="kwrd">public</span> <span class="kwrd">string</span> Get()
    {
        <span class="kwrd">return</span> <span class="str">&quot;Desde Message 2&quot;</span>;
    }
}</pre>
<style type="text/css">
<p>.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; }</style>
<p>3-Creamos la clase donde usaremos el Interface, en esta debemos definir un campo del tipo del interface marcado como [Dependency] y un método de load para cargar la clase que corresponde en el interface</p>
</p>
<pre class="csharpcode"><span class="kwrd">public</span> <span class="kwrd">class</span> Message
{
    [Dependency]
    <span class="kwrd">public</span> IMessage IMessage { get; set; }

    <span class="kwrd">public</span> <span class="kwrd">static</span> Message Instance
    {
        get
        {
            <span class="kwrd">using</span> (IUnityContainer container = <span class="kwrd">new</span> UnityContainer())
            {
                UnityConfigurationSection ConfigurationSection =
                    (UnityConfigurationSection)
                    ConfigurationManager.GetSection(<span class="str">&quot;DITest&quot;</span>);
                ConfigurationSection.Containers.Default.Configure(container);
                Message objMessage = container.Resolve&lt;Message&gt;();
                <span class="kwrd">return</span> objMessage;
            }
        }
    }
}</pre>
<style type="text/css">
<p>.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; }</style>
<p>4-Creamos el archivo de configuración donde hacemos el mapeo</p>
<pre class="csharpcode">&lt;?xml version=<span class="str">&quot;1.0&quot;</span> encoding=<span class="str">&quot;utf-8&quot;</span> ?&gt;
&lt;configuration&gt;
  &lt;configSections&gt;
  &lt;section name=<span class="str">&quot;DITest&quot;</span>
           type=<span class="str">&quot;Microsoft.Practices.Unity.Configuration.
                       UnityConfigurationSection,
                 Microsoft.Practices.Unity.Configuration&quot;</span>/&gt;
  &lt;/configSections&gt;
  &lt;DITest&gt;
    &lt;containers&gt;
      &lt;container&gt;
        &lt;types&gt;
          &lt;type type=<span class="str">&quot;DITest.IMessage,DITest&quot;</span>
                mapTo=<span class="str">&quot;DITest.Message2,DITest&quot;</span>/&gt;
        &lt;/types&gt;
      &lt;/container&gt;
    &lt;/containers&gt;
  &lt;/DITest&gt;
&lt;/configuration&gt;</pre>
<p>5-Probamos el código desde la consola y vamos cambiando el “mapTo” del archivo de configuración para ir viendo el cambio</p>
<pre class="csharpcode"><span class="kwrd">class</span> Program
{
    <span class="kwrd">static</span> <span class="kwrd">void</span> Main(<span class="kwrd">string</span>[] args)
    {
        Console.WriteLine(Message.Instance.IMessage.Get());
        Console.ReadLine();
    }
}</pre>
<style type="text/css">
.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; }</style>
]]></content:encoded>
			<wfw:commentRss>http://www.thedotnetway.net/2010/03/11/dependency-injection-con-microsoft-practices-unity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SoapHeader, SoapExtensions y Herencia</title>
		<link>http://www.thedotnetway.net/2009/12/03/soapheader-soapextensions-y-herencia/</link>
		<comments>http://www.thedotnetway.net/2009/12/03/soapheader-soapextensions-y-herencia/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 10:31:37 +0000</pubDate>
		<dc:creator>Emilio Torrens</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET Framework]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Trucos]]></category>
		<category><![CDATA[WebServices]]></category>

		<guid isPermaLink="false">http://www.thedotnetway.net/2009/12/03/soapheader-soapextensions-y-herencia/</guid>
		<description><![CDATA[Hace unos días Jordi escribió sobre las SoapExtensions y yo sobre las SoapHeaders, hoy le añadimos herencia y vemos como ahorrarnos bastante código y trabajo en una capa de servicios. La idea es que todos los métodos de todos los servicios web de la aplicación se autentifiquen en el mismo sitio y no tener que [...]]]></description>
			<content:encoded><![CDATA[<p>Hace unos días Jordi escribió sobre las <a href="http://www.thedotnetway.net/2009/10/07/soap-extension/" target="_blank">SoapExtensions</a> y yo sobre las <a href="http://www.thedotnetway.net/2009/11/27/cabeceras-en-mensajes-soap/" target="_blank">SoapHeaders</a>, hoy le añadimos herencia y vemos como ahorrarnos bastante código y trabajo en una capa de servicios. <img src='http://www.thedotnetway.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>La idea es que todos los métodos de todos los servicios web de la aplicación se autentifiquen en el mismo sitio y no tener que poner el código de autentificación en cada método, además no queremos usar cookies ni mantenimiento de sesión.</p>
<p>Para esto usaremos una Cabecera Soap donde el cliente nos enviara Usuario y Contraseña, debemos crear la clase cabecera:</p>
<p><span style="color: blue">public class </span><span style="color: #2b91af">SoapHeaderCredentials </span>: <span style="color: #2b91af">SoapHeader      <br /></span>{     <br />&#160;&#160;&#160; <span style="color: blue">public string </span>Password = <span style="color: #a31515">&quot;&quot;</span>;     <br />&#160;&#160;&#160; <span style="color: blue">public string </span>UserName = <span style="color: #a31515">&quot;&quot;</span>;     <br />}</p>
<p> <a href="http://11011.net/software/vspaste"></a>
<p>Cada servicio web tiene que tener una propiedad con la Cabecera, para ahorrarnos el escribirlo cada vez, creamos una clase que herede de WebService, que contenga la propiedad y heredamos los servicios web de esa clase:</p>
<pre class="code"><span style="color: blue">public class </span><span style="color: #2b91af">MyWebService </span>: System.Web.Services.<span style="color: #2b91af">WebService
</span>{
    <span style="color: blue">public </span><span style="color: #2b91af">SoapHeaderCredentials </span>soapHeaderCredentials;
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<pre class="code"><span style="color: blue">public class </span><span style="color: #2b91af">Service </span>: <span style="color: #2b91af">MyWebService</span></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>Después creamos una Extensión Soap de autentificación (en este caso la llamamos AuthenticationExtension), Jordi ya <a href="http://www.thedotnetway.net/2009/10/07/soap-extension/" target="_blank">explica aquí</a> como crearlas así que solo pongo el código que nos interesa, que es donde buscamos la Cabecera Soap en el Método ProcessMessage:</p>
<pre class="code"><span style="color: blue">case </span><span style="color: #2b91af">SoapMessageStage</span>.AfterDeserialize:
{
    <span style="color: blue">var </span>o = <span style="color: blue">from </span>h <span style="color: blue">in </span>message.Headers.Cast&lt;<span style="color: #2b91af">SoapHeader</span>&gt;()
            <span style="color: blue">where </span>h.GetType() == <span style="color: blue">typeof</span>(<span style="color: #2b91af">SoapHeaderCredentials</span>)
            <span style="color: blue">select </span>h ;
    <span style="color: #2b91af">SoapHeaderCredentials </span>soapHeaderCredentials =
        (<span style="color: #2b91af">SoapHeaderCredentials</span>) o.First();
    AuthenticateUser(
        <span style="color: blue">new </span><span style="color: #2b91af">Credentials</span>()
        {
          UserName = soapHeaderCredentials.UserName,
          Password = soapHeaderCredentials.Password,
        }, </pre>
<pre class="code">      );
    <span style="color: blue">break</span>;
}</pre>
<p><a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a></p>
<p>Después solo queda añadir los dos atributos [SoapHeader(&quot;soapHeaderCredentials&quot;)]&#160; y [AuthenticationExtension()] a nuestros WebMethods, eso hará que los métodos tengan la cabecera de usuario y contraseña y que ejecuten el código de autentificación al recibir un mensaje:</p>
<pre class="code">[<span style="color: #2b91af">WebMethod</span>]
[<span style="color: #2b91af">SoapHeader</span>(<span style="color: #a31515">&quot;soapHeaderCredentials&quot;</span>)]
[<span style="color: #2b91af">AuthenticationExtension</span>()]
<span style="color: blue">public string </span>HelloWorld()
{
    <span style="color: blue">return </span><span style="color: #a31515">&quot;Hello World&quot;</span>;
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>Y listo <img src='http://www.thedotnetway.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.thedotnetway.net/2009/12/03/soapheader-soapextensions-y-herencia/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Serializar y Deserializar nuestras clases</title>
		<link>http://www.thedotnetway.net/2009/11/30/serializar-y-deserializar-nuestras-clases/</link>
		<comments>http://www.thedotnetway.net/2009/11/30/serializar-y-deserializar-nuestras-clases/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 16:47:01 +0000</pubDate>
		<dc:creator>Emilio Torrens</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET Framework]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Trucos]]></category>

		<guid isPermaLink="false">http://www.thedotnetway.net/2009/11/30/serializar-y-deserializar-nuestras-clases/</guid>
		<description><![CDATA[Es sencillo obtener una representación XML de nuestras clases con el método ToString, solo hemos de sobrescribirlo por este: public override string ToString() { XmlSerializer ser = new XmlSerializer(this.GetType()); StringWriter sw = new StringWriter(); ser.Serialize(sw, this); sw.Flush(); sw.Close(); return sw.ToString(); } También podemos crearlas desde su representación XML: public static MyClass CreateFromXml(string xml) { XmlSerializer [...]]]></description>
			<content:encoded><![CDATA[<p>Es sencillo obtener una representación XML de nuestras clases con el método ToString, solo hemos de sobrescribirlo por este:</p>
<pre class="code"><span style="color: blue">public override string </span>ToString()
{
    <span style="color: #2b91af">XmlSerializer </span>ser = <span style="color: blue">new </span><span style="color: #2b91af">XmlSerializer</span>(<span style="color: blue">this</span>.GetType());
    <span style="color: #2b91af">StringWriter </span>sw = <span style="color: blue">new </span><span style="color: #2b91af">StringWriter</span>();

    ser.Serialize(sw, <span style="color: blue">this</span>);

    sw.Flush();
    sw.Close();
    <span style="color: blue">return </span>sw.ToString();
}</pre>
<p>También podemos crearlas desde su representación XML:</p>
<div align="left">
<pre class="code"><span style="color: blue">public static </span><span style="color: #2b91af">MyClass </span>CreateFromXml(<span style="color: blue">string </span>xml)
{
    <span style="color: #2b91af">XmlSerializer </span>ser = <span style="color: blue">new </span><span style="color: #2b91af">XmlSerializer</span>(<span style="color: blue">typeof</span>(<span style="color: #2b91af">MyClass</span>));
    <span style="color: #2b91af">StringWriter </span>sw = <span style="color: blue">new </span><span style="color: #2b91af">StringWriter</span>();

    <span style="color: blue">return </span>(<span style="color: #2b91af">MyClass</span>) ser.Deserialize(<span style="color: blue">new </span><span style="color: #2b91af">StringReader</span>(xml));
}</pre>
<p>  <a href="http://11011.net/software/vspaste"></a></div>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>Todo el Código de ejemplo:</p>
<p><a href="http://11011.net/software/vspaste"></a></p>
<pre class="code"><span style="color: blue">public class </span><span style="color: #2b91af">MyClass
</span>{
    <span style="color: blue">public string </span>Data1 { <span style="color: blue">get</span>; <span style="color: blue">set</span>; }
    <span style="color: blue">public string </span>Data2 { <span style="color: blue">get</span>; <span style="color: blue">set</span>; }

    <span style="color: blue">public static </span><span style="color: #2b91af">MyClass </span>CreateFromXml(<span style="color: blue">string </span>xml)
    {
        <span style="color: #2b91af">XmlSerializer </span>ser = <span style="color: blue">new </span><span style="color: #2b91af">XmlSerializer</span>(<span style="color: blue">typeof</span>(<span style="color: #2b91af">MyClass</span>));
        <span style="color: #2b91af">StringWriter </span>sw = <span style="color: blue">new </span><span style="color: #2b91af">StringWriter</span>();

        <span style="color: blue">return </span>(<span style="color: #2b91af">MyClass</span>) ser.Deserialize(<span style="color: blue">new </span><span style="color: #2b91af">StringReader</span>(xml));
    }

    <span style="color: blue">public override string </span>ToString()
    {
        <span style="color: #2b91af">XmlSerializer </span>ser = <span style="color: blue">new </span><span style="color: #2b91af">XmlSerializer</span>(<span style="color: blue">this</span>.GetType());
        <span style="color: #2b91af">StringWriter </span>sw = <span style="color: blue">new </span><span style="color: #2b91af">StringWriter</span>();

        ser.Serialize(sw, <span style="color: blue">this</span>);

        sw.Flush();
        sw.Close();
        <span style="color: blue">return </span>sw.ToString();
    }

    <span style="color: blue">public void </span>Test()
    {
        <span style="color: #2b91af">MyClass </span>c = <span style="color: blue">new </span><span style="color: #2b91af">MyClass</span>();
        c.Data1 = <span style="color: #a31515">&quot;Hola&quot;</span>;
        c.Data2 = <span style="color: #a31515">&quot;Como Estas&quot;</span>;

        <span style="color: blue">string </span>xMyClass = c.ToString();

        <span style="color: #2b91af">MyClass </span>copy = <span style="color: #2b91af">MyClass</span>.CreateFromXml(xMyClass);
    }
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>Nos puede ser muy útil para temas de log, guardar los datos en las desconexiones, para debugear o para transportar la clases en XML entre aplicaciones.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thedotnetway.net/2009/11/30/serializar-y-deserializar-nuestras-clases/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MonoTouch o C# para IPhone</title>
		<link>http://www.thedotnetway.net/2009/09/30/monotouch-o-c-para-iphone/</link>
		<comments>http://www.thedotnetway.net/2009/09/30/monotouch-o-c-para-iphone/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 08:39:08 +0000</pubDate>
		<dc:creator>Emilio Torrens</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[IPhone]]></category>
		<category><![CDATA[Mono]]></category>

		<guid isPermaLink="false">http://www.thedotnetway.net/2009/09/30/monotouch-o-c-para-iphone/</guid>
		<description><![CDATA[MonoTouch permite a los programadores .NET desarrollar aplicaciones en C# y ejecutarlas en el IPhone o el IPod Touch. Necesitas un MAC para programarlo, además del SDK de IPhone, si encima quieres probar tu código en un IPhone o tener la posibilidad de distribuir tus aplicaciones tienes que formar parte del “Apple’s IPhone Developers Program” [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://monotouch.net/" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="MonoTouch" border="0" alt="MonoTouch" align="left" src="http://www.thedotnetway.net/wp-content/uploads/2009/09/MonoTouch.jpg" width="114" height="212" /></a><a href="http://monotouch.net/" target="_blank">MonoTouch</a> permite a los programadores .NET desarrollar aplicaciones en <a href="http://es.wikipedia.org/wiki/C_Sharp" target="_blank">C#</a> y ejecutarlas en el IPhone o el IPod Touch.</p>
<p>Necesitas un MAC para programarlo, además del SDK de IPhone, si encima quieres probar tu código en un IPhone o tener la posibilidad de distribuir tus aplicaciones tienes que formar parte del “Apple’s IPhone Developers Program”</p>
<p>Es de pago y se presenta en 3 versiones, Profesional,&#160; Enterprise y Enterprise 5, <a href="http://monotouch.net/Store" target="_blank">aquí puedes ver las diferencias en las versiones</a>, aunque tienes una <a href="http://monotouch.net/DownloadTrial" target="_blank">versión Trial</a> si te interesa pegarle un vistazo <img src='http://www.thedotnetway.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>&#160;</p>
<p>Como principales características:</p>
<ul>
<li>C# y .NET en el iPhone </li>
<li>.NET Bindings al API Nativo </li>
<li>Posibilidad de Distribucion en el Apple App Store </li>
<li>Integración con MonoDevelop </li>
<li>Integración con XCode </li>
</ul>
<p>Yo no creo que me lie con esto a no ser que algún cliente me “obligue” pero Jordi seguro que si, así que ya pondrá algo <img src='http://www.thedotnetway.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.thedotnetway.net/2009/09/30/monotouch-o-c-para-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
