c# - TypeDescriptor.GetProperties from property in another class -
I am using GetProperties to get the property file with the map
PropertyDescriptor descriptor = TypeDescriptor.GetProperties (GetType ()) [attrNane]; But is it possible to get property descriptor from another class? Example
class a {The name of the public string; } Class B {public B () {property descriptor descriptor = type descriptor. GetPyPerties (GetType ()) ["a.name"]; } }
So I want to get property name from "name" class propertyDescriptor > A . Is it possible anyway?
You can get a type another category. get class {public string name}; Set;}} class B {public B () {property descriptor descriptor = type descriptor. GetProperties (typef (a)) ["name"]; } Note that I have converted a.name into a property.
Comments
Post a Comment