<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0">
  <channel>
    <title>DotNetKicks.com - Stories tagged with Reflection</title>
    <description>the latest stories tagged with 'Reflection' from DotNetKicks.com</description>
    <link>http://www.dotnetkicks.com/</link>
    <language>en-us</language>
    <copyright>Atweb Publishing Ltd.</copyright>
    <docs>http://backend.userland.com/rss</docs>
    <generator>DotNetKicks.com - .NET links, community driven</generator>
    <ttl>30</ttl>
    <item>
      <title>Manipulating Properties and Methods with Reflection</title>
      <description>Today I'm going to write about a simple yet powerful way to manipulate properties and methods of a given type. We'll set values to properties and invoke methods through the use of reflection. Maybe you haven't had the chance to use reflection or maybe you even don't know what is reflection. Reflection is one of the most powerful features a programming language has as is the case of C# programming language that I'll be using in this post. Read on... &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fwww.leniel.net%2f2010%2f06%2fmanipulate-property-method-reflection.html"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.leniel.net%2f2010%2f06%2fmanipulate-property-method-reflection.html" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;
</description>
      <link>http://www.dotnetkicks.com/tipsandtricks/Manipulating_Properties_and_Methods_with_Reflection</link>
      <guid isPermaLink="true">http://www.dotnetkicks.com/tipsandtricks/Manipulating_Properties_and_Methods_with_Reflection</guid>
      <pubDate>Sun, 06 Jun 2010 04:12:41 GMT</pubDate>
    </item>
    <item>
      <title>Binding to Anonymous types in Silverlight</title>
      <description>Talks about the problems with binding against anonymous types in Silverlight, and offers some possible solutions to the issues. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fgrahammurray.wordpress.com%2f2010%2f05%2f30%2fbinding-to-anonymous-types-in-silverlight%2f"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fgrahammurray.wordpress.com%2f2010%2f05%2f30%2fbinding-to-anonymous-types-in-silverlight%2f" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;
</description>
      <link>http://www.dotnetkicks.com/silverlight/Binding_to_Anonymous_types_in_Silverlight</link>
      <guid isPermaLink="true">http://www.dotnetkicks.com/silverlight/Binding_to_Anonymous_types_in_Silverlight</guid>
      <pubDate>Sun, 30 May 2010 15:25:08 GMT</pubDate>
    </item>
    <item>
      <title>Catastrophic failure : Reflection and Indexers</title>
      <description>How to access arrays using default indexer trough reflection. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fbackintothelab.blogspot.com%2f2010%2f04%2ftest.html"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fbackintothelab.blogspot.com%2f2010%2f04%2ftest.html" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;
</description>
      <link>http://www.dotnetkicks.com/csharp/Catastrophic_failure_Reflection_and_Indexers</link>
      <guid isPermaLink="true">http://www.dotnetkicks.com/csharp/Catastrophic_failure_Reflection_and_Indexers</guid>
      <pubDate>Fri, 09 Apr 2010 08:36:11 GMT</pubDate>
    </item>
    <item>
      <title>IQueryable: Sorting, Paging, Searching and Counting</title>
      <description>A good post that contains extension methods that add sorting, paging, seacrching and countain functionality to IQueryable objects.  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fwww.inflecto.co.uk%2fInflecto-Blog%2fpost%2f2009%2f11%2f12%2fIQueryable-Sorting-Paging-Searching-and-Counting.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.inflecto.co.uk%2fInflecto-Blog%2fpost%2f2009%2f11%2f12%2fIQueryable-Sorting-Paging-Searching-and-Counting.aspx" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;
</description>
      <link>http://www.dotnetkicks.com/csharp/IQueryable_Sorting_Paging_Searching_and_Counting</link>
      <guid isPermaLink="true">http://www.dotnetkicks.com/csharp/IQueryable_Sorting_Paging_Searching_and_Counting</guid>
      <pubDate>Thu, 12 Nov 2009 16:00:30 GMT</pubDate>
    </item>
    <item>
      <title>Exploring Reflection: Using Reflection to find Markers</title>
      <description>Taking a look at how to find various markers (interfaces and attributes) on a class by using reflection. This technique can help you to build out dynamic loading/find type of logic in your pluggable applications. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fwww.dimecasts.net%2fCasts%2fCastDetails%2f137"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.dimecasts.net%2fCasts%2fCastDetails%2f137" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;
