comparison Agendas/trunk/src/Agendas.Domain/EventoPublicadoState.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
comparison
equal deleted inserted replaced
139:18e5a78186e4 140:3639803112c6
1 using System; 1 using System;
2 using AltNetHispano.Agendas.Domain.Exceptions; 2 using AltNetHispano.Agendas.Domain.Exceptions;
3 3
4 namespace AltNetHispano.Agendas.Domain 4 namespace AltNetHispano.Agendas.Domain
5 { 5 {
6 public class EventoPublicadoState : EventoState 6 public class EventoPublicadoState : EventoState
7 { 7 {
8 private EventoPublicadoState() 8 protected EventoPublicadoState()
9 { 9 {
10 } 10 }
11 11
12 private static readonly EventoState _instance = new EventoPublicadoState(); 12 private static readonly EventoState _instance = new EventoPublicadoState();
13 public static EventoState GetInstance() 13 public static EventoState GetInstance()
14 { 14 {
15 return _instance; 15 return _instance;
16 } 16 }
17 17
18 private const string Descripcion = "Publicado"; 18 public override void Promover(Evento evento, Accion accion)
19 {
20 throw new AccionNoSoportadaException(this.GetType(), accion);
21 }
19 22
20 public override void Promover(Evento evento, Accion accion) 23 public override string Descripcion
21 { 24 {
22 throw new AccionNoSoportadaException(this.GetType(), accion); 25 get { return "Publicado"; }
23 } 26 }
24 27
25 public override string GetDescripcion() 28 public override bool PuedePromover(Accion accion)
26 { 29 {
27 return Descripcion; 30 return false;
28 } 31 }
29 32 }
30 public override bool PuedePromover(Accion accion)
31 {
32 return false;
33 }
34 }
35 } 33 }