// ===++===
//
// OrtizOL
//
// ===--===
/*============================================================
//
// Clase: Ejemplo1Enum.cs
//
// Propósito: Demostrar el uso de enumeraciones en C#.
//
============================================================*/
using System;
namespace Articulos.Cap03
{
internal class Ejemplo1Enum
{
enum Dias
{
Domingo,
Lunes,
Martes,
Miercoles,
Jueves,
Viernes,
Sabado
};
public static void Main()
{
// Obtenemos los valores subyacentes de las constantes a
// través de la conversión explícita:
int x = (int) Dias.Lunes;
int y = (int) Dias.Miercoles;
// Mostramos valores obtenidos en pantalla:
Console.WriteLine("Lunes = {0}", x);
Console.WriteLine("Miercoles = {0}", y);
}
}
}
Ly8gPT09Kys9PT0KLy8KLy8gICAgT3J0aXpPTAovLwovLyA9PT0tLT09PQovKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQovLwovLyBDbGFzZTogRWplbXBsbzFFbnVtLmNzCi8vCi8vIFByb3DDs3NpdG86IERlbW9zdHJhciBlbCB1c28gZGUgZW51bWVyYWNpb25lcyBlbiBDIy4KLy8KPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KCnVzaW5nIFN5c3RlbTsKCm5hbWVzcGFjZSBBcnRpY3Vsb3MuQ2FwMDMKewogICAgaW50ZXJuYWwgY2xhc3MgRWplbXBsbzFFbnVtCiAgICB7CiAgICAgICAgZW51bSBEaWFzCiAgICAgICAgewogICAgICAgICAgICBEb21pbmdvLAogICAgICAgICAgICBMdW5lcywKICAgICAgICAgICAgTWFydGVzLAogICAgICAgICAgICBNaWVyY29sZXMsCiAgICAgICAgICAgIEp1ZXZlcywKICAgICAgICAgICAgVmllcm5lcywKICAgICAgICAgICAgU2FiYWRvCiAgICAgICAgfTsKICAgICAgICAKICAgICAgICBwdWJsaWMgc3RhdGljIHZvaWQgTWFpbigpCiAgICAgICAgewogICAgICAgICAgICAvLyBPYnRlbmVtb3MgbG9zIHZhbG9yZXMgc3VieWFjZW50ZXMgZGUgbGFzIGNvbnN0YW50ZXMgYSAKICAgICAgICAgICAgLy8gdHJhdsOpcyBkZSBsYSBjb252ZXJzacOzbiBleHBsw61jaXRhOgogICAgICAgICAgICBpbnQgeCA9IChpbnQpIERpYXMuTHVuZXM7CiAgICAgICAgICAgIGludCB5ID0gKGludCkgRGlhcy5NaWVyY29sZXM7CiAgICAgICAgICAgIAogICAgICAgICAgICAvLyBNb3N0cmFtb3MgdmFsb3JlcyBvYnRlbmlkb3MgZW4gcGFudGFsbGE6CiAgICAgICAgICAgIENvbnNvbGUuV3JpdGVMaW5lKCJMdW5lcyA9IHswfSIsIHgpOwogICAgICAgICAgICBDb25zb2xlLldyaXRlTGluZSgiTWllcmNvbGVzID0gezB9IiwgeSk7CiAgICAgICAgfQogICAgfQp9