Getting All Static Fields In a Class Hierarchy

Using reflection is pretty straight forward and that's why I found it weird that I was trying to get all the Dependency Properties for the Silverlight ComboBox but I was only getting the fields defined in the class itself. None of the fields found in the base classes where being retrieved. Only then I learned something new about reflection and static fields. Here is the code I expected to work but doesn't.
FieldInfo[] fields =
     typeof (ComboBox).GetFields(BindingFlags.Static | BindingFlags.Public);
When reflecting over a class to get all it's static fields you will find out that static fields from base classes are really not retrieved by default. And since all Dependency Properties are static fields you can't get the DP's from the base classes. If you want to retrieve all the static fields in a class hierarchy you need a special BindingFlag: BindingFlags.FlattenHierarchy. This will bring all your static fields including the one from the base classes.
 FieldInfo[] fields =
     typeof (ComboBox).GetFields(BindingFlags.Static | BindingFlags.Public |
                                 BindingFlags.FlattenHierarchy);

 Hope this is a useful tip.

Great Results Using SEO Toolkit

When I decided to test the Search Engine Optimization  Toolkit to check my blog health. I wanted to see if I had many broken links, pages missing titles and things like that. For this purpose the tool was really useful because I found a bug in the way I was generating the tags for the posts. I fixed this issue and many other minor ones like post titles being to long.

What really amazed me about the SEO Toolkit was only clear about one month later, after the search engines had the chance to crawl my site a few times. Google Analytics is showing an amazing increase in traffic: 89%! This is a lot. I really didn't expect that much improvement. Congrats to Microsoft once more on the job well done.

Here is a weekly view of the number of visits. I optimized my blog with the IIS Toolkit on the end of the year. Can you notice the improvement?

 Google Analytics Results

I wanted to show the comparison report generated for my site before and after I made the fixes but I formatted my notebook last week and lost all the reports. Shame on me!