Description
The DeclaredMembers
property provides an array of MemberDescription
objects that represent the members (such as methods, properties, etc.) declared specifically by the type described by this TypeDescription
instance. It does not include members that are inherited from base types.
Usage
Use the DeclaredMembers
property when you need to access or inspect only the members that are explicitly declared by a type, excluding any inherited members. This can be useful for reflection purposes, such as dynamically invoking methods or accessing properties that are unique to a specific type.
Example
// Example of accessing DeclaredMembers
TypeDescription typeDescription = TypeLibrary.GetTypeDescription(typeof(MyClass));
MemberDescription[] declaredMembers = typeDescription.DeclaredMembers;
foreach (var member in declaredMembers)
{
// Process each declared member
Console.WriteLine($"Member Name: {member.Name}, Member Type: {member.MemberType}");
}