annotate Agendas/trunk/src/Agendas.Domain/Agenda.cs @ 3:5f007e266509

code cleanup
author nelopauselli
date Sat, 22 Jan 2011 20:23:50 -0300
parents c03560ae4762
children 49b572535156
rev   line source
1
6bb4ab4c0611 Tests de Crud para repositorio de Vans
nelopauselli
parents: 0
diff changeset
1 using System;
2
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents: 1
diff changeset
2 using System.Collections.Generic;
0
3f7dbb633b71 Test sobre la publicación de Eventos al registrarlos en la Agenda
nelopauselli
parents:
diff changeset
3
3f7dbb633b71 Test sobre la publicación de Eventos al registrarlos en la Agenda
nelopauselli
parents:
diff changeset
4 namespace AltNetHispano.Agendas.Domain
3f7dbb633b71 Test sobre la publicación de Eventos al registrarlos en la Agenda
nelopauselli
parents:
diff changeset
5 {
3f7dbb633b71 Test sobre la publicación de Eventos al registrarlos en la Agenda
nelopauselli
parents:
diff changeset
6 public class Agenda
3f7dbb633b71 Test sobre la publicación de Eventos al registrarlos en la Agenda
nelopauselli
parents:
diff changeset
7 {
3
5f007e266509 code cleanup
nelopauselli
parents: 2
diff changeset
8 private readonly IList<Evento> _eventos;
0
3f7dbb633b71 Test sobre la publicación de Eventos al registrarlos en la Agenda
nelopauselli
parents:
diff changeset
9 private readonly IPublicador _publicador;
1
6bb4ab4c0611 Tests de Crud para repositorio de Vans
nelopauselli
parents: 0
diff changeset
10 private readonly IRecordador _recordador;
2
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents: 1
diff changeset
11
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents: 1
diff changeset
12 public Agenda(IPublicador publicador, IRecordador recordador)
0
3f7dbb633b71 Test sobre la publicación de Eventos al registrarlos en la Agenda
nelopauselli
parents:
diff changeset
13 {
3f7dbb633b71 Test sobre la publicación de Eventos al registrarlos en la Agenda
nelopauselli
parents:
diff changeset
14 _publicador = publicador;
1
6bb4ab4c0611 Tests de Crud para repositorio de Vans
nelopauselli
parents: 0
diff changeset
15 _recordador = recordador;
2
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents: 1
diff changeset
16 _eventos = new List<Evento>();
0
3f7dbb633b71 Test sobre la publicación de Eventos al registrarlos en la Agenda
nelopauselli
parents:
diff changeset
17 }
3f7dbb633b71 Test sobre la publicación de Eventos al registrarlos en la Agenda
nelopauselli
parents:
diff changeset
18
3
5f007e266509 code cleanup
nelopauselli
parents: 2
diff changeset
19 public Guid Id { get; set; }
5f007e266509 code cleanup
nelopauselli
parents: 2
diff changeset
20
5f007e266509 code cleanup
nelopauselli
parents: 2
diff changeset
21 public IEnumerable<Evento> Eventos
5f007e266509 code cleanup
nelopauselli
parents: 2
diff changeset
22 {
5f007e266509 code cleanup
nelopauselli
parents: 2
diff changeset
23 get { return _eventos; }
5f007e266509 code cleanup
nelopauselli
parents: 2
diff changeset
24 }
5f007e266509 code cleanup
nelopauselli
parents: 2
diff changeset
25
5f007e266509 code cleanup
nelopauselli
parents: 2
diff changeset
26
0
3f7dbb633b71 Test sobre la publicación de Eventos al registrarlos en la Agenda
nelopauselli
parents:
diff changeset
27 public void Publicar(Evento evento)
3f7dbb633b71 Test sobre la publicación de Eventos al registrarlos en la Agenda
nelopauselli
parents:
diff changeset
28 {
2
c03560ae4762 Test de Crud para la agenda
nelopauselli
parents: 1
diff changeset
29 _eventos.Add(evento);
1
6bb4ab4c0611 Tests de Crud para repositorio de Vans
nelopauselli
parents: 0
diff changeset
30
6bb4ab4c0611 Tests de Crud para repositorio de Vans
nelopauselli
parents: 0
diff changeset
31 if (_publicador != null)
6bb4ab4c0611 Tests de Crud para repositorio de Vans
nelopauselli
parents: 0
diff changeset
32 _publicador.Publicar(evento);
6bb4ab4c0611 Tests de Crud para repositorio de Vans
nelopauselli
parents: 0
diff changeset
33 }
6bb4ab4c0611 Tests de Crud para repositorio de Vans
nelopauselli
parents: 0
diff changeset
34
6bb4ab4c0611 Tests de Crud para repositorio de Vans
nelopauselli
parents: 0
diff changeset
35 public void Recordar(Evento evento)
6bb4ab4c0611 Tests de Crud para repositorio de Vans
nelopauselli
parents: 0
diff changeset
36 {
6bb4ab4c0611 Tests de Crud para repositorio de Vans
nelopauselli
parents: 0
diff changeset
37 if (_recordador != null)
6bb4ab4c0611 Tests de Crud para repositorio de Vans
nelopauselli
parents: 0
diff changeset
38 _recordador.Recordar(evento);
0
3f7dbb633b71 Test sobre la publicación de Eventos al registrarlos en la Agenda
nelopauselli
parents:
diff changeset
39 }
3f7dbb633b71 Test sobre la publicación de Eventos al registrarlos en la Agenda
nelopauselli
parents:
diff changeset
40 }
3f7dbb633b71 Test sobre la publicación de Eventos al registrarlos en la Agenda
nelopauselli
parents:
diff changeset
41 }