annotate Agendas/trunk/src/Agendas.Domain/EventoPropuestoState.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
rev   line source
101
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
1 using AltNetHispano.Agendas.Domain.Exceptions;
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
2
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
3 namespace AltNetHispano.Agendas.Domain
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
4 {
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
5 public class EventoPropuestoState : EventoState
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
6 {
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
7 private readonly Evento _evento;
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
8
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
9 public EventoPropuestoState(Evento evento)
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
10 {
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
11 _evento = evento;
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
12 _evento.AddTrack(new Track(_evento, Accion.Proponer));
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
13 }
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
14
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
15 public override void Promover(Accion accion)
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
16 {
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
17 switch (accion)
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
18 {
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
19 case Accion.Agendar:
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
20 _evento.Estado = new EventoAgendadoState(_evento);
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
21 break;
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
22 default:
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
23 throw new AccionNoSoportadaException(this.GetType(), accion);
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
24 }
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
25 }
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
26 }
9bfdd5bf3ad2 Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff changeset
27 }