/
SujetConcret.cs
60 lines (44 loc) · 1.35 KB
/
SujetConcret.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
using System.Collections.Generic;
using System.Windows.Forms;
namespace DesignPatternObserver_Animorphe
{
class SujetConcret : Sujet
{
#region Attributs
/// <summary>
/// Création de la Liste d'animorphes créés
/// </summary>
private List<Animorphe> _mesAnimorphes;
/// <summary>
/// Accesseurs/Mutateurs
/// </summary>
public List<Animorphe> MesAnimorphes
{
get { return _mesAnimorphes; }
private set { _mesAnimorphes = value; }
}
#endregion
#region Constructeur
/// <summary>
/// Constructeur du Sujet Concret
/// </summary>
public SujetConcret()
{
_mesAnimorphes = new List<Animorphe>();
}
#endregion
#region Méthodes
/// <summary>
/// Methode qui permet d'ajouter un abonné et de notifier une mise à jour.
/// </summary>
/// <param name="animorphe"></param>
/// <param name="lstViewAnimaux"></param>
/// <param name="Form1Objet"></param>
public void AjouterAnimorphe(Animorphe animorphe, ListView lstViewAnimaux, Form1 Form1Objet)
{
_mesAnimorphes.Add(animorphe);
base.Notify(lstViewAnimaux, Form1Objet);
}
#endregion
}
}