Exemplo n.º 1
0
 private Task <RootElementContext> ProcessRootElement(RootElementContext rootElementContext)
 {
     return(Task.Factory.StartNew((state) =>
     {
         var context = (RootElementContext)state;
         var task = new ElementProcessingTask(context, Processor);
         task.Execute();
         return context;
     }, rootElementContext));
 }
Exemplo n.º 2
0
        private void ProcessElement(int index)
        {
            var elem = RootElements[index];
            var elementProcessingTask = new ElementProcessingTask
            {
                Processor       = Processor,
                RootElement     = elem,
                ProcessingState = State
            };

            elementProcessingTask.Start();
            State.Elements[index] = elementProcessingTask.State;
        }