-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsvgViewer.IconLibrary.pas
59 lines (47 loc) · 1.18 KB
/
svgViewer.IconLibrary.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
unit svgViewer.IconLibrary;
interface
uses
System.Classes,
svgViewer.types;
type
TIconLibrary = class(TInterfacedObject,ISVGLibrary)
private
fCollections : TinterfaceList;
protected
procedure RegisterIconCollection(value:ISVGLibraryCollection);
function CollectionCount : integer;
function CollectioName(Value:Integer):String;
function Collection(value:Integer):ISVGLibraryCollection;
public
constructor Create;
destructor Destroy; override;
end;
implementation
{ TIconLibrary }
function TIconLibrary.Collection(value: Integer): ISVGLibraryCollection;
begin
Result := fCollections.items[value] as ISVGLibraryCollection;
end;
function TIconLibrary.CollectioName(Value: Integer): String;
begin
result := (fCollections.items[value] as ISVGLibraryCollection).Name;
end;
function TIconLibrary.CollectionCount: integer;
begin
result := fCollections.count;
end;
constructor TIconLibrary.Create;
begin
Inherited;
fCollections := TInterfaceList.create;
end;
destructor TIconLibrary.Destroy;
begin
fCollections.free;
inherited;
end;
procedure TIconLibrary.RegisterIconCollection(value: ISVGLibraryCollection);
begin
fCollections.add(value);
end;
end.