Delegates to proerty

  • Thread starter Thread starter Guest
  • Start date Start date
Hi Brian,

There is no direct way of doing it...

Anyways, there is a hack.... One way is to create the delegate for Set and
Get methods which are created for the property. I.e. for example if you have
a property named Age then depending on whether you have set/get for the
property two methods will be created internally they are Set_Age and Get_Age
respectively. Now you can create a delegate for these two methods and
accomplish your task.

For more information take a look the below artcle.

<http://www.codeproject.com/csharp/csharptips.asp>

HTH

Regards,
Madhu

C# - MVP | MCSD.NET
 
thanks for your help,
regds
brian

Madhu said:
Hi Brian,

There is no direct way of doing it...

Anyways, there is a hack.... One way is to create the delegate for Set and
Get methods which are created for the property. I.e. for example if you have
a property named Age then depending on whether you have set/get for the
property two methods will be created internally they are Set_Age and Get_Age
respectively. Now you can create a delegate for these two methods and
accomplish your task.

For more information take a look the below artcle.

<http://www.codeproject.com/csharp/csharptips.asp>

HTH

Regards,
Madhu

C# - MVP | MCSD.NET
 
Back
Top