</description>
      <link>http://www.dotnetkicks.com/csharp/Exploring_Reflection_Using_Reflection_to_find_Markers</link>
      <guid isPermaLink="true">http://www.dotnetkicks.com/csharp/Exploring_Reflection_Using_Reflection_to_find_Markers</guid>
      <pubDate>Tue, 01 Sep 2009 14:45:00 GMT</pubDate>
    </item>
    <item>
      <title>.NET Reflection - Generic Method Type Inference of a Boxed Parameter</title>
      <description>A look into calling a generic method with a boxed parameter and returning a strongly typed, unboxed instance of that method using System.Reflection. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2flakario.blogspot.com%2f2009%2f07%2fnet-reflection-generic-method-type.html"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2flakario.blogspot.com%2f2009%2f07%2fnet-reflection-generic-method-type.html" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;
</description>
      <link>http://www.dotnetkicks.com/csharp/NET_Reflection_Generic_Method_Type_Inference_of_a_Boxed_Parameter</link>
      <guid isPermaLink="true">http://www.dotnetkicks.com/csharp/NET_Reflection_Generic_Method_Type_Inference_of_a_Boxed_Parameter</guid>
      <pubDate>Fri, 31 Jul 2009 15:35:42 GMT</pubDate>
    </item>
    <item>
      <title>Using the CodeDom to do scripting with .Net</title>
      <description>The company I work for, Interactive Medica, provides SaaS business solutions for the pharmaceutical industry. Many of our clients receive data from third-parties which they need us to import into our system. This is pretty straight-forward and common in many industries. The data arrives in different formats, CSV files (or other delimited text files), Access database, Excel Spreadsheets, and so on. Sometimes the files are zipped and sometimes not. Sometimes the files are uploaded to us via FTP and at other times we need to pull the data, also usually via FTP. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fmsmvps.com%2fblogs%2fjoacim%2farchive%2f2009%2f06%2f16%2fusing-the-codedom-to-do-scripting-with-net.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fmsmvps.com%2fblogs%2fjoacim%2farchive%2f2009%2f06%2f16%2fusing-the-codedom-to-do-scripting-with-net.aspx" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;
</description>
      <link>http://www.dotnetkicks.com/vbnet/Using_the_CodeDom_to_do_scripting_with_Net</link>
      <guid isPermaLink="true">http://www.dotnetkicks.com/vbnet/Using_the_CodeDom_to_do_scripting_with_Net</guid>
      <pubDate>Tue, 16 Jun 2009 02:33:18 GMT</pubDate>
    </item>
    <item>
      <title>Weekly Tool Tip: Introducing .NET Reflector</title>
      <description>An introductory look at .NET Reflector &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fwww.myviewstate.net%2fblog%2fpost%2f2009%2f05%2f15%2fWeekly-Tool-Tip-Introducing-NET-Reflector.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.myviewstate.net%2fblog%2fpost%2f2009%2f05%2f15%2fWeekly-Tool-Tip-Introducing-NET-Reflector.aspx" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;
</description>
      <link>http://www.dotnetkicks.com/products/Weekly_Tool_Tip_Introducing_NET_Reflector</link>
      <guid isPermaLink="true">http://www.dotnetkicks.com/products/Weekly_Tool_Tip_Introducing_NET_Reflector</guid>
      <pubDate>Fri, 15 May 2009 21:56:09 GMT</pubDate>
    </item>
    <item>
      <title>Cloning Object Properties via Reflection &amp;#171; {Programming} &amp;amp; Life</title>
      <description>I had a case today where I needed to clone all properties of an object from one class to another of different types. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fgoneale.wordpress.com%2f2009%2f02%2f16%2fcloning-object-properties-via-reflection%2f"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fgoneale.wordpress.com%2f2009%2f02%2f16%2fcloning-object-properties-via-reflection%2f" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;
