-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathmsInvalidator.mixin.pas
68 lines (48 loc) · 1.52 KB
/
msInvalidator.mixin.pas
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
61
62
63
64
65
66
67
68
{$IfNDef TmsInvalidator_intf}
// interface
{$Define TmsInvalidator_intf}
// uses
msDiagramm
{$Else TmsInvalidator_intf}
{$IfNDef TmsMixIn_intf}
// http://programmingmindstream.blogspot.ru/2014/12/generic-2.html
TmsInvalidator = class abstract(TmsInvalidatorParent, ImsInvalidator)
protected
procedure InvalidateDiagramm(const aDiagramm: ImsDiagramm);
procedure DiagrammAdded(const aDiagramms: ImsDiagrammsList; const aDiagramm: ImsDiagramm);
protected
procedure DoInvalidateDiagramm(const aDiagramm: ImsDiagramm); virtual; abstract;
procedure DoDiagrammAdded(const aDiagramms: ImsDiagrammsList; const aDiagramm: ImsDiagramm); virtual; abstract;
procedure InstanceAllocated; override;
procedure InstanceWillBeDestroyed; override;
end;//TmsInvalidator
{$Define TmsMixIn_intf}
{$Else TmsMixIn_intf}
// implementation
{$IfNDef TmsInvalidator_impl}
// uses
msInvalidators
{$Define TmsInvalidator_impl}
{$Else TmsInvalidator_impl}
// TmsInvalidator
procedure TmsInvalidator.InvalidateDiagramm(const aDiagramm: ImsDiagramm);
begin
DoInvalidateDiagramm(aDiagramm);
end;
procedure TmsInvalidator.DiagrammAdded(const aDiagramms: ImsDiagrammsList; const aDiagramm: ImsDiagramm);
begin
DoDiagrammAdded(aDiagramms, aDiagramm);
end;
procedure TmsInvalidator.InstanceAllocated;
begin
inherited;
TmsInvalidators.Subscribe(Self);
end;
procedure TmsInvalidator.InstanceWillBeDestroyed;
begin
TmsInvalidators.UnSubscribe(Self);
inherited;
end;
{$EndIf TmsInvalidator_impl}
{$EndIf TmsMixIn_intf}
{$EndIf TmsInvalidator_intf}