<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;CE4DSHozeyp7ImA9WhRaE0Q.&quot;"><id>tag:blogger.com,1999:blog-2792201692341009334</id><updated>2012-02-16T11:49:39.483Z</updated><title>Sharp Develop Blog</title><subtitle type="html">Blog about programming, jquery, ajax, web technologies, solution's arquitecture, and more!</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://sharpdevpt.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://sharpdevpt.blogspot.com/" /><author><name>Ricardo Rodrigues</name><uri>http://www.blogger.com/profile/07328669019913577877</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>21</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/SharpDevelopBlog" /><feedburner:info uri="sharpdevelopblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;CkANQHYyfCp7ImA9Wx5VEkw.&quot;"><id>tag:blogger.com,1999:blog-2792201692341009334.post-4587669608145323629</id><published>2010-10-04T16:02:00.004+01:00</published><updated>2010-10-04T17:46:31.894+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-04T17:46:31.894+01:00</app:edited><title>Using MEF to extend applications</title><content type="html">I'm back for another post, haven't posted for a long time now and hope to never do so again.&lt;br /&gt;
&lt;br /&gt;
Getting to the point here, today I started using MEF, after months of tech talks, webcasts and tutorials, and I have to admit, it's really easy, clean and effective.&lt;br /&gt;
&lt;br /&gt;
My scenario is this:&lt;br /&gt;
&lt;br /&gt;
I have an application that needs to have a caching system, which will be implemented on a different project, and needs to abstract itself from the caching system being use.&lt;br /&gt;
So I coded an interface, obviously, to define what does the caching system need to implement.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: csharp"&gt;public interface IPersist
  {
    void SaveToCache(string key, string payload, List&lt; guid &gt; contentIds);

    string GetFromCache(string key);

    void RefreshCache(string contentId);
  }
&lt;/pre&gt;&lt;br /&gt;
Then I created two example caching classes that implement this interface, which both reside on different visual studio projects:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: csharp"&gt;[Export(typeof(IPersist))]
public class MemoryCache : IPersist
{

  public void SaveToCache(string key, string payload, List&lt; guid &gt; contentIds)
  {
    Console.WriteLine("memory cache " + key + " " + payload + " " + contentIds.Count.ToString());
  }

  public string GetFromCache(string key)
  {
    throw new NotImplementedException();
  }

  public void RefreshCache(string contentId)
  {
    throw new NotImplementedException();
  }
}
&lt;/pre&gt;&lt;br /&gt;
So, we have an interface named IPersist, we have two classes that implement this interface, and now we need to dinamically load one of these classes on our application, so we cannot add a reference to neither of them, because that way we would have to change our code each time we changed class, so how do we do it?&lt;br /&gt;
&lt;br /&gt;
Our application code looks like this:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: csharp"&gt;public partial class App : Application
  {
    private IPersist cacheSystem { get; set; }

    public App()
    {

      //something is missing here, how to load the assembly we want?

      cacheSystem.SaveToCache("key", "payload", new List&lt; guid &gt;());

      cacheSystem.GetFromCache("key");
    }
  }
&lt;/pre&gt;&lt;br /&gt;
What do we have to change to use MEF?&lt;br /&gt;
Lets assume the assembly file of the class that implements our cache system will be on the executing directory of our application (it could be elsewhere, or the class could be on the same assembly as our application even, but on this example it will be on the executing directory).&lt;br /&gt;
First we have to specify that our classes "export" themselves:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: csharp"&gt;[Export(typeof(IPersist))]
public class MemoryCache : IPersist
{

  public void SaveToCache(string key, string payload, List&lt; guid &gt; contentIds)
  {
    Console.WriteLine("memory cache " + key + " " + payload + " " + contentIds.Count.ToString());
  }

  public string GetFromCache(string key)
  {
    throw new NotImplementedException();
  }

  public void RefreshCache(string contentId)
  {
    throw new NotImplementedException();
  }
}
&lt;/pre&gt;&lt;br /&gt;
&lt;pre class="brush: csharp"&gt;[Export(typeof(IPersist))]
public class DiskCache : IPersist
{

  public void SaveToCache(string key, string payload, List&lt; guid &gt; contentIds)
  {
    Console.WriteLine("disk cache " + key + " " + payload + " " + contentIds.Count.ToString());
  }

  public string GetFromCache(string key)
  {
    throw new NotImplementedException();
  }

  public void RefreshCache(string contentId)
  {
    throw new NotImplementedException();
  }
}
&lt;/pre&gt;&lt;br /&gt;
So we added an Export attribute, specifying which type we are exporting, and this is important when things get more complicated, when you are exporting and importing lots of types.&lt;br /&gt;
&lt;br /&gt;
Then on our application, we must create a catalog, on this case a DirectoryCatalog, since we are getting our exported classes on a directory, and then we create a CompositionContainer and pass our catalog as a parameter. The CompositionContainer is responsible for browsing the provided catalog and resolve connect the dots (match the exported classes to the imported ones on our application), and the code we need to do this is:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: csharp"&gt;public partial class App : Application
  {
    [Import]
    private IPersist cacheSystem { get; set; }

    public App()
    {

      var catalog = new DirectoryCatalog(Environment.CurrentDirectory);
      var container = new CompositionContainer(catalog);
      container.ComposeParts(this);

      cacheSystem.SaveToCache("key", "payload", new List&lt; guid &gt;());

      cacheSystem.GetFromCache("key");
    }
  }
&lt;/pre&gt;&lt;br /&gt;
Which is, create a property that imports something of the type IPersist, create the catalog for the current directory, create the container which will resolve the export/import stuff, and order this resolution with the ComposeParts(this) method call, and finally compile one of our IPersist classes, put it on the executing dir and run our application.&lt;br /&gt;
Bam! Magically all is tied up and we can switch cache systems without compiling, just switch the dll file and you can change, just like that, our caching system implementation.&lt;br /&gt;
&lt;br /&gt;
So, how powerful is this?&lt;br /&gt;
&lt;br /&gt;
Please give feedback.&lt;br /&gt;
&lt;br /&gt;
Thank you all, take care.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2792201692341009334-4587669608145323629?l=sharpdevpt.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/aHuaW5AxNjgBYJPKD_1V-ILFLFU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/aHuaW5AxNjgBYJPKD_1V-ILFLFU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/aHuaW5AxNjgBYJPKD_1V-ILFLFU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/aHuaW5AxNjgBYJPKD_1V-ILFLFU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SharpDevelopBlog/~4/E84vaEv6L00" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sharpdevpt.blogspot.com/feeds/4587669608145323629/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2792201692341009334&amp;postID=4587669608145323629" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/4587669608145323629?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/4587669608145323629?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SharpDevelopBlog/~3/E84vaEv6L00/using-mef-to-dinamize-applications.html" title="Using MEF to extend applications" /><author><name>Ricardo Rodrigues</name><uri>http://www.blogger.com/profile/07328669019913577877</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://sharpdevpt.blogspot.com/2010/10/using-mef-to-dinamize-applications.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0QBQnYzeCp7ImA9WxFXGUg.&quot;"><id>tag:blogger.com,1999:blog-2792201692341009334.post-239193597694623888</id><published>2010-05-27T10:09:00.001+01:00</published><updated>2010-05-27T10:09:13.880+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-27T10:09:13.880+01:00</app:edited><title>Convert DataTable into POCO using attributes</title><content type="html">Hello there.&lt;br /&gt;
A while ago, I had this issue, I have an older system which *still* works with the DataTable class, but still, I want to create my POCO (as we call it these days, the plain old CLR object) and work with it, LINQ it, etc, instead of the ugly DataTable object.&lt;br /&gt;
So I decided to do a method (that could be used as extension method on the DataTable class) that converted my DataTable to my POCO, on the fly.&lt;br /&gt;
&lt;br /&gt;
The problem: mapping DataTable columns to POCO properties.&lt;br /&gt;
The solution: create a custom attribute class so I can define the correspondent column of the DataTable for each POCO property.&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
C#&lt;br /&gt;
&lt;br /&gt;
Usage&lt;br /&gt;
&lt;pre class="brush: csharp"&gt; var dt = new DataTable();
 dt.Columns.AddRange(
  new DataColumn[]
   {
    new DataColumn {ColumnName = "nome", DataType = typeof (string)},
    new DataColumn {ColumnName = "idade", DataType = typeof (int)}
   });
 dt.LoadDataRow(new object[] { "ricardo", 24 }, true);
 dt.LoadDataRow(new object[] { "manel", 45 }, true);

 List&lt;Person&gt; teste = ToObjectList&lt;Person&gt;(dt);
&lt;/pre&gt;&lt;br /&gt;
POCO&lt;br /&gt;
&lt;pre class="brush: csharp"&gt; public class Person
 {
  [ColumnMapping(FieldName = "nome")]
  public string Name
  {
   get;
   set;
  }

  [ColumnMapping(FieldName = "idade")]
  public int Age
  {
   get;
   set;
  }
 }
&lt;/pre&gt;&lt;br /&gt;
The magic&lt;br /&gt;
&lt;pre class="brush: csharp"&gt; public class ColumnMapping : Attribute
 {
  public string FieldName
  {
   get;
   set;
  }
 }

 private List&lt;T&gt; ToObjectList&lt;T&gt;(DataTable dtSource) where T : new()
 {
  var returnList = new List&lt;T&gt;();

  for (var i = 0; i &lt;= dtSource.Rows.Count - 1; i++)
  {
   var obj = new T();
   for (var j = 0; j &lt;= dtSource.Columns.Count - 1; j++)
   {
    var col = (DataColumn) dtSource.Columns[j];     

    foreach (var pi in obj.GetType().GetProperties())
    {
     var fieldName = ((ColumnMapping)pi.GetCustomAttributes(typeof(ColumnMapping), false)[0]).FieldName;
     if (fieldName == col.ColumnName)
     {
      pi.SetValue(obj,dtSource.Rows[i][j],null);
      break;
     }
    }
   }
   returnList.Add(obj);
  }

  return returnList;
 }
&lt;/pre&gt;

VB.NET

Usage
&lt;pre class="brush: vbnet"&gt; Dim dt = New DataTable()
 dt.Columns.AddRange(New DataColumn() {New DataColumn(), New DataColumn()})
 dt.LoadDataRow(New Object() {"ricardo", 24}, True)
 dt.LoadDataRow(New Object() {"manel", 45}, True)

 Dim teste As List(Of Person) = ToObjectList(Of Person)(dt)
&lt;/pre&gt;
POCO
&lt;pre class="brush: vbnet"&gt; Public Class Person
  Private _Name As String
     &lt;ColumnMapping(FieldName := "nome")&gt; _
     Public Property Name() As String
         Get
             Return _Name
         End Get
         Set(ByVal value As String)
             _Name = value
         End Set
     End Property
     
  Private _Age As Integer
     &lt;ColumnMapping(FieldName := "idade")&gt; _
     Public Property Age() As Integer
         Get
             Return _Age
         End Get
         Set(ByVal value As Integer)
             _Age = value
         End Set
     End Property
 End Class
