Mercurial > altnet-hispano
annotate Agendas/trunk/src/Agendas.Domain/EventoAgendadoState.cs @ 109:6bd9be78caa0
Merge
author | Nelo@Kenia.neluz.int |
---|---|
date | Tue, 07 Jun 2011 23:21:07 -0300 |
parents | c5034884c7d7 |
children | 53bcd338542b |
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 EventoAgendadoState : EventoState |
9bfdd5bf3ad2
Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff
changeset
|
6 { |
104 | 7 private EventoAgendadoState() |
8 { | |
9 } | |
10 | |
11 private static readonly EventoState _instance = new EventoAgendadoState(); | |
12 public static EventoState GetInstance() | |
13 { | |
14 return _instance; | |
15 } | |
16 | |
17 private const string Descripcion = "Agendado"; | |
101
9bfdd5bf3ad2
Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff
changeset
|
18 |
103 | 19 public override void Promover(Evento evento, Accion accion) |
101
9bfdd5bf3ad2
Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff
changeset
|
20 { |
9bfdd5bf3ad2
Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff
changeset
|
21 switch (accion) |
9bfdd5bf3ad2
Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff
changeset
|
22 { |
9bfdd5bf3ad2
Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff
changeset
|
23 case Accion.Confirmar: |
104 | 24 evento.SetEstado(EventoConfirmadoState.GetInstance()); |
103 | 25 evento.AddTrack(new Track(evento, Accion.Confirmar)); |
101
9bfdd5bf3ad2
Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff
changeset
|
26 break; |
9bfdd5bf3ad2
Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff
changeset
|
27 default: |
9bfdd5bf3ad2
Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff
changeset
|
28 throw new AccionNoSoportadaException(this.GetType(), accion); |
9bfdd5bf3ad2
Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff
changeset
|
29 } |
9bfdd5bf3ad2
Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff
changeset
|
30 } |
103 | 31 |
32 public override string GetDescripcion() | |
33 { | |
34 return Descripcion; | |
35 } | |
101
9bfdd5bf3ad2
Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff
changeset
|
36 } |
9bfdd5bf3ad2
Manejo de estados de los Eventos mediante state pattern (primer version)
jorge.rowies
parents:
diff
changeset
|
37 } |