private void AsyncWork() { try { OutputType data = WorkOnData(inputData); if (ProvideDataEvent != null) { bool clone = ProvideDataEvent.GetInvocationList().Length > 1; ProvideDataEvent.Invoke(data, clone); } } catch (Exception ex) { exception = ex; } enqueue.Set(); }
private void ThreadedDataProvider() { try { Running = true; while (Running) { OutputType data = CreateData(); if (ProvideDataEvent != null) { bool clone = ProvideDataEvent.GetInvocationList().Length > 1; ProvideDataEvent.Invoke(data, clone); } } } catch (Exception ex) { exception = ex; } }