&lt;/pre&gt;
The Magic
&lt;pre class="brush: vbnet"&gt; Public Class ColumnMapping
  Inherits Attribute
  Private _FieldName As String
  Public Property FieldName() As String
   Get
    Return _FieldName
   End Get
   Set(ByVal value As String)
    _FieldName = value
   End Set
  End Property
 End Class

  Public Shared Function ToObjectList(Of T As New)(ByVal dtSource As DataTable) As List(Of T)
   Dim returnList = New List(Of T)()

   For i = 0 To dtSource.Rows.Count - 1
    Dim obj = New T()
    For j = 0 To dtSource.Columns.Count - 1
     Dim col = DirectCast(dtSource.Columns(j), DataColumn)

     For Each pi In obj.[GetType]().GetProperties()
      Dim fieldName = DirectCast(pi.GetCustomAttributes(GetType(ColumnMapping), False)(0), ColumnMapping).FieldName
      If fieldName = col.ColumnName Then
       pi.SetValue(obj, dtSource.Rows(i)(j), Nothing)
       Exit For
      End If
     Next
    Next
    returnList.Add(obj)
   Next

   Return returnList
  End Function
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2792201692341009334-239193597694623888?l=sharpdevpt.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/4Xb-JhFQrdwtni4M80PB5wMoptI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4Xb-JhFQrdwtni4M80PB5wMoptI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/4Xb-JhFQrdwtni4M80PB5wMoptI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4Xb-JhFQrdwtni4M80PB5wMoptI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SharpDevelopBlog/~4/Xgp4ZtBcX-Y" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sharpdevpt.blogspot.com/feeds/239193597694623888/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2792201692341009334&amp;postID=239193597694623888" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/239193597694623888?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/239193597694623888?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SharpDevelopBlog/~3/Xgp4ZtBcX-Y/convert-datatable-into-poco-using.html" title="Convert DataTable into POCO using attributes" /><author><name>Ricardo Rodrigues</name><uri>http://www.blogger.com/profile/07328669019913577877</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://sharpdevpt.blogspot.com/2010/05/convert-datatable-into-poco-using.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0QGRHs4fip7ImA9WxFSGUs.&quot;"><id>tag:blogger.com,1999:blog-2792201692341009334.post-6042211994378888155</id><published>2010-04-22T21:42:00.005+01:00</published><updated>2010-04-22T21:48:45.536+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-22T21:48:45.536+01:00</app:edited><title>C# Enum with char valued items</title><content type="html">Hello again!&lt;br /&gt;
I'm finally back, and still I haven't fulfilled my promise of writing about .NET 4 and VS2010, but I'm working on it, and maybe I'll talk about VS2010 testing features as well and also Entity Framework 4 new hot stuff!&lt;br /&gt;
&lt;br /&gt;
Focusing on the subject, what am I going to write about the Enum type?&lt;br /&gt;
&lt;br /&gt;
- Can we assign an Enum item to anything that's not of the int type?&lt;br /&gt;
- Why would I even bother thinking about this?&lt;br /&gt;
- How can I handle converting something to Enum and back to something again?&lt;br /&gt;
&lt;br /&gt;
First of all, YES, we can assign an Enum to something else, a char!&lt;br /&gt;
And how?&lt;br /&gt;
Just like you're thinking about it, yes:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: csharp"&gt;public Enum myEnum {
value1 = 'a',
value2 = 'b'
}
&lt;/pre&gt;&lt;br /&gt;
And why would I think about this?&lt;br /&gt;
Have you ever had to write some DAL code or mapping and existing database to and ORM, say Entity Framework, and you had fields which contained, for some particular reason, a list of controlled chars, which aren't related to any other table, like a field called State which had the possible  values, 'R' for Ready, 'P' for Pending and 'C' for cancelled, and you want to have some nice and type-safe way of manipulating this field on code and at the same time a generic way, which can be used everywhere, well, you can do it using those chars on an Enum type:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: csharp"&gt;public Enum State {
Ready = 'R',
Pending = 'P',
Cancelled = 'C'
}
&lt;/pre&gt;&lt;br /&gt;
And how can I handle this? I'll sure try to do a State.ToString() and it will return me a number, why??&lt;br /&gt;
Because, actually, you can't have an Enum item with an associated char, but .NET lets you do this, and internally it converts your char to it's equivalent int representation (ASCII).&lt;br /&gt;
So, now you're thinking, so now what? How can I get my char??&lt;br /&gt;
Simple enough, just cast the Enum item to a char first, and then you get it's char representation:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: csharp"&gt;string type = ((char)StateEnum).ToString();
&lt;/pre&gt;&lt;br /&gt;
This way you can extract the char from the int, and get your value!&lt;br /&gt;
&lt;br /&gt;
This is for persisting your data to your datasource (convert the Enum item to the value that your datasource is expecting, the char).&lt;br /&gt;
&lt;br /&gt;
But now you need to convert your char to the corresponding Enum item, when you get your char field from your datasource, right?&lt;br /&gt;
How can this be done?&lt;br /&gt;
Well I've coded a method to do that, with generics, lets see:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://pastebin.com/ZKtbHkdp" target="_blank"&gt;Code at Pastebin&lt;/a&gt;&lt;br /&gt;
&lt;pre class="brush: csharp"&gt;public static T ToEnum&lt; T &gt;(string @string)
  {
   if (string.IsNullOrEmpty(@string))
   {
    throw new ArgumentException("Argument null or empty");
   }
   if (@string.Length &gt; 1)
   {
    throw new ArgumentException("Argument length greater than one");
   }
   return (T)Enum.ToObject(typeof(T), @string[0]);
  }