</description>
      <link>http://www.dotnetkicks.com/csharp/Cloning_Object_Properties_via_Reflection_Programming_Life</link>
      <guid isPermaLink="true">http://www.dotnetkicks.com/csharp/Cloning_Object_Properties_via_Reflection_Programming_Life</guid>
      <pubDate>Mon, 16 Feb 2009 17:33:55 GMT</pubDate>
    </item>
    <item>
      <title>Using Reflection to load unreferenced assemblies at runtime in C#</title>
      <description>Sure, we can define our application's referenced assemblies easily, but how would we interact with types in assemblies at runtime that we don't directly reference? This can be quite a problem for someone who is creating plug-in or add-on support for their application, where the assemblies they must reference will be added post-build. One of the functions of the System.Reflection namespace is loading assemblies and accessing their contained types. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fwww.codeproject.com%2fKB%2fcs%2fcsharpreflection.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.codeproject.com%2fKB%2fcs%2fcsharpreflection.aspx" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;
</description>
      <link>http://www.dotnetkicks.com/clr/Using_Reflection_to_load_unreferenced_assemblies_at_runtime_in_C</link>
      <guid isPermaLink="true">http://www.dotnetkicks.com/clr/Using_Reflection_to_load_unreferenced_assemblies_at_runtime_in_C</guid>
      <pubDate>Mon, 26 Jan 2009 22:36:11 GMT</pubDate>
    </item>
    <item>
      <title>FromKnownColor in the Compact Framework</title>
      <description>This blog post cleverly uses LINQ and Reflection to implement the missing method FromKnownColor in the Compact Framework &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fblog.dotnettech.net%2farchive%2f2009%2f01%2f14%2fusing-linq-and-reflection-to-implement-fromknowncolor-in-the-compact.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fblog.dotnettech.net%2farchive%2f2009%2f01%2f14%2fusing-linq-and-reflection-to-implement-fromknowncolor-in-the-compact.aspx" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;
</description>
      <link>http://www.dotnetkicks.com/linq/FromKnownColor_in_the_Compact_Framework</link>
      <guid isPermaLink="true">http://www.dotnetkicks.com/linq/FromKnownColor_in_the_Compact_Framework</guid>
      <pubDate>Wed, 21 Jan 2009 22:33:58 GMT</pubDate>
    </item>
    <item>
      <title>Adding Save() functionality to Microsoft.Net.Mail.MailMessage</title>
      <description>The MailMessage class provides functionality using the SmtpDeliveryMethod.SpecifiedPickupDirectory of SmtpClient to generate the emails to a file folder. However, I needed to control the filename used to output the email instead of using the SmtpClient's random Guid() approach.

  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fwww.codeproject.com%2fKB%2fIP%2fsmtpclientext.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.codeproject.com%2fKB%2fIP%2fsmtpclientext.aspx" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;
</description>
      <link>http://www.dotnetkicks.com/csharp/Adding_Save_functionality_to_Microsoft_Net_Mail_MailMessage</link>
      <guid isPermaLink="true">http://www.dotnetkicks.com/csharp/Adding_Save_functionality_to_Microsoft_Net_Mail_MailMessage</guid>
      <pubDate>Mon, 12 Jan 2009 23:45:33 GMT</pubDate>
    </item>
    <item>
      <title>C# Reflection : Fast Object Creation</title>
      <description>Fastest way to create a late latebound object in C# &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fblogs.msdn.com%2fzelmalki%2farchive%2f2008%2f12%2f12%2freflection-fast-object-creation.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fblogs.msdn.com%2fzelmalki%2farchive%2f2008%2f12%2f12%2freflection-fast-object-creation.aspx" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;
</description>
      <link>http://www.dotnetkicks.com/csharp/C_Reflection_Fast_Object_Creation</link>
      <guid isPermaLink="true">http://www.dotnetkicks.com/csharp/C_Reflection_Fast_Object_Creation</guid>
      <pubDate>Sat, 13 Dec 2008 16:43:56 GMT</pubDate>
    </item>
    <item>
      <title>Howto make unique Repository for all LinqToSql entities (GetById part)</title>
      <description>Tutorial about howto make Rep&amp;lt;Person&amp;gt;.GetById(personId)! &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fblog.dynback.com%2findex.php%2f2008%2f11%2farchitecture%2fdatabase%2frepository-in-linq-to-sql-getbyid-part%2f"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fblog.dynback.com%2findex.php%2f2008%2f11%2farchitecture%2fdatabase%2frepository-in-linq-to-sql-getbyid-part%2f" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;
