comparison 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
comparison
equal deleted inserted replaced
100:cc91817a4206 101:9bfdd5bf3ad2
1 using AltNetHispano.Agendas.Domain.Exceptions;
2
3 namespace AltNetHispano.Agendas.Domain
4 {
5 public class EventoConfirmadoState : EventoState
6 {
7 private readonly Evento _evento;
8
9 public EventoConfirmadoState(Evento evento)
10 {
11 _evento = evento;
12 _evento.AddTrack(new Track(_evento, Accion.Confirmar));
13 }
14
15 public override void Promover(Accion accion)
16 {
17 switch (accion)
18 {
19 case Accion.Publicar:
20 _evento.Estado = new EventoPublicadoState(_evento);
21 break;
22 default:
23 throw new AccionNoSoportadaException(this.GetType(), accion);
24 }
25 }
26 }
27 }