Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        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;
            }
        }