diff Agendas/trunk/src/Agendas.Domain/EventoNullState.cs @ 109:6bd9be78caa0

Merge
author Nelo@Kenia.neluz.int
date Tue, 07 Jun 2011 23:21:07 -0300
parents c5034884c7d7
children 53bcd338542b
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Agendas/trunk/src/Agendas.Domain/EventoNullState.cs	Tue Jun 07 23:21:07 2011 -0300
@@ -0,0 +1,41 @@
+using AltNetHispano.Agendas.Domain.Exceptions;
+
+namespace AltNetHispano.Agendas.Domain
+{
+  public class EventoNullState : EventoState
+  {
+    private EventoNullState()
+    {
+    }
+
+    private static readonly EventoState _instance = new EventoNullState();
+    public static EventoState GetInstance()
+    {
+      return _instance;
+    }
+
+    private const string Descripcion = "NullState";
+
+    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 string GetDescripcion()
+    {
+      return Descripcion;
+    }
+  }
+}
\ No newline at end of file