diff Agendas/trunk/src/Agendas.Domain/EventoConfirmadoState.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/EventoConfirmadoState.cs	Thu Jul 28 10:16:09 2011 -0300
+++ b/Agendas/trunk/src/Agendas.Domain/EventoConfirmadoState.cs	Fri Jul 29 16:30:53 2011 -0300
@@ -3,41 +3,39 @@
 
 namespace AltNetHispano.Agendas.Domain
 {
-  public class EventoConfirmadoState : EventoState
-  {
-    private EventoConfirmadoState()
-    {
-    }
+	public class EventoConfirmadoState : EventoState
+	{
+		protected EventoConfirmadoState()
+		{
+		}
 
-    private static readonly EventoState _instance = new EventoConfirmadoState();
-    public static EventoState GetInstance()
-    {
-      return _instance;
-    }
-
-    private const string Descripcion = "Confirmado";
+		private static readonly EventoState _instance = new EventoConfirmadoState();
+		public static EventoState GetInstance()
+		{
+			return _instance;
+		}
 
-    public override void Promover(Evento evento, Accion accion)
-    {
-      switch (accion)
-      {
-        case Accion.Publicar:
-          evento.SetEstado(EventoPublicadoState.GetInstance());
-          evento.AddTrack(new Track(evento, Accion.Publicar));
-          break;
-        default:
-          throw new AccionNoSoportadaException(this.GetType(), accion);
-      }
-    }
+		public override void Promover(Evento evento, Accion accion)
+		{
+			switch (accion)
+			{
+				case Accion.Publicar:
+					evento.Estado = EventoPublicadoState.GetInstance();
+					evento.AddTrack(new Track(evento, Accion.Publicar));
+					break;
+				default:
+					throw new AccionNoSoportadaException(this.GetType(), accion);
+			}
+		}
 
-    public override string GetDescripcion()
-    {
-      return Descripcion;
-    }
+		public override string Descripcion
+		{
+			get { return "Confirmado"; }
+		}
 
-  	public override bool PuedePromover(Accion accion)
-  	{
-  		return accion == Accion.Publicar;
-  	}
-  }
+		public override bool PuedePromover(Accion accion)
+		{
+			return accion == Accion.Publicar;
+		}
+	}
 }
\ No newline at end of file