</description>
      <link>http://www.dotnetkicks.com/database/Howto_make_unique_Repository_for_all_LinqToSql_entities_GetById_part</link>
      <guid isPermaLink="true">http://www.dotnetkicks.com/database/Howto_make_unique_Repository_for_all_LinqToSql_entities_GetById_part</guid>
      <pubDate>Fri, 28 Nov 2008 02:11:27 GMT</pubDate>
    </item>
    <item>
      <title>Creating instance of object dynamically in C#</title>
      <description>The article will help you to create any instance of a any object dynamically using Reflection and generics. You will learn how to apply constraints in generics.
 &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fneutrongenious.spaces.live.com%2fblog%2fcns!61E3517BD730D0C7!370.entry"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fneutrongenious.spaces.live.com%2fblog%2fcns!61E3517BD730D0C7!370.entry" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;
</description>
      <link>http://www.dotnetkicks.com/csharp/Creating_instance_of_object_dynamically_in_C</link>
      <guid isPermaLink="true">http://www.dotnetkicks.com/csharp/Creating_instance_of_object_dynamically_in_C</guid>
      <pubDate>Sat, 18 Oct 2008 22:48:33 GMT</pubDate>
    </item>
    <item>
      <title>Using Generics to Copy Data Between Classes of Different Types</title>
      <description>The latest in a series of posts exploring how we can reduce the grunt work in copying data between the data layer classes and the user interface classes. This uses a fluent interface to copy all of the data in one line of code rather than property by property. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fwww.alteridem.net%2f2008%2f07%2f21%2fextending-copyhelper-using-generics%2f"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.alteridem.net%2f2008%2f07%2f21%2fextending-copyhelper-using-generics%2f" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;
</description>
      <link>http://www.dotnetkicks.com/tipsandtricks/Using_Generics_to_Copy_Data_Between_Classes_of_Different_Types</link>
      <guid isPermaLink="true">http://www.dotnetkicks.com/tipsandtricks/Using_Generics_to_Copy_Data_Between_Classes_of_Different_Types</guid>
      <pubDate>Mon, 21 Jul 2008 21:44:41 GMT</pubDate>
    </item>
    <item>
      <title>Method to Copy Data Between Objects of Different Types</title>
      <description>One thing that I find tiresome when using the various Model/View patterns is the constant copying of data between the model and the view. This is the first post in a series on a possible easier way to do this. In this post I write a method that copies the data from one interface to another based on the names and types of the properties. Over the next few posts, I will extend the code to use generics and extension methods. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fwww.alteridem.net%2f2008%2f07%2f09%2fmethod-to-copy-data-between-objects-of-different-types%2f"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.alteridem.net%2f2008%2f07%2f09%2fmethod-to-copy-data-between-objects-of-different-types%2f" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;
</description>
      <link>http://www.dotnetkicks.com/csharp/Method_to_Copy_Data_Between_Objects_of_Different_Types</link>
      <guid isPermaLink="true">http://www.dotnetkicks.com/csharp/Method_to_Copy_Data_Between_Objects_of_Different_Types</guid>
      <pubDate>Wed, 09 Jul 2008 23:37:30 GMT</pubDate>
    </item>
    <item>
      <title>Stuff in Reflection that's not in Metadata</title>
      <description>Previously, I mentioned some things in Metadata that aren't exposed in Reflection.  Here's an opposite case. While metadata represents static bits on disk, Reflection operates in a live process with access to the CLR's loader. So reflection can represent things the CLR loader and type system may do that aren't captured in the metadata. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fblogs.msdn.com%2fjmstall%2farchive%2f2008%2f05%2f23%2fstuff-in-reflection-that-s-not-in-metadata.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fblogs.msdn.com%2fjmstall%2farchive%2f2008%2f05%2f23%2fstuff-in-reflection-that-s-not-in-metadata.aspx" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;
</description>
      <link>http://www.dotnetkicks.com/clr/Stuff_in_Reflection_that_s_not_in_Metadata</link>
      <guid isPermaLink="true">http://www.dotnetkicks.com/clr/Stuff_in_Reflection_that_s_not_in_Metadata</guid>
      <pubDate>Fri, 23 May 2008 22:09:16 GMT</pubDate>
    </item>
    <item>
      <title>Searching for derived types in an assembly</title>
      <description>Sometimes we need to find all classes or interfaces that derive a certain Type. There are several possible scenarios for this kind of search - For instance, if we are trying to load a plug-in assembly at runtime and wish to initialize all the classes that implement the IPluginBase interface. Using the suggested DerivedHelper makes it a lot easier. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fwww.sharpregion.com%2fpost%2fSearching-for-derived-types-in-an-assembly.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.sharpregion.com%2fpost%2fSearching-for-derived-types-in-an-assembly.aspx" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;
