Welcome to the new DelphiDabbler Code Library Documentation.

This is a new site that's currently running on alpha code. There are going to be bugs. If you discover any, please report them on the site's issues page (GitHub account required). Thanks.

Warning: Many URLs are going to change. Refer to the README file to discover which library project's documentation has been completed.

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.