Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
|
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 25th, 2007, 04:47 PM
Authorized User
 
Join Date: Aug 2004
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Baby_programmer Send a message via MSN to Baby_programmer Send a message via Yahoo to Baby_programmer
Default get tagged properties of class using reflection

Hi there,

I am very badly stuck in a problem where i am trying to retrieve properties of a class which are tagged by custom attribute which has no named and positional parameter, is it possible to get data without those parameters? here is the problem
[SuitProperty]
public new Color BackColor {
            get {return base.BackColor;}
            set {base.BackColor = value;}}

i am trying to get properties with relection, but not i am not sucessful,
Type t = ((ISuitControl)control).GetType();
     PropertyInfo[] properties = t.GetProperties();
     foreach (PropertyInfo property in properties)
please need urgent help

Baby Prgrammer
__________________
Baby Prgrammer
 
Old November 26th, 2007, 05:54 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Well you will need to check the PropertyInfo.Attributes collection to see if any of the attributes are your SuitPropertyAttribute class.

/- Sam Judson : Wrox Technical Editor -/





Similar Threads
Thread Thread Starter Forum Replies Last Post
List having properties of two different class. alok.kadu C# 1 April 3rd, 2008 03:14 AM
Reflection jayakumar.cj ASP.NET 1.0 and 1.1 Basics 1 July 15th, 2006 06:12 AM
xml and class properties sushma.varala XML 0 July 14th, 2006 07:59 AM
xml or class properties sushma.varala Classic ASP Components 0 July 14th, 2006 07:52 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.