</description>
      <link>http://www.dotnetkicks.com/csharp/Searching_for_derived_types_in_an_assembly</link>
      <guid isPermaLink="true">http://www.dotnetkicks.com/csharp/Searching_for_derived_types_in_an_assembly</guid>
      <pubDate>Fri, 18 Apr 2008 11:46:02 GMT</pubDate>
    </item>
    <item>
      <title>Mono.Cecil vs. System.Reflection</title>
      <description>Patrick wrote a great post comparing Mono's Cecil against the built-in System.Reflection. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fcodebetter.com%2fblogs%2fpatricksmacchia%2farchive%2f2008%2f03%2f18%2fmono-cecil-vs-system-reflection.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fcodebetter.com%2fblogs%2fpatricksmacchia%2farchive%2f2008%2f03%2f18%2fmono-cecil-vs-system-reflection.aspx" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;
</description>
      <link>http://www.dotnetkicks.com/mono/Mono_Cecil_vs_System_Reflection</link>
      <guid isPermaLink="true">http://www.dotnetkicks.com/mono/Mono_Cecil_vs_System_Reflection</guid>
      <pubDate>Thu, 20 Mar 2008 10:09:33 GMT</pubDate>
    </item>
    <item>
      <title>Simple JavaScript Object Reflection API (.NET Style)</title>
      <description>I was thinking about how JavaScript JSON serializers go about serializing objects. But how does the serializer know about each of the objects properties? I figured JavaScript must have some method of object reflection (similar to .NET Reflection) and it does. Here's a simple Reflection namespace that allows you to more easily reflect through an objects methods and properties: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fpietschsoft.com%2fpost%2f2008%2f02%2fSimple-JavaScript-Object-Reflection-API-(NET-Style).aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fpietschsoft.com%2fpost%2f2008%2f02%2fSimple-JavaScript-Object-Reflection-API-(NET-Style).aspx" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;
</description>
      <link>http://www.dotnetkicks.com/ajax/Simple_JavaScript_Object_Reflection_API_NET_Style</link>
      <guid isPermaLink="true">http://www.dotnetkicks.com/ajax/Simple_JavaScript_Object_Reflection_API_NET_Style</guid>
      <pubDate>Fri, 29 Feb 2008 07:21:43 GMT</pubDate>
    </item>
    <item>
      <title>Reflecting on reflection</title>
      <description>Some weeks ago I was working on a project where we receive some ten or twenty different message types from a server, and they all need to be handled when they arrive. Of course, we want to use event driven programming to make this happen on the fly, instead of polling all the time.

All of the messages have the header in common, so we already made a abstract parent class called Message, and when it came to handling all the different messages, we wanted to write as little code as possible. So we added an abstract method called HandleResponse to the code.

So the idea was to identify the incoming message type and invoke the HandleResponse using reflection on the object that we had identified this as. To do this, we made a little xml file that contains the message code (A-Z) along with the name and reference to the class linked to the message type. When the program starts, it reads the xml into a dictionary, so we can look up the key (message code) and get the class reference in return.

XDocument descriptorsXml = XDocument.Load( @&amp;quot;.\Data\MessageDescriptors.xml&amp;quot;);

var descQuery = from desc in descriptorsXml.Descendants(&amp;quot;Message&amp;quot;)
select new MessageDescriptor
{
Code = desc.Element(&amp;quot;Code&amp;quot;).Value,
Name = desc.Element(&amp;quot;Name&amp;quot;).Value,
ObjectType = desc.Element(&amp;quot;ObjectType&amp;quot;).Value.ToType() ,
IsServerMessage = Convert.ToBoolean( desc.Element(&amp;quot;IsServerMessage&amp;quot;).Value )
};
foreach (MessageDescriptor m in descQuery)
{
descriptors.Add(m.Code, m);
}

