Mercurial > altnet-hispano
diff Agendas/trunk/src/Agendas.Domain/EventoNullState.cs @ 140:3639803112c6
Refactoring de la relaciĆ³n entre Evento y Estado
author | nelopauselli |
---|---|
date | Fri, 29 Jul 2011 16:30:53 -0300 |
parents | 53bcd338542b |
children |
line wrap: on
line diff
--- a/Agendas/trunk/src/Agendas.Domain/EventoNullState.cs Thu Jul 28 10:16:09 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Domain/EventoNullState.cs Fri Jul 29 16:30:53 2011 -0300 @@ -3,45 +3,43 @@ namespace AltNetHispano.Agendas.Domain { - public class EventoNullState : EventoState - { - private EventoNullState() - { - } + public class EventoNullState : EventoState + { + protected EventoNullState() + { + } - private static readonly EventoState _instance = new EventoNullState(); - public static EventoState GetInstance() - { - return _instance; - } - - private const string Descripcion = "NullState"; + private static readonly EventoState _instance = new EventoNullState(); + public static EventoState GetInstance() + { + return _instance; + } - public override void Promover(Evento evento, Accion accion) - { - switch (accion) - { - case Accion.Proponer: - evento.SetEstado(EventoPropuestoState.GetInstance()); - evento.AddTrack(new Track(evento, Accion.Proponer)); - break; - case Accion.Agendar: - evento.SetEstado(EventoAgendadoState.GetInstance()); - evento.AddTrack(new Track(evento, Accion.Agendar)); - break; - default: - throw new AccionNoSoportadaException(this.GetType(), accion); - } - } + public override void Promover(Evento evento, Accion accion) + { + switch (accion) + { + case Accion.Proponer: + evento.Estado = EventoPropuestoState.GetInstance(); + evento.AddTrack(new Track(evento, Accion.Proponer)); + break; + case Accion.Agendar: + evento.Estado = EventoAgendadoState.GetInstance(); + evento.AddTrack(new Track(evento, Accion.Agendar)); + break; + default: + throw new AccionNoSoportadaException(this.GetType(), accion); + } + } - public override string GetDescripcion() - { - return Descripcion; - } + public override string Descripcion + { + get { return "NullState"; } + } - public override bool PuedePromover(Accion accion) - { - return accion == Accion.Proponer || accion == Accion.Agendar; - } - } + public override bool PuedePromover(Accion accion) + { + return accion == Accion.Proponer || accion == Accion.Agendar; + } + } } \ No newline at end of file