// ===++===
//
// OrtizOL
//
// ===--===
/*============================================================
//
// Clase: AccesoMiembrosClaseExterna.cs
//
// PropĆ³sito: Demostrar el acceso a miembros de clase
// externa desde un tipo anidado.
//
============================================================*/
using System;
namespace Articulos.Cap03
{
internal class ClaseExterna
{
public static int valor = 101;
public class ClaseAnidada
{
public void Metodo()
{
Console.WriteLine("Contenido de `ClaseExterna.Valor` : {0}",
ClaseExterna.valor.ToString());
}
}
}
internal class PruebaMiembrosEstaticos
{
public static void Main()
{
ClaseExterna.ClaseAnidada ca = new ClaseExterna.ClaseAnidada();
ca.Metodo();
}
}
}
Ly8gPT09Kys9PT0KLy8KLy8gICAgT3J0aXpPTAovLwovLyA9PT0tLT09PQovKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQovLwovLyBDbGFzZTogQWNjZXNvTWllbWJyb3NDbGFzZUV4dGVybmEuY3MKLy8KLy8gUHJvcMOzc2l0bzogRGVtb3N0cmFyIGVsIGFjY2VzbyBhIG1pZW1icm9zIGRlIGNsYXNlIAovLyBleHRlcm5hIGRlc2RlIHVuIHRpcG8gYW5pZGFkby4KLy8KPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KCnVzaW5nIFN5c3RlbTsKCm5hbWVzcGFjZSBBcnRpY3Vsb3MuQ2FwMDMKewogICAgaW50ZXJuYWwgY2xhc3MgQ2xhc2VFeHRlcm5hCiAgICB7CiAgICAgICAgcHVibGljIHN0YXRpYyBpbnQgdmFsb3IgPSAxMDE7CiAgICAgICAgCiAgICAgICAgcHVibGljIGNsYXNzIENsYXNlQW5pZGFkYQogICAgICAgIHsKICAgICAgICAgICAgcHVibGljIHZvaWQgTWV0b2RvKCkKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgQ29uc29sZS5Xcml0ZUxpbmUoIkNvbnRlbmlkbyBkZSBgQ2xhc2VFeHRlcm5hLlZhbG9yYCA6IHswfSIsIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2xhc2VFeHRlcm5hLnZhbG9yLlRvU3RyaW5nKCkpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQogICAgCiAgICBpbnRlcm5hbCBjbGFzcyBQcnVlYmFNaWVtYnJvc0VzdGF0aWNvcwogICAgewogICAgICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBNYWluKCkKICAgICAgICB7CiAgICAgICAgICAgIENsYXNlRXh0ZXJuYS5DbGFzZUFuaWRhZGEgY2EgPSBuZXcgQ2xhc2VFeHRlcm5hLkNsYXNlQW5pZGFkYSgpOwogICAgICAgICAgICAKICAgICAgICAgICAgY2EuTWV0b2RvKCk7CiAgICAgICAgfQogICAgfQp9