Mercurial > altnet-hispano
view Agendas/trunk/src/Agendas.Domain/EventoConfirmadoState.cs @ 101:9bfdd5bf3ad2
Manejo de estados de los Eventos mediante state pattern (primer version)
author | jorge.rowies |
---|---|
date | Sun, 05 Jun 2011 11:10:32 -0300 |
parents | |
children | 23325dddddcc |
line wrap: on
line source
using AltNetHispano.Agendas.Domain.Exceptions; namespace AltNetHispano.Agendas.Domain { public class EventoConfirmadoState : EventoState { private readonly Evento _evento; public EventoConfirmadoState(Evento evento) { _evento = evento; _evento.AddTrack(new Track(_evento, Accion.Confirmar)); } public override void Promover(Accion accion) { switch (accion) { case Accion.Publicar: _evento.Estado = new EventoPublicadoState(_evento); break; default: throw new AccionNoSoportadaException(this.GetType(), accion); } } } }