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: TPJExtFileFilter

Applies to: ~>5.0

function Accept(
  const FilePath: string; const IsFolder: Boolean
): Boolean; override;


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

This method is called by the filter’s owning drop files component whenever files are dropped. It is called once for each dropped file or folder and returns true if the file or folder passes through the filter and false if not. FilePath is the fully qualified path of the file or folder concerned, while IsFolder indicates whether FilePath is a file or folder.

For a file to pass through the filter it must either be of a type that is not being filtered (per the Style property) or it must have an extension that matches one of those listed in the Extensions property.

This method is used internally by the drop files components. There is no reason to call the method from program code unless to discover whether a file or folder will pass the filter.