Class TDiscMonitor (unit DiscMon)

Inherits from

TComponent

Constructors


constructor Create (AOwner : TComponent);

=== MONITOR COMPONENT ======================================================== This component encapsulates the above thread.


Functions

procedure Close;

stop the monitoring thread running

Stop the monitor running


destructor Destroy;

default sub-tree search to on

procedure Open;

start the monitoring thread running

Run the monitor


procedure Change (Sender : TObject);

Change notification from the thread has occurred.

procedure Invalid (Sender : TObject);

Invalid notification from the thread has occurred.

function GetDirectory : TDiscMonitorDirStr;

get the current directory from the thread

function GetSubTree : boolean;

get the current sub-tree status from the thread

procedure SetActive (Value : boolean);

Control the thread by using it's resume and suspend methods

procedure SetDirectory (Value : TDiscMonitorDirStr);

set the directory to monitor

procedure SetFilters (Value : TMonitorFilters);

Change the filter conditions.

procedure SetSubTree (Value : boolean);

set the sub-tree status in the thread

Properties

property Active : boolean

specify if the monitoring thread is active

property Directory : TDiscMonitorDirStr

the directory to monitor

property Filters : TMonitorFilters

notification filter conditions

property ShowDesignMsg : boolean

control the appearance of information messages at design time (only

property SubTree : boolean

include subdirectories below the specified directory

property Thread : TDiscMonitorThread

read-only property to access the thread directly

Events

event OnChange : TNotifyEvent

event called when a change is notified

event OnInvalid : TNotifyEvent

event called if an invalid condition is found

Variables

FActive : boolean;


FFilters : TMonitorFilters;


FMonitor : TDiscMonitorThread;


FOnChange : TNotifyEvent;


FOnInvalid : TNotifyEvent;


FShowMsg : boolean;



Constructors


constructor Create (AOwner : TComponent);

=== MONITOR COMPONENT ======================================================== This component encapsulates the above thread. It has properties for directory, sub-directory conditions, filters, whether information messages should be given at design time and if the thread is active.


Functions


procedure Close;

stop the monitoring thread running

Stop the monitor running


destructor Destroy;

default sub-tree search to on


procedure Open;

start the monitoring thread running

Run the monitor


procedure Change (Sender : TObject);

Change notification from the thread has occurred. Call the component's event handler and then, if in design mode, and if desired, put up a simple notification message


procedure Invalid (Sender : TObject);

Invalid notification from the thread has occurred. Call the component's event handler and then, if in design mode, and if desired, put up a simple notification message


function GetDirectory : TDiscMonitorDirStr;

get the current directory from the thread


function GetSubTree : boolean;

get the current sub-tree status from the thread


procedure SetActive (Value : boolean);

Control the thread by using it's resume and suspend methods


procedure SetDirectory (Value : TDiscMonitorDirStr);

set the directory to monitor


procedure SetFilters (Value : TMonitorFilters);

Change the filter conditions. The thread uses the raw windows constants (FILE_NOTIFY_CHANGE_XXXX) but the components uses a set of enumurated type. It is therefore necessary to translate from the component format into an integer value for the thread.


procedure SetSubTree (Value : boolean);

set the sub-tree status in the thread


Properties


property Active : boolean

specify if the monitoring thread is active


property Directory : TDiscMonitorDirStr

the directory to monitor


property Filters : TMonitorFilters

notification filter conditions


property ShowDesignMsg : boolean

control the appearance of information messages at design time (only


property SubTree : boolean

include subdirectories below the specified directory


property Thread : TDiscMonitorThread

read-only property to access the thread directly


Events


event OnChange : TNotifyEvent

event called when a change is notified


event OnInvalid : TNotifyEvent

event called if an invalid condition is found


Variables


FActive : boolean;


FFilters : TMonitorFilters;


FMonitor : TDiscMonitorThread;


FOnChange : TNotifyEvent;


FOnInvalid : TNotifyEvent;


FShowMsg : boolean;