Пример #1
0
        private void mBackgroundWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            object[] parameters = (object[])e.Argument;

            int currentStepNumber = (int)parameters[0];
            var shapeValues       = (List <object>)parameters[1];

            Thread.CurrentThread.CurrentCulture   = (CultureInfo)parameters[2];
            Thread.CurrentThread.CurrentUICulture = (CultureInfo)parameters[3];

            e.Result = WorkCallback?.Invoke(currentStepNumber, shapeValues);
        }
Пример #2
0
        /// <summary>
        ///     Breaks/Stops current work.
        /// </summary>
        internal void InternalBreakWork()
        {
            if (!WorkActive)
            {
                return;
            }

            // reset last work
            WorkActive    = false;
            WorkSessionId = 0;
            WorkCallback?.Invoke();
            WorkCallback = null;
        }