&lt;/pre&gt;&lt;br /&gt;
So what you do here is accept a string (could be a char, it's just to make it simplier, since many ORMs map a char on the database to string, not chat), and then you check your parameters, ir they're not null, and if the length of the string is one (which matches a char), and then, you use the ToObject method from the Enum type, that accepts the return type you want to get, and the corresponding Enum item value (int or char) to convert to.&lt;br /&gt;
&lt;br /&gt;
And that's it, you can use chars with an Enum object, isn't this awesome?&lt;br /&gt;
When i got around this, I just thought about the lots of times that I needed it...&lt;br /&gt;
&lt;br /&gt;
Hope this helps you as much as it helped me.&lt;br /&gt;
&lt;br /&gt;
Be back soon!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2792201692341009334-6042211994378888155?l=sharpdevpt.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/MUQiBcMkfIXk4PpUefm-bpOExbY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MUQiBcMkfIXk4PpUefm-bpOExbY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/MUQiBcMkfIXk4PpUefm-bpOExbY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MUQiBcMkfIXk4PpUefm-bpOExbY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SharpDevelopBlog/~4/7Uhhaw5ZGOk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sharpdevpt.blogspot.com/feeds/6042211994378888155/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2792201692341009334&amp;postID=6042211994378888155" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/6042211994378888155?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/6042211994378888155?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SharpDevelopBlog/~3/7Uhhaw5ZGOk/c-enum-with-char-valued-items.html" title="C# Enum with char valued items" /><author><name>Ricardo Rodrigues</name><uri>http://www.blogger.com/profile/07328669019913577877</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>4</thr:total><feedburner:origLink>http://sharpdevpt.blogspot.com/2010/04/c-enum-with-char-valued-items.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0YCR3s9eip7ImA9WxBWEU0.&quot;"><id>tag:blogger.com,1999:blog-2792201692341009334.post-1470977845093386974</id><published>2010-02-02T10:55:00.004Z</published><updated>2010-02-02T11:12:46.562Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-02-02T11:12:46.562Z</app:edited><title>C# Word document manipulation without MSO Word installed!</title><content type="html">Hi there folks!&lt;br /&gt;
I didn't forget about the promise I made, blogging about .NET 4.0 and VS 2010 new and spicy features, but before that, I need to blog about an interesting experience on developing a MSO word solution.&lt;br /&gt;
&lt;br /&gt;
For starters, the discovery was when I found the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=C6E744E5-36E9-45F5-8D8C-331DF206E0D0&amp;displaylang=en" target="_blank"&gt;Open XML SDK&lt;/a&gt; that allows me to manipulate my Word document &lt;b&gt;without&lt;/b&gt; having office installed on the server running my application, which is a &lt;b&gt;major breakthrough&lt;/b&gt;!&lt;br /&gt;
The code I used to add custom properties was taken from &lt;a href="http://msdn.microsoft.com/en-us/library/bb308936.aspx" target="_blank"&gt;MSDN&lt;/a&gt; and I show it to you here:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: csharp"&gt;public bool WDSetCustomProperty(string docName, string propertyName, object propertyValue, PropertyTypes propertyType)
    {
      const string documentRelationshipType =
        "http://schemas.openxmlformats.org/officeDocument/" +
        "2006/relationships/officeDocument";
      const string customPropertiesRelationshipType =
        "http://schemas.openxmlformats.org/officeDocument/" +
        "2006/relationships/custom-properties";
      const string customPropertiesSchema =
        "http://schemas.openxmlformats.org/officeDocument/" +
        "2006/custom-properties";
      const string customVTypesSchema =
        "http://schemas.openxmlformats.org/officeDocument/" +
        "2006/docPropsVTypes";

      bool retVal = false;
      PackagePart documentPart = null;
      string propertyTypeName = "vt:lpwstr";
      string propertyValueString = null;

      //  Calculate the correct type.
      switch (propertyType)
      {
        case PropertyTypes.DateTime:
          propertyTypeName = "vt:filetime";
          //  Make sure you were passed a real date, 
          //  and if so, format in the correct way. The date/time 
          //  value passed in should represent a UTC date/time.
          if (propertyValue.GetType() == typeof(System.DateTime))
          {
            propertyValueString = string.Format("{0:s}Z",
              Convert.ToDateTime(propertyValue));
          }
          break;

        case PropertyTypes.NumberInteger:
          propertyTypeName = "vt:i4";
          if (propertyValue.GetType() == typeof(System.Int32))
          {
            propertyValueString =
              Convert.ToInt32(propertyValue).ToString();
          }
          break;

        case PropertyTypes.NumberDouble:
          propertyTypeName = "vt:r8";
          if (propertyValue.GetType() == typeof(System.Double))
          {
            propertyValueString =
              Convert.ToDouble(propertyValue).ToString();
          }
          break;

        case PropertyTypes.Text:
          propertyTypeName = "vt:lpwstr";
          propertyValueString = Convert.ToString(propertyValue);
          break;

        case PropertyTypes.YesNo:
          propertyTypeName = "vt:bool";
          if (propertyValue.GetType() == typeof(System.Boolean))
          {
            //  Must be lower case!
            propertyValueString =
              Convert.ToBoolean(propertyValue).ToString().ToLower();
          }
          break;
      }

      if (propertyValueString == null)
      {
        //  If the code cannot convert the 
        //  property to a valid value, throw an exception.
        throw new InvalidDataException("Invalid parameter value.");
      }

      using (Package wdPackage = Package.Open(
        docName, FileMode.Open, FileAccess.ReadWrite))
      {
        //  Get the main document part (document.xml).
        foreach (PackageRelationship relationship in
          wdPackage.GetRelationshipsByType(documentRelationshipType))
        {
          Uri documentUri = PackUriHelper.ResolvePartUri(
            new Uri("/", UriKind.Relative), relationship.TargetUri);
          documentPart = wdPackage.GetPart(documentUri);
          //  There is only one document.
          break;
        }

        //  Work with the custom properties part.
        PackagePart customPropsPart = null;

        //  Get the custom part (custom.xml). It may not exist.
        foreach (PackageRelationship relationship in
          wdPackage.GetRelationshipsByType(
          customPropertiesRelationshipType))
        {
          Uri documentUri = PackUriHelper.ResolvePartUri(
            new Uri("/", UriKind.Relative), relationship.TargetUri);
          customPropsPart = wdPackage.GetPart(documentUri);
          //  There is only one custom properties part, 
          // if it exists at all.
          break;
        }

        //  Manage namespaces to perform Xml XPath queries.
        NameTable nt = new NameTable();
        XmlNamespaceManager nsManager = new XmlNamespaceManager(nt);
        nsManager.AddNamespace("d", customPropertiesSchema);
        nsManager.AddNamespace("vt", customVTypesSchema);

        Uri customPropsUri =
          new Uri("/docProps/custom.xml", UriKind.Relative);
        XmlDocument customPropsDoc = null;
        XmlNode rootNode = null;

        if (customPropsPart == null)
        {
          customPropsDoc = new XmlDocument(nt);

          //  The part does not exist. Create it now.
          customPropsPart = wdPackage.CreatePart(
            customPropsUri, "application/vnd.openxmlformats-officedocument.custom-properties+xml");

          //  Set up the rudimentary custom part.
          rootNode = customPropsDoc.
            CreateElement("Properties", customPropertiesSchema);
          rootNode.Attributes.Append(
            customPropsDoc.CreateAttribute("xmlns:vt"));
          rootNode.Attributes["xmlns:vt"].Value = customVTypesSchema;

          customPropsDoc.AppendChild(rootNode);

          //  Create the document's relationship to the 
          //  new custom properties part.
          wdPackage.CreateRelationship(customPropsUri,
            TargetMode.Internal, customPropertiesRelationshipType);
        }
        else
        {
          //  Load the contents of the custom properties part 
          //  into an XML document.
          customPropsDoc = new XmlDocument(nt);
          customPropsDoc.Load(customPropsPart.GetStream());
          rootNode = customPropsDoc.DocumentElement;
        }

        string searchString =
          string.Format("d:Properties/d:property[@name='{0}']",
          propertyName);
        XmlNode node = customPropsDoc.SelectSingleNode(
          searchString, nsManager);

        XmlNode valueNode = null;

        if (node != null)
        {
          //  You found the node. Now check its type.
          if (node.HasChildNodes)
          {
            valueNode = node.ChildNodes[0];
            if (valueNode != null)
            {
              string typeName = valueNode.Name;
              if (propertyTypeName == typeName)
              {
                //  The types are the same. 
                //  Replace the value of the node.
                valueNode.InnerText = propertyValueString;
                //  If the property existed, and its type
                //  has not changed, you are finished.
                retVal = true;
              }
              else
              {
                //  Types are different. Delete the node
                //  and clear the node variable.
                node.ParentNode.RemoveChild(node);
                node = null;
              }
            }
          }
        }

        if (node == null)
        {
          string pidValue = "2";

          XmlNode propertiesNode = customPropsDoc.DocumentElement;
          if (propertiesNode.HasChildNodes)
          {
            XmlNode lastNode = propertiesNode.LastChild;
            if (lastNode != null)
            {
              XmlAttribute pidAttr = lastNode.Attributes["pid"];
              if (!(pidAttr == null))
              {
                pidValue = pidAttr.Value;
                //  Increment pidValue, so that the new property
                //  gets a pid value one higher. This value should be 
                //  numeric, but it never hurt so to confirm.
                int value = 0;
                if (int.TryParse(pidValue, out value))
                {
                  pidValue = Convert.ToString(value + 1);
                }
              }
            }
          }

          node = customPropsDoc.
            CreateElement("property", customPropertiesSchema);
          node.Attributes.Append(customPropsDoc.CreateAttribute("name"));
          node.Attributes["name"].Value = propertyName;

          node.Attributes.Append(customPropsDoc.CreateAttribute("fmtid"));
          node.Attributes["fmtid"].Value =
            "{D5CDD505-2E9C-101B-9397-08002B2CF9AE}";

          node.Attributes.Append(customPropsDoc.CreateAttribute("pid"));
          node.Attributes["pid"].Value = pidValue;

          valueNode = customPropsDoc.
            CreateElement(propertyTypeName, customVTypesSchema);
          valueNode.InnerText = propertyValueString;
          node.AppendChild(valueNode);
          rootNode.AppendChild(node);
          retVal = true;

        }

        //  Save the properties XML back to its part.
        customPropsDoc.Save(customPropsPart.
          GetStream(FileMode.Create, FileAccess.Write));

      }



      return retVal;
    }
&lt;/pre&gt;&lt;br /&gt;
The purpose of having this is to write some custom properties, for my Word Add-in to work properly, which is quite handy in most situations.&lt;br /&gt;
&lt;br /&gt;
Hope this is as much value to you as it was to me!&lt;br /&gt;
&lt;br /&gt;
Be back soon&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2792201692341009334-1470977845093386974?l=sharpdevpt.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/D9JeECRMRw6WjsQQ14PvTnQKWQk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/D9JeECRMRw6WjsQQ14PvTnQKWQk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/D9JeECRMRw6WjsQQ14PvTnQKWQk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/D9JeECRMRw6WjsQQ14PvTnQKWQk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SharpDevelopBlog/~4/9mSMtptQupQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sharpdevpt.blogspot.com/feeds/1470977845093386974/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2792201692341009334&amp;postID=1470977845093386974" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/1470977845093386974?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/1470977845093386974?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SharpDevelopBlog/~3/9mSMtptQupQ/c-word-document-manipulation-without.html" title="C# Word document manipulation without MSO Word installed!" /><author><name>Ricardo Rodrigues</name><uri>http://www.blogger.com/profile/07328669019913577877</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://sharpdevpt.blogspot.com/2010/02/c-word-document-manipulation-without.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0UCRnY4cSp7ImA9WxBWEU0.&quot;"><id>tag:blogger.com,1999:blog-2792201692341009334.post-782768854935066942</id><published>2010-01-15T17:47:00.001Z</published><updated>2010-02-02T11:14:27.839Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-02-02T11:14:27.839Z</app:edited><title>JCrop + Thickbox iframe + Internet Explorer 8 (Nasty IE bug fix)</title><content type="html">Hello guys.&lt;br /&gt;
Before posting about .NET Framework 4.0, I have to tell you about an episode (another one) about the horrifying experience that is programming IE compatible javascript.&lt;br /&gt;
The scenario:&lt;br /&gt;
&lt;br /&gt;
I have a web form with a input file, that I need to crop &amp; resize the image (if it is one), on a thickbox iframe.&lt;br /&gt;
&lt;br /&gt;
So I create submit my form to an iframe, and when the iframe is loaded, I run the JCrop plugin.&lt;br /&gt;
So far so good..on Firefox..&lt;br /&gt;
Then I test this on IE8, nothing, the image doesn't appear or the image appears, but no JCrop functionality whatsoever, and why? Because IE8 (an 7 as far as I know) doesn't load the image in a timely fashion, or when it's supposed to be loaded! Nothing works! window load event, image load event, document ready, document load, nothing!&lt;br /&gt;
&lt;br /&gt;
The Trick: having the jcrop call inside a setTimeout, with 1 ms only...&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: js"&gt;setTimeout("$('imgEdit').JCrop();",1); //&lt;- and voilá! it's working!
&lt;/pre&gt;
&lt;br /&gt;
It's a shame on 2010 we still need to hack to get things working on IE.&lt;br /&gt;
&lt;br /&gt;
Hope this save you a good couple of yours, like it would if I had it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2792201692341009334-782768854935066942?l=sharpdevpt.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/pWyKN38KR3972-e_LtScLLJmzrc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pWyKN38KR3972-e_LtScLLJmzrc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/pWyKN38KR3972-e_LtScLLJmzrc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pWyKN38KR3972-e_LtScLLJmzrc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SharpDevelopBlog/~4/FYIEhIZ5_Sc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sharpdevpt.blogspot.com/feeds/782768854935066942/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2792201692341009334&amp;postID=782768854935066942" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/782768854935066942?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/782768854935066942?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SharpDevelopBlog/~3/FYIEhIZ5_Sc/jcrop-thickbox-iframe-internet-explorer.html" title="JCrop + Thickbox iframe + Internet Explorer 8 (Nasty IE bug fix)" /><author><name>Ricardo Rodrigues</name><uri>http://www.blogger.com/profile/07328669019913577877</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://sharpdevpt.blogspot.com/2010/01/jcrop-thickbox-iframe-internet-explorer.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkQBSX89cCp7ImA9WxBQEk0.&quot;"><id>tag:blogger.com,1999:blog-2792201692341009334.post-2094261592929660467</id><published>2010-01-11T10:05:00.000Z</published><updated>2010-01-11T10:05:58.168Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-11T10:05:58.168Z</app:edited><title>.NET 4.0 and Visual Studio 2010 candy!</title><content type="html">Hello.&lt;br /&gt;
I've been reading about Visual Studio 2010, and .NET Framework 4.0, and I'd like to share with you some really handy stuff that's coming towards us, and I will talk about each on subsequent posts:&lt;br /&gt;
&lt;br /&gt;
About .NET 4.0:&lt;br /&gt;
&lt;br /&gt;
- Routing&lt;br /&gt;
&lt;br /&gt;
- Compress Session &lt;br /&gt;
&lt;br /&gt;
- Optional and named method parameters&lt;br /&gt;
&lt;br /&gt;
- Generate control's client ID&lt;br /&gt;
&lt;br /&gt;
- Meta Tags&lt;br /&gt;
&lt;br /&gt;
- View state for individual controls&lt;br /&gt;
&lt;br /&gt;
- Chart Control&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
About Visual Studio 2010&lt;br /&gt;
&lt;br /&gt;
- Web.config transformation (!!!)&lt;br /&gt;
&lt;br /&gt;
- Performance sessions&lt;br /&gt;
&lt;br /&gt;
- Multi monitor&lt;br /&gt;
&lt;br /&gt;
- Code navigation (new search engine)&lt;br /&gt;
&lt;br /&gt;
- Call hierarchy&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All these features both from .NET 4.0 and VS 2010 are very significant to a developer's daily routine.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2792201692341009334-2094261592929660467?l=sharpdevpt.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/UPU8tCARtewcwRXmVxyAyv2Ujz0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/UPU8tCARtewcwRXmVxyAyv2Ujz0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/UPU8tCARtewcwRXmVxyAyv2Ujz0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/UPU8tCARtewcwRXmVxyAyv2Ujz0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SharpDevelopBlog/~4/upoWPNTzpFA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sharpdevpt.blogspot.com/feeds/2094261592929660467/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2792201692341009334&amp;postID=2094261592929660467" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/2094261592929660467?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/2094261592929660467?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SharpDevelopBlog/~3/upoWPNTzpFA/net-40-and-visual-studio-2010-candy.html" title=".NET 4.0 and Visual Studio 2010 candy!" /><author><name>Ricardo Rodrigues</name><uri>http://www.blogger.com/profile/07328669019913577877</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://sharpdevpt.blogspot.com/2010/01/net-40-and-visual-studio-2010-candy.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0QHQHwyeSp7ImA9WxBWEU0.&quot;"><id>tag:blogger.com,1999:blog-2792201692341009334.post-3326084874142502387</id><published>2009-12-11T11:38:00.003Z</published><updated>2010-02-02T11:15:31.291Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-02-02T11:15:31.291Z</app:edited><title>jTemplates - client-side xslt-like template mechanism</title><content type="html">Hello again, just found this awesome JQuery plugin and I had to write a post about, it's just incredible...&lt;br /&gt;
If on my previous post I talked about jLinq's untapped potential, this jTemplates leave me speechless.&lt;br /&gt;
Imagine you can have a web application, that consumes JSON services and you can have an entire templating mechanism, right here, live, transforming your data to something user friendly, instantaneously?&lt;br /&gt;
&lt;br /&gt;
Some concepts:&lt;br /&gt;
&lt;br /&gt;
Constants:&lt;br /&gt;
- $T - data&lt;br /&gt;
- $P - parameters&lt;br /&gt;
- $Q - XHTML element's attributes&lt;br /&gt;
&lt;br /&gt;
Look here at a simple example of it's operation:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: js"&gt;var mydata = { name: "Anne", age: "20" };

$("#result").setTemplate("{$T.name}");
$("#result").processTemplate(mydata);

Result = "Anne"
&lt;/pre&gt;&lt;br /&gt;
You can use some statements like IF, FOR, FOREACH, PARAM, CYCLE include templates on other templates, send parameters, use js functions, use static content, comments, etc.&lt;br /&gt;
&lt;br /&gt;
IF&lt;br /&gt;
&lt;pre class="brush: js"&gt;{#if 2*8==16} good {#else} fail {#/if}
&lt;/pre&gt;&lt;br /&gt;
FOR&lt;br /&gt;
&lt;pre class="brush: js"&gt;{#for index = 1 to 10} {$T.index} {#/for}
&lt;/pre&gt;&lt;br /&gt;
FOREACH&lt;br /&gt;
&lt;pre class="brush: js"&gt;{#foreach $T.table as record} {$T.record.name} {#/for}
&lt;/pre&gt;&lt;br /&gt;
INCLUDE&lt;br /&gt;
&lt;pre class="brush: js"&gt;var template1 = $.createTemplate('&lt;b&gt;{$T.name}&lt;/b&gt; ({$T.age})');
$('#result').setTemplate('{#include t1 root=$T.table[0]}', {t1: template1});
$('#result').processTemplate(data);
&lt;/pre&gt;&lt;br /&gt;
PARAM&lt;br /&gt;
&lt;pre class="brush: js"&gt;$("#result").setTemplate("{#param name=x value=888}{$P.x}");
$("#result").processTemplate();
&lt;/pre&gt;&lt;br /&gt;
CYCLE&lt;br /&gt;
&lt;pre class="brush: js"&gt;&lt;table width=\"200\"&gt;{#foreach $T.table as row}
&lt;tr&gt;&lt;td&gt;{$T.row.name.link('mailto:'+$T.row.mail)}&lt;/td&gt;   &lt;/tr&gt;
{#/for} &lt;/table&gt;&lt;/pre&gt;&lt;br /&gt;
the cycle iterates through it's values each time the foreach statement (or for) iterates, so the output for this would be alternated row colors between #AAAAAA and #CCCCCC.&lt;br /&gt;
&lt;br /&gt;
Parameters&lt;br /&gt;
&lt;pre class="brush: js"&gt;$("#result").setTemplate("{$P.param1}");
$("#result").setParam('param1', 888);
$("#result").processTemplate();
&lt;/pre&gt;&lt;br /&gt;
Functions&lt;br /&gt;
&lt;pre class="brush: js"&gt;$("#result").setTemplate("{$T.toUpperCase()}");
$("#result").processTemplate();
&lt;/pre&gt;&lt;br /&gt;
Static Content&lt;br /&gt;
&lt;pre class="brush: js"&gt;$("#result").setTemplate("{#literal}class Car {
&amp;nbsp;&amp;nbsp;int fuel;
};{#/literal}");
$("#result").processTemplate();
&lt;/pre&gt;&lt;br /&gt;
Comments&lt;br /&gt;
&lt;pre class="brush: js"&gt;$("#result").setTemplate("{* Header *}&lt;div&gt;head&lt;/div&gt;{* Content *}&lt;div&gt;{$T.italics()} &lt;/div&gt;");
$("#result").processTemplate("jTemplates");
&lt;/pre&gt;&lt;br /&gt;
For a complete reference, go to the &lt;a target="_blank" href="http://jtemplates.tpython.com/"&gt;owner page&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2792201692341009334-3326084874142502387?l=sharpdevpt.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/cw6jZblqQdkurRoM59smB4yKnWg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cw6jZblqQdkurRoM59smB4yKnWg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/cw6jZblqQdkurRoM59smB4yKnWg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cw6jZblqQdkurRoM59smB4yKnWg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SharpDevelopBlog/~4/_leiU7xmPc0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sharpdevpt.blogspot.com/feeds/3326084874142502387/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2792201692341009334&amp;postID=3326084874142502387" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/3326084874142502387?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/3326084874142502387?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SharpDevelopBlog/~3/_leiU7xmPc0/jtemplates-client-side-xslt-like.html" title="jTemplates - client-side xslt-like template mechanism" /><author><name>Ricardo Rodrigues</name><uri>http://www.blogger.com/profile/07328669019913577877</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://sharpdevpt.blogspot.com/2009/12/jtemplates-client-side-xslt-like.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0MBRHsyfCp7ImA9WxBWEU0.&quot;"><id>tag:blogger.com,1999:blog-2792201692341009334.post-4743204732413388788</id><published>2009-12-11T10:18:00.002Z</published><updated>2010-02-02T11:17:35.594Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-02-02T11:17:35.594Z</app:edited><title>jLinq - JQuery LINQ to JSON</title><content type="html">The other day, I was writing some code for having my entity objects transformed to XML or JSON as simple as ToJSON and ToXML, and it got me wondering, what if I could have something like this on client-side?&lt;br /&gt;
Did some research (google.com?q=jquery+linq) and WOW, JQuery has a plugin that allows me to perform LINQ queries on my JSON data?? Jackpot!&lt;br /&gt;
&lt;br /&gt;
Let me show you some code so you can reset your mindset:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: js"&gt;var results = jLinq.from(data.users)
    .startsWith("first", "a")
    .orEndsWith("y")
    .orderBy("admin", "age")
    .select();
&lt;/pre&gt;&lt;br /&gt;
How cool is this? Are you thinking about the millions of applications for this? The millions of possibilities and richer web applications we can build with this? So am I!&lt;br /&gt;
&lt;br /&gt;
Go to &lt;a target="_blank" href="http://www.hugoware.net/Projects/jLinq"&gt;this page&lt;/a&gt; and download it right away, because this has some really untapped potential, congrats to Hugoware for this great achievement!&lt;br /&gt;
&lt;br /&gt;
See you soon, enjoy it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2792201692341009334-4743204732413388788?l=sharpdevpt.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/sHVjQlMw-SI-W1XVCmUXZ-I80gE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/sHVjQlMw-SI-W1XVCmUXZ-I80gE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/sHVjQlMw-SI-W1XVCmUXZ-I80gE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/sHVjQlMw-SI-W1XVCmUXZ-I80gE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SharpDevelopBlog/~4/rYowigXXieI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sharpdevpt.blogspot.com/feeds/4743204732413388788/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2792201692341009334&amp;postID=4743204732413388788" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/4743204732413388788?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/4743204732413388788?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SharpDevelopBlog/~3/rYowigXXieI/jlinq-jquery-linq-to-json.html" title="jLinq - JQuery LINQ to JSON" /><author><name>Ricardo Rodrigues</name><uri>http://www.blogger.com/profile/07328669019913577877</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://sharpdevpt.blogspot.com/2009/12/jlinq-jquery-linq-to-json.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0IHSHYzfCp7ImA9WxBWEU0.&quot;"><id>tag:blogger.com,1999:blog-2792201692341009334.post-6034086401268690114</id><published>2009-11-24T16:25:00.005Z</published><updated>2010-02-02T11:18:59.884Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-02-02T11:18:59.884Z</app:edited><title>JQuery Autocomplete - more complete!</title><content type="html">Hi there!&lt;br /&gt;
A couple of days ago I started to develop something that needed a fancy, unobtrusive jquery autocomplete plugin, that could accept JSON as data source and created light HTML and I found this &lt;a href="http://www.codenothing.com/archives/jquery/auto-complete/" target="_blank"&gt;one&lt;/a&gt;.&lt;br /&gt;
But then, it missed two simple functionalities that I added:&lt;br /&gt;
&lt;br /&gt;
One -&amp;gt; the for each of your result items, isn't controlled by you, it expects that your JSON contains a value property, and uses it, but my JSON was a little more complex than that, so I coded a setting to the autocomplete plugin, so you can define, or not, your drawing function!&lt;br /&gt;
Two -&amp;gt; If you needed to force your autocomplete list to show up, you couldn't, and I coded that two.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://pastebin.com/f2c56a685" target="_blank"&gt;So here's the result&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
or here:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: js"&gt;/*!
* Auto Complete 4.1
* October 5, 2009
* Corey Hart @ http://www.codenothing.com
* Ricardo Rodrigues @ http://sharpdevpt.blogspot.com
*/
; (function($, undefined) {
    // Expose autoComplete to the jQuery chain
    $.fn.autoComplete = function() {
        // Force array of arguments
        var args = Array.prototype.slice.call(arguments);

        // Autocomplete special triggers
        if (typeof args[0] === 'string')
        // Trigger the requested function, and dont break the chain!
            return $(this).trigger('autoComplete.' + args.shift(), args);

        // Initiate the autocomplete
        return autoComplete.call(this, args[0]);
    };

    // bgiframe is needed to fix z-index problem for IE6 users.
    $.fn.bgiframe = $.fn.bgiframe ? $.fn.bgiframe : $.fn.bgIframe ? $.fn.bgIframe : function() {
        // For applications that don't have bgiframe plugin installed, create a useless 
        // function that doesn't break the chain
        return this;
    };

    // Autocomplete function
    var inputIndex = 0, autoComplete = function(options) {
        return this.each(function() {
            // Cache objects
            var $input = $(this).attr('autocomplete', 'off'), $li, timeid, timeid2, blurid,
            // Internal Per Input Cache
				cache = {
				    length: 0,
				    val: undefined,
				    list: {}
				},
            // Set defaults and include metadata support
				settings = $.extend({
				    // Inner Function Defaults (Best to leave alone)
				    opt: -1,
				    inputval: undefined,
				    mouseClick: false,
				    dataName: 'ac-data',
				    inputIndex: ++inputIndex,
				    // Server Script Path
				    ajax: 'ajax.php',
				    dataSupply: [],
				    dataFn: undefined,
				    // Drop List CSS
				    list: 'auto-complete-list',
				    rollover: 'auto-complete-list-rollover',
				    width: $input.outerWidth(),
				    // Post Data
				    postVar: 'value',
				    postData: {},
				    // Limitations
				    minChars: 1,
				    maxItems: -1,
				    maxRequests: 0,
				    requestType: 'post',
				    requests: 0, // Inner Function Default
				    // Events
				    onMaxRequest: function() { },
				    onSelect: function() { },
				    onRollover: function() { },
				    onBlur: function() { },
				    onFocus: function() { },
				    inputControl: function(v) { return v; },
				    preventEnterSubmit: false,
				    enter: true, // Inner Function Default
				    delay: 100,
				    selectFuncFire: true, // Inner Function Default
				    // Caching Options
				    useCache: true,
				    cacheLimit: 50,
				    htmlCustomFormatter: undefined
				}, options || {}, $.metadata ? $input.metadata() : {}),

            // Create the drop list (Use an existing one if possible)
				$ul = $('ul.' + settings.list)[0] ?
					$('ul.' + settings.list).bgiframe() :
					$('&lt;ul/&gt;').appendTo('body').addClass(settings.list).bgiframe().hide();

            // Input Events
            $input.data('ac-input-index', settings.inputIndex) // Attach input index
            // Central autoComplete specific function
			.bind('keyup.autoComplete', function(event) {
			    var key = event.keyCode;
			    settings.mouseClick = false;

			    // Enter Key
			    if (key == 13 &amp;&amp; $li) {
			        settings.opt = -1;
			        // Ensure the select function only gets fired once
			        if (settings.selectFuncFire) {
			            settings.selectFuncFire = false;
			            settings.onSelect.call($input[0], $li.data(settings.dataName), $li, $ul);
			            if (timeid2) clearTimeout(timeid2);
			            timeid2 = setTimeout(function() { settings.selectFuncFire = true; }, 1000);
			        }
			        $ul.hide();
			    }
			    // Up Arrow
			    else if (key == 38) {
			        if (settings.opt &gt; 0) {
			            settings.opt--;
			            $li = $('li', $ul).removeClass(settings.rollover).eq(settings.opt).addClass(settings.rollover);
			            $input.val($li.data(settings.dataName).value || '');
			            settings.onRollover.call($input[0], $li.data(settings.dataName), $li, $ul);
			        } else {
			            settings.opt = -1;
			            $input.val(settings.inputval);
			            $ul.hide();
			        }
			    }
			    // Down Arrow
			    else if (key == 40) {
			        if (settings.opt &lt; $('li', $ul).length - 1) {
			            settings.opt++;
			            $li = $('li', $ul.show()).removeClass(settings.rollover).eq(settings.opt).addClass(settings.rollover);
			            $input.val($li.data(settings.dataName).value || '');
			            settings.onRollover.call($input[0], $li.data(settings.dataName), $li, $ul);
			        }
			    }
			    // Everything else is possible input
			    else {
			        settings.opt = -1;
			        settings.inputval = $input.val();
			        cache.val = settings.inputControl.call($input, settings.inputval, key);
			        if (cache.val.length &gt;= settings.minChars) {
			            // Send request on timer so fast typing doesn't overload requests
			            if (timeid) clearTimeout(timeid);
			            timeid = setTimeout(function() { sendRequest(settings, cache); clearTimeout(timeid); }, settings.delay);
			        } else if (key == 8) { // Remove list on backspace of small string
			            $ul.html('').hide();
			        }
			    }
			})
            // Bind specific Blur Actions
			.bind('blur.autoComplete', function() {
			    settings.enter = true;
			    blurid = setTimeout(function() {
			        if (settings.mouseClick)
			            return false;
			        settings.opt = -1;
			        settings.onBlur.call($input[0], settings.inputval, $ul);
			        $ul.hide();
			    }, 150);
			})
            // Bind specific focus actions
			.bind('focus.autoComplete', function() {
			    settings.enter = false;
			    // If ul is not associated with current input, clear it
			    if (settings.inputIndex != $ul.data('ac-input-index'))
			        $ul.html('').hide();
			    settings.onFocus.call($input[0], $ul);
			})

            /**
            * Autocomplete Special Triggers
            * -Extensions off autoComplete event
            */
            // Allows for change of settings at any point
			.bind('autoComplete.settings', function(event, newSettings) {
			    // Give access to current settings and cache
			    if ($.isFunction(newSettings)) {
			        var ret = newSettings.call($input[0], settings, cache);
			        // Allow for extending of settings/cache based off function return values
			        if ($.isArray(ret) &amp;&amp; ret.length) {
			            settings = $.extend(true, {}, settings, ret[0] || settings);
			            cache = $.extend(true, {}, cache, ret[1] || cache);
			        }
			    } else {
			        // Extend deep so settings are kept
			        settings = $.extend(true, {}, settings, newSettings || {});
			    }
			})
            // Clears the Cache &amp; requests (requests can be blocked on request)
			.bind('autoComplete.flush', function(event, cacheOnly) {
			    cache = { length: 0, val: undefined, list: {} };
			    if (!cacheOnly) settings.requests = 0;
			})
            // External button trigger for ajax requests
			.bind('autoComplete.button.ajax', function(event, postData, cacheName) {
			    // Refocus the input box
			    $input.focus();
			    // Remove blur trigger
			    if (blurid) clearTimeout(blurid);
			    // Allow for just passing the cache name
			    if (typeof postData === 'string') {
			        cacheName = postData;
			        postData = {};
			    }
			    // If no cache name is given, supply a non-common word
			    cache.val = cacheName || 'NON_404_&lt;&gt;!@$^&amp;';
			    // Send request on timer so focus event doesn't override
			    if (timeid) clearTimeout(timeid);
			    timeid = setTimeout(function() {
			        sendRequest($.extend(true, {}, settings, { opt: -1, maxItems: -1, postData: postData || {} }), cache);
			        clearTimeout(timeid);
			    }, settings.delay);
			})
            // External button trigger for supplied data
			.bind('autoComplete.button.supply', function(event, data, cacheName) {
			    // Refocus the input box
			    $input.focus();
			    // Remove blur trigger
			    if (blurid) clearTimeout(blurid);
			    // Allow for just passing of cacheName
			    if (typeof data === 'string') {
			        cacheName = data;
			        data = undefined;
			    }
			    // If no cache name is given, supply a non-common word
			    cache.val = cacheName || 'NON_404_SUPPLY_&lt;&gt;!@$^&amp;';
			    // If no data is supplied, use data in settings
			    data = $.isArray(data) ? data : settings.dataSupply;
			    // Send request on timer so focus event doesn't override
			    if (timeid) clearTimeout(timeid);
			    timeid = setTimeout(function() {
			        sendRequest($.extend(true, {}, settings, { opt: -1, maxItems: -1, dataSupply: data, dataFn: function() { return true; } }), cache);
			        clearTimeout(timeid);
			    }, settings.delay);
			})
            // Add a destruction function
			.bind('autoComplete.destroy', function() {
			    // Unbind input events
			    $input.unbind('keyup.autoComplete blur.autoComplete focus.autoComplete autoComplete')
			    // Unbind the form submission event
					.parents('form').eq(0).unbind('submit.autoComplete.' + settings.inputIndex);
			})
            // Add a show list function
			.bind('autoComplete.showlist', function() {
			    $ul.show();
			})
            // Back to normal events
            // Prevent form submission if defined in settings
			.parents('form').eq(0).bind('submit.autoComplete.' + settings.inputIndex, function() {
			    return settings.preventEnterSubmit ? settings.enter : true;
			});

            // Ajax/Cache Request
            function sendRequest(settings, cache) {
                // Check Max reqests first
                if (settings.maxRequests &amp;&amp; ++settings.requests &gt;= settings.maxRequests)
                    return settings.requests &gt; settings.maxRequests ?
						false : settings.onMaxRequest.call($input[0], settings.inputval, $ul);

                // Load from cache if possible
                if (settings.useCache &amp;&amp; cache.list[cache.val])
                    return loadResults(cache.list[cache.val], settings, cache);

                // Use user supplied data when defined
                if (settings.dataSupply.length)
                    return userSuppliedData(settings, cache);

                // Send request server side
                settings.postData[settings.postVar] = cache.val
                $[settings.requestType](settings.ajax, settings.postData, function(json) {
                    // Show the list if there is a return, else hide it
                    loadResults(json, settings, cache);
                    // Use jQuery's method of json evaluation
                    // (thus, can only send 'get' or 'post' jQuery requests)
                }, 'json');
            }

            // Parse User Supplied Data
            function userSuppliedData(settings, cache) {
                var json = [], // Result list
					fn = $.isFunction(settings.dataFn), // User supplied function
					regex = fn ? undefined : new RegExp('^' + cache.val, 'i'), // Only compile regex if needed
					k = 0, entry, i; // Looping vars

                // Loop through each entry and find matches
                for (i in settings.dataSupply) {
                    entry = settings.dataSupply[i];
                    // Force object
                    entry = typeof entry === 'object' &amp;&amp; entry.value ? entry : { value: entry };
                    // If user supplied function, use that, otherwise test with default regex
                    if ((fn &amp;&amp; settings.dataFn.call($input[0], cache.val, entry.value, json, i, settings.dataSupply)) ||
							(!fn &amp;&amp; entry.value.match(regex))) {
                        // Reduce browser load by breaking on limit if it exists
                        if (settings.maxItems &gt; -1 &amp;&amp; ++k &gt; settings.maxItems)
                            break;
                        json.push(entry);
                    }
                }
                // Use normal load functionality
                loadResults(json, settings, cache);
            }

            // List Functionality
            function loadResults(list, settings, cache) {
                // Store results into the cache if need be
                if (settings.useCache) {
                    cache.length++;
                    cache.list[cache.val] = list;
                    // Clear cache if necessary
                    if (settings.cacheLength &gt; settings.cacheLimit) {
                        cache.list = {};
                        cache.length = 0;
                    }
                }

                // Ensure there is a list
                if (!list || list.length &lt; 1)
                    return $ul.html('').hide();

                // Initialize Vars together (save bytes)
                var offset = $input.offset(), // Store offsets
					aci = 0, i; // Index list items

                // Clear the List and align it properly
                $ul.data('ac-input-index', settings.inputIndex).html('').css({
                    top: offset.top + $input.outerHeight(),
                    left: offset.left,
                    width: settings.width
                });

                // Add new rows to the list
                for (i in list) {
                    var fn = $.isFunction(settings.htmlCustomFormatter);
                    if (list[i].value || fn) {
                        if (settings.maxItems &gt; -1 &amp;&amp; ++aci &gt; settings.maxItems) {
                            break;
                        }
                        var appendHTML = list[i].display || list[i].value;
                        //user custom function to compose HTML
                        if (fn) {
                            appendHTML = settings.htmlCustomFormatter(list[i]);
                        }
                        $('&lt;li/&gt;').appendTo($ul).html(appendHTML)&lt;br /&gt;
							.data(settings.dataName, list[i]).data('ac-index', aci);&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
                // Remove old mouseout event and return orignal val when not hovering&lt;br /&gt;
                $ul.show().unbind('mouseout.autoComplete').bind('mouseout.autoComplete', function() {&lt;br /&gt;
                    $('li.' + settings.rollover, $ul).removeClass(settings.rollover);&lt;br /&gt;
                    if (!settings.mouseClick &amp;&amp; settings.selectFuncFire)&lt;br /&gt;
                        $input.val(settings.inputval);&lt;br /&gt;
                    // Unbind any events that linger from previous drops&lt;br /&gt;
                    // I don't understand why this helps yet, because the old li elements are&lt;br /&gt;
                    // removed and new ones created/added to the ul element; but for now, it works&lt;br /&gt;
                }).children('li').unbind('mouseover.autoComplete').unbind('click.autoComplete')&lt;br /&gt;
                // New mouseover and click events&lt;br /&gt;
				.bind('mouseover.autoComplete', function() {&lt;br /&gt;
				    $li = $(this);&lt;br /&gt;
				    $('li.' + settings.rollover, $ul).removeClass(settings.rollover);&lt;br /&gt;
				    $input.val($li.addClass(settings.rollover).data(settings.dataName).value);&lt;br /&gt;
				    settings.onRollover.call($input[0], $li.data(settings.dataName), $li, $ul);&lt;br /&gt;
				    settings.opt = $li.data('ac-index');&lt;br /&gt;
				}).bind('click.autoComplete', function() {&lt;br /&gt;
				    settings.mouseClick = true;&lt;br /&gt;
				    if (blurid) clearTimeout(blurid);&lt;br /&gt;
				    settings.onSelect.call($input[0], $li.data(settings.dataName), $li, $ul);&lt;br /&gt;
				    $ul.hide();&lt;br /&gt;
				    // Bring the focus back to the input when clicking a list member&lt;br /&gt;
				    $input.focus();&lt;br /&gt;
				});&lt;br /&gt;
            }&lt;br /&gt;
        });&lt;br /&gt;
    };&lt;br /&gt;
})(jQuery);&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
Make it good use! :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2792201692341009334-6034086401268690114?l=sharpdevpt.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/qhjpXWpsfQh2koJBmTn0E5Iu_LY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qhjpXWpsfQh2koJBmTn0E5Iu_LY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/qhjpXWpsfQh2koJBmTn0E5Iu_LY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qhjpXWpsfQh2koJBmTn0E5Iu_LY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SharpDevelopBlog/~4/TWo-sn7hX1s" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sharpdevpt.blogspot.com/feeds/6034086401268690114/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2792201692341009334&amp;postID=6034086401268690114" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/6034086401268690114?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/6034086401268690114?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SharpDevelopBlog/~3/TWo-sn7hX1s/jquery-autocomplete-more-complete.html" title="JQuery Autocomplete - more complete!" /><author><name>Ricardo Rodrigues</name><uri>http://www.blogger.com/profile/07328669019913577877</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://sharpdevpt.blogspot.com/2009/11/jquery-autocomplete-more-complete.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUAER3cyfyp7ImA9WxNbEEk.&quot;"><id>tag:blogger.com,1999:blog-2792201692341009334.post-5147068902585142378</id><published>2009-11-12T17:41:00.000Z</published><updated>2009-11-12T17:41:46.997Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-12T17:41:46.997Z</app:edited><title>Top 10 worst Microsoft products of all time</title><content type="html">Just found this top, simple curiosity: http://www.v3.co.uk/v3/news/2252318/top-worst-microsoft-products&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2792201692341009334-5147068902585142378?l=sharpdevpt.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/m2SNDr_iBHTFbKy7wpGzgCocD2Y/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/m2SNDr_iBHTFbKy7wpGzgCocD2Y/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/m2SNDr_iBHTFbKy7wpGzgCocD2Y/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/m2SNDr_iBHTFbKy7wpGzgCocD2Y/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SharpDevelopBlog/~4/a8Ula0z2fb0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sharpdevpt.blogspot.com/feeds/5147068902585142378/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2792201692341009334&amp;postID=5147068902585142378" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/5147068902585142378?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/5147068902585142378?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SharpDevelopBlog/~3/a8Ula0z2fb0/top-10-worst-microsoft-products-of-all.html" title="Top 10 worst Microsoft products of all time" /><author><name>Ricardo Rodrigues</name><uri>http://www.blogger.com/profile/07328669019913577877</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://sharpdevpt.blogspot.com/2009/11/top-10-worst-microsoft-products-of-all.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0EMSHk6eSp7ImA9WxBWEU0.&quot;"><id>tag:blogger.com,1999:blog-2792201692341009334.post-2443055355772672656</id><published>2009-11-11T16:31:00.003Z</published><updated>2010-02-02T11:21:29.711Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-02-02T11:21:29.711Z</app:edited><title>Execute CMD command on ASP.NET App</title><content type="html">Hello guys, this time I spent one full day digging my way into this one..&lt;br /&gt;
The main question here is: How can I execute a command or a list of commands as if I where on the command prompt, and get the response?&lt;br /&gt;
&lt;br /&gt;
I can give you right now the answer! (after banging my head over and over on the keyboard for one day...)&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: csharp"&gt;public static string ExecuteCmdCommands(List&lt; string &gt; commands)
        {
            Process p = new Process();
            p.StartInfo.RedirectStandardOutput = true;
            p.StartInfo.RedirectStandardInput = true;
            p.StartInfo.FileName = @"cmd";
            p.StartInfo.UseShellExecute = false;
            p.Start();

            StreamWriter sIn = p.StandardInput;
            sIn.AutoFlush = true;

            StreamReader sOut = p.StandardOutput;

            for (int i = 0; i &lt;= commands.Count - 1; i++)
            {
                sIn.Write(commands[i] + System.Environment.NewLine);
            }
            
            sIn.Close();
            string result = sOut.ReadToEnd().Trim();
            p.Close();

            return result;
        }
&lt;/pre&gt;
&lt;br /&gt;
How simple is it? You just create a Process, set the RedirectStandardOutput and RedirectStandardInput to true, so you can create a Stream for reading and writing to/from that process, the FileName is the prompt itself and the UseShellExecute is a pre requisite.&lt;br /&gt;
Then start writing out your instructions to the command prompt, always followed by a Environment.NewLine (simulate a Return) and afterwards, you get the output on the reader Stream, that simple!&lt;br /&gt;
&lt;br /&gt;
And, you don't need to change any permissions on the user executing your worker process or app pool for your application, which is great so you don't create any security holes on your web server.&lt;br /&gt;
&lt;br /&gt;
Hopefully this will save you hours, like it would if I had this before!&lt;br /&gt;
&lt;br /&gt;
See you soon&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2792201692341009334-2443055355772672656?l=sharpdevpt.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/wzf-jT-m9jO07EjjYuS3tKSKavQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wzf-jT-m9jO07EjjYuS3tKSKavQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/wzf-jT-m9jO07EjjYuS3tKSKavQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wzf-jT-m9jO07EjjYuS3tKSKavQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SharpDevelopBlog/~4/QJSZJpynWUQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sharpdevpt.blogspot.com/feeds/2443055355772672656/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2792201692341009334&amp;postID=2443055355772672656" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/2443055355772672656?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/2443055355772672656?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SharpDevelopBlog/~3/QJSZJpynWUQ/execute-cmd-command-on-aspnet-app.html" title="Execute CMD command on ASP.NET App" /><author><name>Ricardo Rodrigues</name><uri>http://www.blogger.com/profile/07328669019913577877</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://sharpdevpt.blogspot.com/2009/11/execute-cmd-command-on-aspnet-app.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0EGSXkzeCp7ImA9WxBWEU0.&quot;"><id>tag:blogger.com,1999:blog-2792201692341009334.post-8250083015262272822</id><published>2009-11-05T18:28:00.007Z</published><updated>2010-02-02T11:20:28.780Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-02-02T11:20:28.780Z</app:edited><title>Colorize C# code with RegEx and HTML</title><content type="html">Hi guys.&lt;br /&gt;
This time I needed to colorize some basic sample c# code and haven't found any simple and usable componente to do that, so I decided to code one, but very simple and basic.&lt;br /&gt;
I know it lacks some functionality, like coloring a class on a static method call, because this is not so simple as that, but it's a start, here is the code:&lt;br /&gt;
&lt;pre class="brush: csharp"&gt;private string words = "abstract|as|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|volatile|void|while";
//this is a list of reserved words

private string ColorizeCode(string code)
{
  Regex regExInst = new Regex(@"(?&lt;type&gt;\w+)\s\w+\s=\snew\s(?&lt;type1&gt;\w+)\(");//regex to colorize the object creations

  MatchCollection mcInst = regExInst.Matches(code);

  foreach (Match match in mcInst)
  {
    code = code.Remove(match.Groups["TYPE"].Index, match.Groups["TYPE"].Length);
    code = code.Insert(match.Groups["TYPE"].Index, "&lt;span class=\"typevariable\"&gt;" + match.Groups["TYPE"].Value + "&lt;/span&gt;");

    Regex regExInstAux = new Regex(@"\s=\snew\s(?&lt;type&gt;\w+)\(");
    MatchCollection mcInstAux = regExInstAux.Matches(code);
    foreach (Match matchAux in oMatchCollectionAux)
    {
      code = code.Remove(matchAux.Groups["TYPE"].Index,    matchAux.Groups["TYPE"].Length);
      code = code.Insert(matchAux.Groups["TYPE"].Index, "&lt;span class=\"typevariable\"&gt;" + matchAux.Groups["TYPE"].Value + "&lt;/span&gt;");
    }
  }

  Regex regExCall = new Regex(@"(?&lt;type&gt;\w+)\s\w+\s=\s\w+");
  //regex to colorize an object received from a method call

  MatchCollection mcCall = regExCall.Matches(code);

  foreach (Match match in mcCall)
  {
    code = code.Remove(match.Groups["TYPE"].Index, match.Groups["TYPE"].Length);
    code = code.Insert(match.Groups["TYPE"].Index, "&lt;span class=\"typevariable\"&gt;" + match.Groups["TYPE"].Value + "&lt;/span&gt;");
  }

  string[] reservedWordArr = words.Split('|');

  for (int i = 0; i &lt;= reservedWordArr.Length - 1; i++)
  {
    Regex regexRW = new Regex(@"\s(?&lt;rw&gt;" + reservedWordArr[i] + @")\s");
    //regex to colorize reserved words
    MatchCollection matchColRW = regexRW.Matches(code);
    foreach (Match match in matchColRW)
    {
      code = code.Remove(match.Groups["RW"].Index, match.Groups["RW"].Length);
      code = code.Insert(match.Groups["RW"].Index, "&lt;span class=\"typevariable\"&gt;" + match.Groups["RW"].Value + "&lt;/span&gt;");
    }
  }

  return code;
}
&lt;/pre&gt;and that's it! of course for your case, you change the markup I added..&lt;br /&gt;
&lt;br /&gt;
See you soon :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2792201692341009334-8250083015262272822?l=sharpdevpt.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/J7Foo1tcAGAUAwXti0XHO9yuouM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/J7Foo1tcAGAUAwXti0XHO9yuouM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/J7Foo1tcAGAUAwXti0XHO9yuouM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/J7Foo1tcAGAUAwXti0XHO9yuouM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SharpDevelopBlog/~4/2mKbK2J_b7U" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sharpdevpt.blogspot.com/feeds/8250083015262272822/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2792201692341009334&amp;postID=8250083015262272822" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/8250083015262272822?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/8250083015262272822?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SharpDevelopBlog/~3/2mKbK2J_b7U/colorize-c-code-with-regex-and-html.html" title="Colorize C# code with RegEx and HTML" /><author><name>Ricardo Rodrigues</name><uri>http://www.blogger.com/profile/07328669019913577877</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://sharpdevpt.blogspot.com/2009/11/colorize-c-code-with-regex-and-html.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0AHRXc9fCp7ImA9WxBWEU0.&quot;"><id>tag:blogger.com,1999:blog-2792201692341009334.post-4156658965026974578</id><published>2009-11-02T15:43:00.003Z</published><updated>2010-02-02T11:22:14.964Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-02-02T11:22:14.964Z</app:edited><title>JQuery - ajax call with dynamic parameters</title><content type="html">This one was discovered because a colleague of mine asked me, and I started to wonder and realized I never used it before, never really needed it..But indeed, it can be quite handy!&lt;br /&gt;
Before you make the $.ajax call or $.post call or whatever, you do this:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: js"&gt;var parameters = {}; //declare the object
parameters["prop1"] = "value1"; //set some value
parameters["prop2"] = "value2"; //and again
&lt;/pre&gt;&lt;br /&gt;
Then, when you're making the actual request, you pass your object on the data field&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: js"&gt;$.ajax({
type: "POST",
url: "some.php",
data: parameters,
success: function(msg){
alert("nothing");
}
});
&lt;/pre&gt;&lt;br /&gt;
and voilá! you can build your parameters in a nice way, instead of "prop1=value1&amp;prop2=value2"&lt;br /&gt;
&lt;br /&gt;
Be back soon :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2792201692341009334-4156658965026974578?l=sharpdevpt.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/pEgOKLuYe4DgqF1gUST_Kjav3T4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pEgOKLuYe4DgqF1gUST_Kjav3T4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/pEgOKLuYe4DgqF1gUST_Kjav3T4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pEgOKLuYe4DgqF1gUST_Kjav3T4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SharpDevelopBlog/~4/8e9gvLfaKgU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sharpdevpt.blogspot.com/feeds/4156658965026974578/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2792201692341009334&amp;postID=4156658965026974578" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/4156658965026974578?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/4156658965026974578?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SharpDevelopBlog/~3/8e9gvLfaKgU/jquery-ajax-call-with-dynamic.html" title="JQuery - ajax call with dynamic parameters" /><author><name>Ricardo Rodrigues</name><uri>http://www.blogger.com/profile/07328669019913577877</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://sharpdevpt.blogspot.com/2009/11/jquery-ajax-call-with-dynamic.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0ADSHw-fyp7ImA9WxBWEU0.&quot;"><id>tag:blogger.com,1999:blog-2792201692341009334.post-2681462466308599783</id><published>2009-10-29T16:44:00.001Z</published><updated>2010-02-02T11:22:59.257Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-02-02T11:22:59.257Z</app:edited><title>JQuery pass parameter to event handler</title><content type="html">How can you pass values into a event handler, plain and simple?&lt;br /&gt;
&lt;br /&gt;
here it is! &lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: js"&gt;var somevar = 'value'; //declare some var
&lt;/pre&gt;&lt;br /&gt;
And here comes the magic, on the bind function, in the second parameter, you define the data structure to pass on to your anonymous event handler (which can be multiple parameters, comma separated).&lt;br /&gt;
(notice that you have to receive the event parameter on the handler function, so you can access the data you sent)&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: js"&gt;$("&lt;a href='#'&gt;something&lt;/a&gt;").bind("click", { data: somevar }, function(event) {
event.data.data //this is the way you can access it on the handler function
}
&lt;/pre&gt;&lt;br /&gt;
So, what's the use of this? you can send data that is accessible in your current context, where you are defining the handler, but inside the handler it's unreachable.&lt;br /&gt;
&lt;br /&gt;
Hope this is as useful for you as it was for me!&lt;br /&gt;
&lt;br /&gt;
See you soon :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2792201692341009334-2681462466308599783?l=sharpdevpt.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ZHsXCfMjo8AIRXUDGmhp03jKuWw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ZHsXCfMjo8AIRXUDGmhp03jKuWw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ZHsXCfMjo8AIRXUDGmhp03jKuWw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ZHsXCfMjo8AIRXUDGmhp03jKuWw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SharpDevelopBlog/~4/_5CD7QtpaEo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sharpdevpt.blogspot.com/feeds/2681462466308599783/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2792201692341009334&amp;postID=2681462466308599783" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/2681462466308599783?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/2681462466308599783?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SharpDevelopBlog/~3/_5CD7QtpaEo/jquery-pass-parameter-to-event-handler.html" title="JQuery pass parameter to event handler" /><author><name>Ricardo Rodrigues</name><uri>http://www.blogger.com/profile/07328669019913577877</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://sharpdevpt.blogspot.com/2009/10/jquery-pass-parameter-to-event-handler.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A04MQ3Y9fyp7ImA9WxBWFks.&quot;"><id>tag:blogger.com,1999:blog-2792201692341009334.post-2019192013754794791</id><published>2009-10-28T22:02:00.006Z</published><updated>2010-02-08T22:59:42.867Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-02-08T22:59:42.867Z</app:edited><title>Deserialize JSON with C#</title><content type="html">You're using JQuery, making some fancy ajax requests, but tired of Request["setting"] to get data from client-side, starving for a strong-typed approach? STOP! I've got just what you need, and supports single object, and even lists of objects (arrays)!&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: js"&gt;Single: { "field1":"value1","field2":"value2" }
Array: [ { "field1":"value1","field2":"value2" }, { "field1":"value1","field2":"value2" } ]
&lt;/pre&gt;&lt;br /&gt;
For the single, the .NET Framework has the key, you need to create a class that has public fields or properties matching the field names on your JSON string, example:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: csharp"&gt;public class Test
{
public string field1 { get; set; }
public string field2 { get; set; }
}
&lt;/pre&gt;&lt;br /&gt;
And the code to serialize your Single JSON is this:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: csharp"&gt;Test myDeserializedObj = (Test)JavaScriptConvert.DeserializeObject(Request["jsonString"], typeof(Test));       
&lt;/pre&gt;&lt;br /&gt;
and voilá! you got yourself a strong-typed object with client-side data, sweet!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
But and if I want a list of data of the same type, say an Array, how is it done? The .NET Framework hasn't got the answer for this one..&lt;br /&gt;
You have to download and reference the &lt;a href="http://json.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=34269" target="_blank"&gt;following DLL&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Once it's done:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: csharp"&gt;List&lt; test &gt; myDeserializedObjList = (List&lt; test &gt;)Newtonsoft.Json.JsonConvert.DeserializeObject(Request["jsonString"], typeof(List&lt; test &gt;));
&lt;/pre&gt;&lt;br /&gt;
and yes! you're done :)&lt;br /&gt;
&lt;br /&gt;
How easy is this? It's perfect for your lightweight ajax applications with .NET backend.&lt;br /&gt;
&lt;br /&gt;
Please post comments!&lt;br /&gt;
&lt;br /&gt;
See you soon&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2792201692341009334-2019192013754794791?l=sharpdevpt.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/64vCAjyf0qFCjn0DoXVDDaMf9WM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/64vCAjyf0qFCjn0DoXVDDaMf9WM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/64vCAjyf0qFCjn0DoXVDDaMf9WM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/64vCAjyf0qFCjn0DoXVDDaMf9WM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SharpDevelopBlog/~4/W5IqjFRWHVw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sharpdevpt.blogspot.com/feeds/2019192013754794791/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2792201692341009334&amp;postID=2019192013754794791" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/2019192013754794791?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/2019192013754794791?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SharpDevelopBlog/~3/W5IqjFRWHVw/deserialize-json-on-c.html" title="Deserialize JSON with C#" /><author><name>Ricardo Rodrigues</name><uri>http://www.blogger.com/profile/07328669019913577877</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>4</thr:total><feedburner:origLink>http://sharpdevpt.blogspot.com/2009/10/deserialize-json-on-c.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkcGRH84cSp7ImA9WxBWEUw.&quot;"><id>tag:blogger.com,1999:blog-2792201692341009334.post-8265177104442307028</id><published>2009-10-27T17:03:00.004Z</published><updated>2010-02-02T11:27:05.139Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-02-02T11:27:05.139Z</app:edited><title>JQuery and XML</title><content type="html">Today I've started to use JQuery for XML navigation for the first time. For what I've seen it seems that it is pretty easy, just like using it for HTML, like:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: js"&gt;$(xml).find('element').each(function() {
//do something
$('some html element').append($(this).find('nested element').attr('test'));
});
&lt;/pre&gt;&lt;br /&gt;
nice hã?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2792201692341009334-8265177104442307028?l=sharpdevpt.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/v4qOGT2WLS6lLB6WEu3XqzsW3Ag/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/v4qOGT2WLS6lLB6WEu3XqzsW3Ag/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/v4qOGT2WLS6lLB6WEu3XqzsW3Ag/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/v4qOGT2WLS6lLB6WEu3XqzsW3Ag/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SharpDevelopBlog/~4/rxhyKIaZuC4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sharpdevpt.blogspot.com/feeds/8265177104442307028/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2792201692341009334&amp;postID=8265177104442307028" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/8265177104442307028?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/8265177104442307028?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SharpDevelopBlog/~3/rxhyKIaZuC4/jquery-and-xml.html" title="JQuery and XML" /><author><name>Ricardo Rodrigues</name><uri>http://www.blogger.com/profile/07328669019913577877</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://sharpdevpt.blogspot.com/2009/10/jquery-and-xml.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkcCR3c7fip7ImA9WxBWEUw.&quot;"><id>tag:blogger.com,1999:blog-2792201692341009334.post-2875873030402025592</id><published>2009-07-23T10:11:00.003+01:00</published><updated>2010-02-02T11:27:46.906Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-02-02T11:27:46.906Z</app:edited><title>JQuery Searchable Select Plugin</title><content type="html">This is my first release of this plugin, many things need to get better, yes, but I think as it is will still help and allow me to upgrade it with your suggestions and feedback.&lt;br /&gt;
The usage is:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: js"&gt;$("some selector for selects").searchable();

//To use parameters:
$("some selector for selects").searchable({arrowImage: 'some path'});
&lt;/pre&gt;&lt;br /&gt;
The available parameters are:&lt;br /&gt;
arrowImage: absolute image path&lt;br /&gt;
arrowImageOver: absolute image path&lt;br /&gt;
arrowImageDown: absolute image path&lt;br /&gt;
highlightItemBgColor: css color&lt;br /&gt;
highlightItemTextColor: css color&lt;br /&gt;
elementStyle: css style ()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can download it &lt;a href="http://plugins.jquery.com/project/Searchable" target="_blank"&gt;here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2792201692341009334-2875873030402025592?l=sharpdevpt.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/dpbkPeyDoLklgpusia3U8isFVNI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/dpbkPeyDoLklgpusia3U8isFVNI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/dpbkPeyDoLklgpusia3U8isFVNI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/dpbkPeyDoLklgpusia3U8isFVNI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SharpDevelopBlog/~4/4TvmSp1gLoY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sharpdevpt.blogspot.com/feeds/2875873030402025592/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2792201692341009334&amp;postID=2875873030402025592" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/2875873030402025592?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/2875873030402025592?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SharpDevelopBlog/~3/4TvmSp1gLoY/jquery-searchable-select-plugin.html" title="JQuery Searchable Select Plugin" /><author><name>Ricardo Rodrigues</name><uri>http://www.blogger.com/profile/07328669019913577877</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://sharpdevpt.blogspot.com/2009/07/jquery-searchable-select-plugin.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkYMQ3k4cCp7ImA9WxJbE04.&quot;"><id>tag:blogger.com,1999:blog-2792201692341009334.post-5927087911214866313</id><published>2009-07-23T09:34:00.001+01:00</published><updated>2009-07-23T09:36:22.738+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-07-23T09:36:22.738+01:00</app:edited><title>jquery plugin</title><content type="html">I've started to develop my first jquery plugin, i'ts almost ready, I just have to parametrize images and stuff like that, to leave it the more customizable as we all enjoy. Since I haven't found any plugin to do what this one does, I'm guessing many of you will use it, and hopefully enjoy it as much as I do...&lt;br /&gt;Coming soon! :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2792201692341009334-5927087911214866313?l=sharpdevpt.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/5tUYjIB7-JrWrNsKWfSklX6Ay3s/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5tUYjIB7-JrWrNsKWfSklX6Ay3s/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/5tUYjIB7-JrWrNsKWfSklX6Ay3s/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5tUYjIB7-JrWrNsKWfSklX6Ay3s/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SharpDevelopBlog/~4/im29z2CcA8M" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sharpdevpt.blogspot.com/feeds/5927087911214866313/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2792201692341009334&amp;postID=5927087911214866313" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/5927087911214866313?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/5927087911214866313?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SharpDevelopBlog/~3/im29z2CcA8M/jquery-plugin.html" title="jquery plugin" /><author><name>Ricardo Rodrigues</name><uri>http://www.blogger.com/profile/07328669019913577877</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://sharpdevpt.blogspot.com/2009/07/jquery-plugin.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0UMRXozcCp7ImA9WxJXEUw.&quot;"><id>tag:blogger.com,1999:blog-2792201692341009334.post-5584302225163749996</id><published>2009-06-04T11:20:00.003+01:00</published><updated>2009-06-04T11:28:04.488+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-04T11:28:04.488+01:00</app:edited><title>Google Wave</title><content type="html">As soon as I saw like 18 minutes of the Google Wave preview video (http://wave.google.com), I was stunned and at the same time asking myself, howcome this didn't exist earlier, because it's a simple concept although it's a revolution in the web communication/collaboration "market".&lt;br /&gt;The video it's definitely worth the view, and my guess is that this will overcome email and all the current social/collaboration tools/sites, because the nailed it right on the spot!&lt;br /&gt;Congrats to Google!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2792201692341009334-5584302225163749996?l=sharpdevpt.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/5qB7iIfDOk1E5WGnNoVPbbhLOb4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5qB7iIfDOk1E5WGnNoVPbbhLOb4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/5qB7iIfDOk1E5WGnNoVPbbhLOb4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5qB7iIfDOk1E5WGnNoVPbbhLOb4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SharpDevelopBlog/~4/Vll8uFwLRIU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sharpdevpt.blogspot.com/feeds/5584302225163749996/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2792201692341009334&amp;postID=5584302225163749996" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/5584302225163749996?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/5584302225163749996?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SharpDevelopBlog/~3/Vll8uFwLRIU/google-wave.html" title="Google Wave" /><author><name>Ricardo Rodrigues</name><uri>http://www.blogger.com/profile/07328669019913577877</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://sharpdevpt.blogspot.com/2009/06/google-wave.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkYERXw8fip7ImA9WxBWEUw.&quot;"><id>tag:blogger.com,1999:blog-2792201692341009334.post-1286275397385249446</id><published>2009-05-14T16:15:00.003+01:00</published><updated>2010-02-02T11:28:24.276Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-02-02T11:28:24.276Z</app:edited><title>Filter javascript array items with jquery</title><content type="html">In JQuery there's a function that allows us to filter specific items of an array:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush: js"&gt;var test = ["pineaple","apple","strawberry"];
var test_changed = $.grep(array, function(n, i) { return n!="apple"; });
&lt;/pre&gt;&lt;br /&gt;
The test_changed array would only contain the pineaple and the strawberry item.&lt;br /&gt;
&lt;br /&gt;
Dismitify:&lt;br /&gt;
&lt;br /&gt;
The parameters of the $.grep function are:&lt;br /&gt;
First parameter is the array you want to manipulate&lt;br /&gt;
Second parameter is the function that executes the filter on the array (returns true for that item to remain and false for that item to be excluded. The function is called for each item of the array).&lt;br /&gt;
This filtering function gets two parameters:&lt;br /&gt;
The first one is the current array item (current of the iteration)&lt;br /&gt;
The second one is the current array position (aka index).&lt;br /&gt;
&lt;br /&gt;
I hope this is useful for you as it was for me!&lt;br /&gt;
&lt;br /&gt;
Be back soon!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2792201692341009334-1286275397385249446?l=sharpdevpt.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/bRIelhzeGgExZJ8VLU_1gtD7vr4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bRIelhzeGgExZJ8VLU_1gtD7vr4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/bRIelhzeGgExZJ8VLU_1gtD7vr4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bRIelhzeGgExZJ8VLU_1gtD7vr4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SharpDevelopBlog/~4/DKgCiorMFH4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sharpdevpt.blogspot.com/feeds/1286275397385249446/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2792201692341009334&amp;postID=1286275397385249446" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/1286275397385249446?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/1286275397385249446?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SharpDevelopBlog/~3/DKgCiorMFH4/filter-javascript-array-items-with.html" title="Filter javascript array items with jquery" /><author><name>Ricardo Rodrigues</name><uri>http://www.blogger.com/profile/07328669019913577877</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://sharpdevpt.blogspot.com/2009/05/filter-javascript-array-items-with.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEEAQn87cCp7ImA9WxJRE0o.&quot;"><id>tag:blogger.com,1999:blog-2792201692341009334.post-8445208155978898694</id><published>2009-05-14T15:01:00.002+01:00</published><updated>2009-05-15T09:37:23.108+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-15T09:37:23.108+01:00</app:edited><title>Preface</title><content type="html">Very well, I never had a blog before, since there's so much buzz about it, I decided to try it and start a little blog about (for now) subjects related with software development and all that it concerns.&lt;br /&gt;I hope this blog will come in good use to all the visitors and I'll be looking forward for your comment.&lt;br /&gt;&lt;br /&gt;I'll be waiting! Thank you!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2792201692341009334-8445208155978898694?l=sharpdevpt.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/KuXPzuyjfdimKN9e6-ebqFbsqAo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KuXPzuyjfdimKN9e6-ebqFbsqAo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/KuXPzuyjfdimKN9e6-ebqFbsqAo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KuXPzuyjfdimKN9e6-ebqFbsqAo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SharpDevelopBlog/~4/egreUD7SA-0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sharpdevpt.blogspot.com/feeds/8445208155978898694/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2792201692341009334&amp;postID=8445208155978898694" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/8445208155978898694?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2792201692341009334/posts/default/8445208155978898694?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SharpDevelopBlog/~3/egreUD7SA-0/prefacio.html" title="Preface" /><author><name>Ricardo Rodrigues</name><uri>http://www.blogger.com/profile/07328669019913577877</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://sharpdevpt.blogspot.com/2009/05/prefacio.html</feedburner:origLink></entry></feed>

