-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathLMS._class.Module.pas
91 lines (73 loc) · 1.53 KB
/
LMS._class.Module.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
unit LMS._class.Module;
interface
uses
System.JSON,
Generics.Collections,
LMS._interface.LMS;
type
TModule = class(TInterfacedObject, IModule)
private
fName: string;
fSection: ISection;
fModType: TModType;
fContents: TList<IContent>;
function GetName: string;
function GetModType: TModType;
procedure SetModName(const Value: string);
procedure SetName(const Value: string);
function GetContents: TList<IContent>;
function GetSection: ISection;
public
constructor Create(const Section: ISection);
destructor Destroy; override;
end;
implementation
uses
LMS.Helper.Log;
constructor TModule.Create(const Section: ISection);
begin
fSection := Section;
fContents := TList<IContent>.Create;
end;
destructor TModule.Destroy;
begin
fContents.free;
inherited;
end;
function TModule.GetContents: TList<IContent>;
begin
result := fContents;
end;
function TModule.GetModType: TModType;
begin
result := fModType;
end;
function TModule.GetName: string;
begin
result := fName;
end;
function TModule.GetSection: ISection;
begin
result := fSection;
end;
procedure TModule.SetModName(const Value: string);
begin
if Value = 'forum' then
fModType := mnforum
else if Value = 'label' then
fModType := mnlabel
else if Value = 'resource' then
fModType := mnresource
else if Value = 'folder' then
fModType := mnfolder
else
begin
fModType := mnunknow;
// Log(Value);
end;
end;
procedure TModule.SetName(const Value: string);
begin
fName := Value;
end;
end.