.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links


Posted By:      Posted Date: August 29, 2010    Points: 0   Category :WPF
PropertyInfo[] properties = this.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance); what  hold in properties?

View Complete Post

More Related Resource Links

using reflection to emit properties to the top of the entity graph


I've got a class

  public class Criminal

public HouseholdMember[] LiedAboutFSHousehold { get; set; }

      public HouseholdMember[] FoodstampTrafficingHousehold { get; set; }
HouseholdMember inherits Person, as do many other classes.  

  public class HouseholdMember: Person


What I&#

Custom Attributes + Reflection


I recently started messing around with custom attributes and reflection. In my code below GetCustomAttributes never return a list (it should return atleast one):

Am i defining the custom attrib wrong?

public class GOrder:IOrder
        public string CertProductIDString { get; set; }

        public string GetRESTParams()
            string data = string.Empty;
                System.Reflection.MemberInfo inf = this.GetType();
                object[] attributes;
                attributes =  inf.GetCustomAttributes(typeof(RESTParamAttrib), true);
                foreach (Object attribute in attributes)
                    RESTParamAttrib attrib = (RESTParamAttrib)attribute;
                    data = data + string.Format("\nData: {0}", attrib.Param);

            catch (Exception ex)

                throw ex;

            return data;

    public class RESTParamAttrib:System.Attribute
        public RESTParamAttrib (string param)
            Param = param;

        public string

Basic Instincts: Inspecting COM Objects With Reflection


Reflection is useful for debugging and logging and otherwise providing the type information you need. Here you'll see how to use reflection on COM types.

Lucian Wischik

MSDN Magazine January 2009

Advanced Basics: Reflection and Generics


This month Advanced Basics flaunts the power of generics and reflection and shows how you get more flexible and efficient development by combining the two.

Ken Getz

MSDN Magazine January 2008

CLR Inside Out: Reflections on Reflection


This month's installment of CLR Inside Out takes on reflection and the System.Reflection namespace.

Mike Repass

MSDN Magazine June 2007

Basic Instincts: Reflection in Visual Basic .NET


In the May 2005 Basic Instincts column I wrote about the Microsoft® . NET Framework support for custom attributes and attribute-based programming (see Basic Instincts: Designing With Custom Attributes).

Ted Pattison

MSDN Magazine August 2005

Reflection: Dodge Common Performance Pitfalls to Craft Speedy Applications


With reflection in .NET, you can load types, understand their members, make decisions about them, and execute, all within the safety of the managed runtime. But to use this power wisely, it's important to understand the associated costs and pitfalls to keep performance impact at a minimum. This article explains how.

Joel Pobar

MSDN Magazine July 2005

.NET Matters: How Microsoft Uses Reflection


In this fourth installment of . NET Matters, I'm taking a breather from the Q&A format. Instead, this month I bring you stories from the trenches; developers in product groups within Microsoft describe how they use .

Edited by Stephen Toub

MSDN Magazine July 2004

Design Patterns: Creating Dynamic Factories in .NET Using Reflection


Design patterns are a powerful tool for designing flexible soft-ware. They provide well-tested solutions to recurring software design problems. One such widely used pattern is the Concrete Factory.

Romi Kovacs

MSDN Magazine March 2003

CLR Types: Use Reflection to Discover and Assess the Most Common Types in the .NET Framework


The .NET Framework Class Library and the common language runtime (CLR) serve as the foundation for all .NET-based applications. But how much do you know about any of the thousands of CLR classes in the library and where do you begin to learn about them?In this article, the author uses the number of relationships with other types to determine which types are going to affect your programming most frequently and how often you'll encounter them. He programmatically surveys the CLR library using reflection to make that determination. Following that, an in-depth examination of the nine most important CLR types is provided.

Panos Kougiouris

MSDN Magazine October 2002

.NET Reflection: Dynamically Bind Your Data Layer to Stored Procedures and SQL Commands Using .NET M


One major inconvenience of using SQL stored procedures from code is having to match type information. You have to write long wrapper functions around the procedures just to expose the data types. In the .NET Framework, however, the reflection services of the System.Reflection namespace allow you to query rich metadata that describe data types. This article explains how to use reflection in .NET to end your stored procedure nightmares. The author creates four custom classes, including one that generates a SQLCommand object based on the metadata of a method. Using this library, you'll be on your way to automating the generation of stored procedures.

Atif Aziz

MSDN Magazine August 2002

How to Implement ISerializable using Reflection

I trying to serialize my business object manually by implementing the ISerializable interface, but is there any way to implement the Iserialazble in the base class and no need to tell the Derived class to which fields to Serialize or not. I tried it to find the source on the internet and able to get a similar code in which base class loops through each derived classes and their base classes and so on, to find out the private field members and add them to serializationinfo parameter, but that code also serializes the events which is causing error for my code, so I want to know how do I tell that only serializes the fields and skip all the events...

how to get the value of a class property using reflection?

i have a class like this..public class MyClass{List<ValueObjectClass> SampleList {get; set;}...}how can i get the value of MyClass.SampleList using reflection and convert it to List<T>?thanks..

FAQ: How do I link a delegate to an event using Reflection?

How do I link a delegate to an event using Reflection?Please remember to mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.

Reflection Effect For Beginners Using Silverlight 4

In this post I will show you how you can create the Reflection effect using the blend 4 in Silverlight application. It is really easy and nice to have the reflection effect in your application.Creating reflection and mirror effects is a little different than creating blur and shadow effects because these effects are not built into Silverlight. However, you can create reflection and mirror effects by using features present in Silverlight. Output of the this exercise will be as shown in the Image 1.

Reflection.Assembly Load Failure on GAC Deployed DLL From Layouts Directory

So, I've got the oddest thing going on with a web part project that I'm working on for our MOSS '07 server farm.I created a web part that connects to our Active Directory as a sort of company directory thing.  Permission requirements seem to be such that I have to deploy the DLL to the GAC, which I've configured my setup package (WSP Builder) to do.  Everything seems to be working just fine.Then, I add an ASPX page to the Layouts directory in the 12 hive which is supposed to display all the contact details for the domain user by accessing the same DLL that the web part uses.  However, the ASPX page can't find the DLL in the GAC.  I get the following error message in my popup window:File Not Found.   at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)    at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)    at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)    at System.Reflection.Assembly.Load(String assemblyString)    at System.Web.Configuration.CompilationSection.LoadAssembly(String assemblyName, Boolean throwOnFail

How I get set property of App.cs of my .exe using reflection in WPF

Hi, I want to get property defined in my .exe file in WPF. How can i access properties of App.cs class of my EXE file. In my application i tried the following code Assembly opAssembly = Assembly.LoadFile(Environment.CurrentDirectory + @"\MyApp.exe"); Type opType = opAssembly.GetType("OPmall.App");  object opInstance = Activator.CreateInstance(opType);   but it's gives error. Exception has been thrown by the target of an invocation. please help!!
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend