using System;
using System.Reflection ;
namespace Recetas.Cap03
{
public class ClaseDemo
{
public ClaseDemo ( ) { }
public ClaseDemo ( int i) { }
public ClaseDemo ( int i, string s) { }
public ClaseDemo ( object[ ] o) { }
}
public sealed class UsoGetConstructors
{
public static void Main( )
{
// Arreglo de elementos `ConstructorInfo`:
ConstructorInfo[ ] constructores;
// Invocación de `GetConstructors` sobre la
// representación `Type` de `ClaseDemo`:
constructores = typeof( ClaseDemo) .GetConstructors ( ) ;
Console.WriteLine ( "\n Constructores de `{0}`:\n " , typeof( ClaseDemo) .Name .ToString ( ) ) ;
foreach ( ConstructorInfo ctor in constructores)
{
Console.WriteLine ( "\t Firma constructor: {0}" , ctor.ToString ( ) ) ;
}
Console.WriteLine ( ) ;
}
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uUmVmbGVjdGlvbjsKCm5hbWVzcGFjZSBSZWNldGFzLkNhcDAzCnsKICAgIHB1YmxpYyBjbGFzcyBDbGFzZURlbW8KICAgIHsKICAgICAgICBwdWJsaWMgQ2xhc2VEZW1vICgpIHsgfQogICAgICAgIHB1YmxpYyBDbGFzZURlbW8gKGludCBpKSB7IH0KICAgICAgICBwdWJsaWMgQ2xhc2VEZW1vIChpbnQgaSwgc3RyaW5nIHMpIHsgfQogICAgICAgIHB1YmxpYyBDbGFzZURlbW8gKG9iamVjdFtdIG8pIHsgfQogICAgfQogICAgCiAgICBwdWJsaWMgc2VhbGVkIGNsYXNzIFVzb0dldENvbnN0cnVjdG9ycwogICAgewogICAgICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBNYWluKCkKICAgICAgICB7CiAgICAgICAgICAgIC8vIEFycmVnbG8gZGUgZWxlbWVudG9zIGBDb25zdHJ1Y3RvckluZm9gOgogICAgICAgICAgICBDb25zdHJ1Y3RvckluZm9bXSBjb25zdHJ1Y3RvcmVzOwogICAgICAgICAgICAKICAgICAgICAgICAgLy8gSW52b2NhY2nDs24gZGUgYEdldENvbnN0cnVjdG9yc2Agc29icmUgbGEgCiAgICAgICAgICAgIC8vIHJlcHJlc2VudGFjacOzbiBgVHlwZWAgZGUgYENsYXNlRGVtb2A6CiAgICAgICAgICAgIGNvbnN0cnVjdG9yZXMgPSB0eXBlb2YoQ2xhc2VEZW1vKS5HZXRDb25zdHJ1Y3RvcnMoKTsKICAgICAgICAgICAgCiAgICAgICAgICAgIENvbnNvbGUuV3JpdGVMaW5lICgiXG5Db25zdHJ1Y3RvcmVzIGRlIGB7MH1gOlxuIiwgdHlwZW9mKENsYXNlRGVtbykuTmFtZS5Ub1N0cmluZygpKTsKICAgICAgICAgICAgZm9yZWFjaCAoQ29uc3RydWN0b3JJbmZvIGN0b3IgaW4gY29uc3RydWN0b3JlcykKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgQ29uc29sZS5Xcml0ZUxpbmUgKCJcdEZpcm1hIGNvbnN0cnVjdG9yOiB7MH0iLCBjdG9yLlRvU3RyaW5nKCkpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIAogICAgICAgICAgICBDb25zb2xlLldyaXRlTGluZSAoKTsKICAgICAgICB9CiAgICB9Cn0=