Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 ("\nConstructores de `{0}`:\n", typeof(ClaseDemo).Name.ToString());
- foreach (ConstructorInfo ctor in constructores)
- {
- Console.WriteLine ("\tFirma constructor: {0}", ctor.ToString());
- }
- Console.WriteLine ();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement