Mercurial > altnet-hispano
annotate Agendas/trunk/src/Agendas.Domain/EventoNullState.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 EventoNullState : 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 EventoNullState(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 } |
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 public override void Promover(Accion accion) |
9bfdd5bf3ad2
Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff
changeset
|
15 { |
9bfdd5bf3ad2
Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff
changeset
|
16 switch (accion) |
9bfdd5bf3ad2
Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff
changeset
|
17 { |
9bfdd5bf3ad2
Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff
changeset
|
18 case Accion.Proponer: |
9bfdd5bf3ad2
Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff
changeset
|
19 _evento.Estado = new EventoPropuestoState(_evento); |
9bfdd5bf3ad2
Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff
changeset
|
20 break; |
9bfdd5bf3ad2
Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff
changeset
|
21 case Accion.Agendar: |
9bfdd5bf3ad2
Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff
changeset
|
22 _evento.Estado = new EventoAgendadoState(_evento); |
9bfdd5bf3ad2
Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff
changeset
|
23 break; |
9bfdd5bf3ad2
Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff
changeset
|
24 default: |
9bfdd5bf3ad2
Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff
changeset
|
25 throw new AccionNoSoportadaException(this.GetType(), accion); |
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 } |
9bfdd5bf3ad2
Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff
changeset
|
28 } |
9bfdd5bf3ad2
Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff
changeset
|
29 } |