Home > Net >  C # reflection
C # reflection

Time:09-26

How to reflect whether all members a class using the feature

CodePudding user response:

I remember a GetCustomAttributes after the GetProperty?

CodePudding user response:

reference 1st floor Eason0807 response:
GetProperty, I remember a GetCustomAttributes?

For this, , thank you,,,,,,,,

CodePudding user response:

If you have any specified characteristics to determine whether can write so

For example,
 
Var type=typeof (class);
Var propertyInfos=the GetProperties ();
Foreache (var p in propertyInfos)
{
If (p.I sDefined (typeof (CustomeAttribute), true))
{
.
}
}

Handwritten may have a spelling mistake!
  •  Tags:  
  • C#
  • Related