To use it, you need to pass a component to its type methods. In the above code, I have just sealed an object of Button class you can use any class for this and got the information name in this example from it. The GetProperties actually take either the new or Typeof object to list all the Events it has in a form of PropertyDescriptorCollection. Similarly, GetEvents saiaj list all the events in the form of EventDescriptor.
The example provided in this module can be used in different ways..
TypeDescriptor is a static sealed class which makes the starting point of the API. It exposes information of the object daitng terms of Properties, Attributes, Events, etc. Datjng though the basic usage of TypeDescriptor is to get metadata of an object, yet it also exposes features to extend the object on the fly. Let us now discuss few capabilities of Descriptors with a little information about its usage.
TypeDescriptor is used to get information of a Type.