This repository has been archived by the owner on Nov 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
EvilWorks.Vcl.FindFiles.pas
75 lines (59 loc) · 1.63 KB
/
EvilWorks.Vcl.FindFiles.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
unit EvilWorks.VCL.FindFiles platform;
interface
uses
System.Classes,
System.SysUtils,
System.IOUtils;
type
{ Forward declarations }
TFindFiles = class;
{ Events }
TOnFileFound = procedure(aSender: TFindFiles; const aFileName: string) of object;
{ TFindFiles }
TFindFiles = class(TComponent)
private
FRootFolder : string;
FOnFileFound : TOnFileFound;
FOnFinished : TNotifyEvent;
FFileAttributes: TFileAttributes;
procedure SetRootFolder(const Value: string);
procedure SetFileAttributes(const Value: TFileAttributes);
public
constructor Create(aOwner: TComponent); override;
destructor Destroy; override;
procedure Assign(aSource: TPersistent); override;
published
property RootFolder : string read FRootFolder write SetRootFolder;
property FileAttributes: TFileAttributes read FFileAttributes write SetFileAttributes;
property OnFileFound: TOnFileFound read FOnFileFound write FOnFileFound;
property OnFinished : TNotifyEvent read FOnFinished write FOnFinished;
end;
implementation
{ TFindFiles }
constructor TFindFiles.Create(aOwner: TComponent);
begin
inherited;
end;
destructor TFindFiles.Destroy;
begin
inherited;
end;
procedure TFindFiles.Assign(aSource: TPersistent);
begin
inherited;
if (aSource is TFindFiles) then
begin
RootFolder := TFindFiles(aSource).RootFolder;
OnFileFound := TFindFiles(aSource).OnFileFound;
OnFinished := TFindFiles(aSource).OnFinished;
end;
end;
procedure TFindFiles.SetFileAttributes(const Value: TFileAttributes);
begin
FFileAttributes := Value;
end;
procedure TFindFiles.SetRootFolder(const Value: string);
begin
FRootFolder := Value;
end;
end.