using System;
using System.Reflection;
namespace Recetas.Cap03
{
public sealed class UsoGetProperties
{
public static void Main()
{
// Arreglo con elementos `PropertyInfo`:
PropertyInfo[] propiedades;
// Obtiene las propiedades de `Type`:
propiedades = Type.GetType("System.Type").GetProperties();
// Resultado:
Console.WriteLine ("\nPropiedades de `{0}`:\n", Type.GetType("System.Type").Name.ToString());
foreach (PropertyInfo propiedad in propiedades)
{
Console.WriteLine ("\tPropiedad: {0}", propiedad.ToString());
}
Console.WriteLine ();
}
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uUmVmbGVjdGlvbjsKCm5hbWVzcGFjZSBSZWNldGFzLkNhcDAzCnsKICAgIHB1YmxpYyBzZWFsZWQgY2xhc3MgVXNvR2V0UHJvcGVydGllcwogICAgewogICAgICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBNYWluKCkKICAgICAgICB7CiAgICAgICAgICAgIC8vIEFycmVnbG8gY29uIGVsZW1lbnRvcyBgUHJvcGVydHlJbmZvYDoKICAgICAgICAgICAgUHJvcGVydHlJbmZvW10gcHJvcGllZGFkZXM7CiAgICAgICAgICAgIAogICAgICAgICAgICAvLyBPYnRpZW5lIGxhcyBwcm9waWVkYWRlcyBkZSBgVHlwZWA6CiAgICAgICAgICAgIHByb3BpZWRhZGVzID0gVHlwZS5HZXRUeXBlKCJTeXN0ZW0uVHlwZSIpLkdldFByb3BlcnRpZXMoKTsKICAgICAgICAgICAgCiAgICAgICAgICAgIC8vIFJlc3VsdGFkbzoKICAgICAgICAgICAgQ29uc29sZS5Xcml0ZUxpbmUgKCJcblByb3BpZWRhZGVzIGRlIGB7MH1gOlxuIiwgVHlwZS5HZXRUeXBlKCJTeXN0ZW0uVHlwZSIpLk5hbWUuVG9TdHJpbmcoKSk7CiAgICAgICAgICAgIGZvcmVhY2ggKFByb3BlcnR5SW5mbyBwcm9waWVkYWQgaW4gcHJvcGllZGFkZXMpCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIENvbnNvbGUuV3JpdGVMaW5lICgiXHRQcm9waWVkYWQ6IHswfSIsIHByb3BpZWRhZC5Ub1N0cmluZygpKTsKICAgICAgICAgICAgfQogICAgICAgICAgICAKICAgICAgICAgICAgQ29uc29sZS5Xcml0ZUxpbmUgKCk7CiAgICAgICAgfQogICAgfQp9