public object InvokeParentCallback(MultiThreadedClass sender, object state) { Logging.WriteToLog(this,state.ToString()); if (sender.IsBusy == false) { int intNonBusyThreads = 0; foreach (WorkerTask workerTask in mcolTasks) { if (workerTask.IsBusy == false) { intNonBusyThreads += 1; } } if (intNonBusyThreads == mcolTasks.Count) { IsBusy = false; } } // Expose Callback to any callers who may be wired in to this event as well if (OnCallback != null) { OnCallback(sender, state); } return (object)true; }
public void InvokeHandleException(MultiThreadedClass sender, Exception childException) { // Event Log Logging.WriteToLog(this, childException); // Expose error to any callers who may be wired in to this event as well if (OnException != null) { OnException(sender, childException); } }
public object TransferState(MultiThreadedClass sender, object state) { // Accept call from Parent instance post the hosting Thread having started // Can respond to incoming state including return data to hosting thread return null; }
public void ReceiveStopRequest(MultiThreadedClass sender) { // Accept call from Parent instance post the hosting Thread having started HasStopWorkRequestBeenReceived = true; }
public void InvokeHandleException(MultiThreadedClass sender, Exception childException) { throw childException; }
public object InvokeParentCallback(MultiThreadedClass sender, object state) { return state; }