view Agendas/trunk/src/Agendas.Blog/Impl/PostWriterFactory.cs @ 254:478656b70afb

Tag deploy 2011-10-07 v1.0.3 para conjunto de cambios 7cf64cd790ab añadido
author Administrador@DESA-WIN-002.cpe.telecentro.net.ar
date Mon, 17 Oct 2011 07:41:32 -0300
parents 3027c64344bd
children
line wrap: on
line source

using AltNetHispano.Agendas.Domain;

namespace Agendas.Blog.Impl
{
  public class PostWriterFactory : IPostWriterFactory
  {
    private readonly IPostWriterWebService _postWriterWebService;

    public PostWriterFactory(IPostWriterWebService postWriterWebService)
    {
      _postWriterWebService = postWriterWebService;
    }

    public IPostWriter GetPostWriter(Accion accion)
    {
      switch (accion)
      {
        case Accion.Agendar:
          return new AgendarReunionPostWriter(_postWriterWebService);
        case Accion.Publicar:
          return new PublicarReunionPostWriter(_postWriterWebService);
        default:
          return new NullObjectPostWriter(_postWriterWebService);
      }
    }
  }
}