Then, we have a MessageHandlingFactory that simply gets objects in from a queue, identifies the type, and invokes the HandleResponse. If the object isn't recognized (could be a new message type, or could be that the programmer forgot to insert the description in the XML file), the MessageHandlingFactory can either throw an exception, or better yet, return a string with message that tells the user what went wrong. If everything goes as planned, it returns a string with the identified typename.


object theType = Activator.CreateInstance(t, SessionID);
EventInfo eInfo = t.GetEvent(&amp;quot;OnWriteEvent&amp;quot;);
Message.WriteEventHandler theHandler = new Message.WriteEventHandler(OnWriteEventHandler);

eInfo.AddEventHandler(theType, theHandler);
theType.GetType().GetMethod(&amp;quot;HandleResponse&amp;quot;).Invoke(theType, new object[] { message });

return &amp;quot;MessageHandler: &amp;quot; + messageType;


That's all, folks!


Update February 13, 2008: The code has now been tested in a very high throughput environment, and it performs  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fsoftscenario.blogspot.com%2f2008%2f01%2freflecting-on-reflection.html"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fsoftscenario.blogspot.com%2f2008%2f01%2freflecting-on-reflection.html" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;
</description>
      <link>http://www.dotnetkicks.com/csharp/Reflecting_on_reflection</link>
      <guid isPermaLink="true">http://www.dotnetkicks.com/csharp/Reflecting_on_reflection</guid>
      <pubDate>Thu, 14 Feb 2008 19:00:30 GMT</pubDate>
    </item>
    <item>
      <title>How To build a lightweight, flexible logging component in C#</title>
      <description>How To build a lightweight, flexible logging component in C# &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fwww.sharpedgesoftware.com%2fBlog%2fpost%2fHow-To-build-a-lightweight%2c-flexible-logging-component-in-C.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.sharpedgesoftware.com%2fBlog%2fpost%2fHow-To-build-a-lightweight%2c-flexible-logging-component-in-C.aspx" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;
</description>
      <link>http://www.dotnetkicks.com/csharp/How_To_build_a_lightweight_flexible_logging_component_in_C</link>
      <guid isPermaLink="true">http://www.dotnetkicks.com/csharp/How_To_build_a_lightweight_flexible_logging_component_in_C</guid>
      <pubDate>Wed, 24 Oct 2007 03:00:27 GMT</pubDate>
    </item>
    <item>
      <title>How to tell if a .NET Assembly is debug or release</title>
      <description>Explains how to tell if a .NET Assembly is built for debug or release by using .NET Reflector and programmatically using System.Reflection. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fjamesewelch.com%2f2007%2f08%2f30%2fhow-to-tell-if-a-net-assembly-is-debug-or-release%2f"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fjamesewelch.com%2f2007%2f08%2f30%2fhow-to-tell-if-a-net-assembly-is-debug-or-release%2f" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;
</description>
      <link>http://www.dotnetkicks.com/tipsandtricks/How_to_tell_if_a_NET_Assembly_is_debug_or_release_1</link>
      <guid isPermaLink="true">http://www.dotnetkicks.com/tipsandtricks/How_to_tell_if_a_NET_Assembly_is_debug_or_release_1</guid>
      <pubDate>Thu, 06 Sep 2007 15:31:02 GMT</pubDate>
    </item>
    <item>
      <title>Reflection performance put in perspective</title>
      <description>The web framework I built over the last few years, ProMesh.NET, relies on reflection for a lot of the features it offers. Often though, I am asked if the heave use of reflection doesn't have a significant impact on performance.

My answer usually is: YES, but it doesn't matter. Now you probably think that I don't care about performance or that I've had too much too drink. None of the above. I'll explain: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fwww.blog.activa.be%2f2007%2f08%2f06%2fReflectionPerformancePutInPerspective.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.blog.activa.be%2f2007%2f08%2f06%2fReflectionPerformancePutInPerspective.aspx" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;
</description>
      <link>http://www.dotnetkicks.com/clr/Reflection_performance_put_in_perspective</link>
      <guid isPermaLink="true">http://www.dotnetkicks.com/clr/Reflection_performance_put_in_perspective</guid>
      <pubDate>Tue, 07 Aug 2007 08:01:02 GMT</pubDate>
    </item>
  </channel>
</rss>
