TIEImageAddEvent
Declaration
type TIEImageAddEvent = procedure(Sender: TObject;
Index: Integer;
const Filename: string;
IsFolder: Boolean;
IsHiddenFile: Boolean;
FileSizeBytes: Int64;
CreateDate: TDateTime;
EditDate: TDateTime;
var Allow: Boolean) of object;
Description
Occurs whenever an image is added to a
TImageEnFolderMView or when using
TImageEnMView.FillFromDirectory.
Set bAllow to skip the addition of certain files.
| Value | Description |
| Sender | The TImageEnFolderMView or TImageEnMView |
| Index | The new position for this file |
| Filename | The full path of the file or folder |
| IsFolder | True for folders, False for files |
| IsHiddenFile | True for files marked hidden in file properties |
| FileSizeBytes | Size of the file in Bytes |
| CreateDate | Date the file was created |
| EditDate | Date the file was last modified |
| Allow | Defaults to False. Set to True to skip the addition of this file |
Examples
procedure TForm1.ImageEnMView1ImageAdd(Sender: TObject; Index: Integer; const Filename: string; IsFolder: Boolean; IsHiddenFile: Boolean; FileSizeBytes: Int64; CreateDate: TDateTime; EditDate: TDateTime; var Allow: Boolean);
begin
// Don't add files larger than 1 MB
if FileSizeBytes > 1*1024*1024 then
Allow := False;
end;
procedure TForm1.ImageEnMView1ImageAdd(Sender: TObject; Index: Integer; const Filename: string;
IsFolder: Boolean; IsHiddenFile: Boolean; FileSizeBytes: Int64;
CreateDate: TDateTime; EditDate: TDateTime; var Allow: Boolean);
const
ONE_YEAR = 365;
begin
// Don't add files more than a year old
if EditDate < Now - ONE_YEAR then
Allow := False;
end;