コード例 #1
0
        private static void Worker_DoWork(object sender, DoWorkEventArgs e)
        {
            WorkerContext cxt = e.Argument as WorkerContext;

            try
            {
                cxt.OnStart();
            }
            catch (Exception ex)
            {
                if (cxt.OnException != null)
                {
                    cxt.OnException(ex);
                }
            }
            finally
            {
                if (cxt.OnComplete != null)
                {
                    cxt.OnComplete();
                }
            }
        }