Skip to content

Latest commit

 

History

History
25 lines (15 loc) · 1.12 KB

TPJFileFilter-Accept.md

File metadata and controls

25 lines (15 loc) · 1.12 KB

Accept method

Project: Drop Files Components.

Unit: PJDropFiles.

Class: TPJFileFilter

Applies to: ~>5.0

function Accept(
  const FilePath: string; const IsFolder: Boolean
): Boolean; virtual; abstract;

Description

Checks whether a given file or folder passes though a filter.

This abstract method is called by the filter's owning drop files component whenever files are dropped. It is called once for each file or folder dropped. Its purpose is to determine which of the dropped files or folders are to pass through the filter. FilePath is the fully qualified path of the file or folder concerned, while IsFolder indicates whether FilePath is a file or folder. The method returns true to indicate a file or folder passes through the filter and false if it is to be filtered out.

Files and folders that do not pass the filter are not passed to the drop files component's OnFileFilter event handler and are not added to the component's Files array property.

Note: This method is abstract and must be implemented in an appropriate way by decendant classes.