| Class TDiscMonitor (unit DiscMon) |
TComponent
| Constructors |
constructor Create (AOwner : TComponent);| Functions |
procedure Close;Stop the monitor running
destructor Destroy;
procedure Open;Run the monitor
procedure Change (Sender : TObject);
procedure Invalid (Sender : TObject);
function GetDirectory : TDiscMonitorDirStr;
function GetSubTree : boolean;
procedure SetActive (Value : boolean);
procedure SetDirectory (Value : TDiscMonitorDirStr);
procedure SetFilters (Value : TMonitorFilters);
procedure SetSubTree (Value : boolean);| Properties |
property Active : boolean
property Directory : TDiscMonitorDirStr
property Filters : TMonitorFilters
property ShowDesignMsg : boolean
property SubTree : boolean
property Thread : TDiscMonitorThread| Events |
event OnChange : TNotifyEvent
event OnInvalid : TNotifyEvent| 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 : booleanspecify if the monitoring thread is active
property Directory : TDiscMonitorDirStrthe directory to monitor
property Filters : TMonitorFiltersnotification filter conditions
property ShowDesignMsg : booleancontrol the appearance of information messages at design time (only
property SubTree : booleaninclude subdirectories below the specified directory
property Thread : TDiscMonitorThreadread-only property to access the thread directly
| Events |
event OnChange : TNotifyEventevent called when a change is notified
event OnInvalid : TNotifyEventevent called if an invalid condition is found
| Variables |
FActive : boolean;
FFilters : TMonitorFilters;
FMonitor : TDiscMonitorThread;
FOnChange : TNotifyEvent;
FOnInvalid : TNotifyEvent;
FShowMsg : boolean;