I have one class called TerminalCommandScanUtility.cs with a delegate called ScanUtility:
public static event Action scanUtilityEvent;
public void ScanUtility()
{
if (scanUtilityEvent != null)
{
scanUtilityEvent();
}
}
In another class called FolderEvent.cs, I listen for this delegate being fired as follows:
bool isScannable;
TerminalCommandScanUtility.scanUtilityEvent += StartFolderScan;
void StartFolderScan()
{
if(!isScannable)
{
return;
}
else
{
//How can I inform TerminalCommandScanUtility that this folder was scannable, and thus ran?
}
}
When the scan utility runs, I want it to be able to know that a folder's isScannable variable was true so that I can display some feedback text for the user like "Despite running the function.. nothing was scanned", or "One folder has begun scanning!"