Exemplo n.º 1
0
        private void AddTheTasks(BackgroundWorker worker)
        {
            int g = _batchAddTaskList.Count;

            for (int i = 0; i < _batchAddTaskList.Count; i++)
            {
                Task t = _batchAddTaskList[i];
                var  c = new Change(Environment.UserName, ChangeType.Add, null, t.Clone());
                _curCat.AddTask(t);
                _todoList.AddChangeWithoutEventTriggering(c);

                int w = i + 1;
                int p = w * 100 / g;
                worker.ReportProgress(p);
            }
            _todoList.TriggerChangeEvent();
        }