void deleteOldFilesAsync(bool validateOnly) { rtbDisplay.Clear(); //--Validate if (cklbDocLibs.CheckedItems.Count == 0) { SmartStepUtil.AddToRTB(rtbDisplay, "Please select a Document Library to Delete From", StyleType.bodyRed); return; } if (!Directory.Exists(txtArchiveDest.Text)) { SmartStepUtil.AddToRTB(rtbDisplay, "Archive Folder '" + txtArchiveDest.Text + "' is not valid.", StyleType.bodyRed); return; } //-- _cancel = false; toggle(false); deleteOldFilesDelegate d = new deleteOldFilesDelegate(deleteOldFiles); d.BeginInvoke(validateOnly, txtTargetSite.Text, null, null); }