diff Agendas/trunk/src/Agendas.Domain/EventoPublicadoState.cs @ 104:c5034884c7d7

refactor para que los estados sean singletons
author jorge.rowies
date Sun, 05 Jun 2011 13:22:36 -0300
parents 23325dddddcc
children 53bcd338542b
line wrap: on
line diff
--- a/Agendas/trunk/src/Agendas.Domain/EventoPublicadoState.cs	Sun Jun 05 13:06:23 2011 -0300
+++ b/Agendas/trunk/src/Agendas.Domain/EventoPublicadoState.cs	Sun Jun 05 13:22:36 2011 -0300
@@ -4,7 +4,17 @@
 {
   public class EventoPublicadoState : EventoState
   {
-    public const string Descripcion = "Publicado";
+    private EventoPublicadoState()
+    {
+    }
+
+    private static readonly EventoState _instance = new EventoPublicadoState();
+    public static EventoState GetInstance()
+    {
+      return _instance;
+    }
+
+    private const string Descripcion = "Publicado";
 
     public override void Promover(Evento evento, Accion accion)
     {