public Task Start(string taskName)
        {
            IExtensionEnabledWorkflowApplication workflow = kernel.Get<IExtensionEnabledWorkflowApplication>();

            workflow.Initialize(new TaskWorkflow());

            workflow.MyExtensions.Add(this);

            InitializeStateTracker(workflow);

            workflow.Completed = WorkflowCompleted;

            workflow.Run();

            Task task = new Task() { Id = workflow.Id, Title = taskName };

            this.workflows.Add(task.Id, workflow);
            this.tasks.Add(task.Id, task);

            return task;
        }
 private void setStatusText(Task task)
 {
     if (task != null)
     {
         this.TaskStatus = String.Format("Task ID: {0}, Status: {1}", task.Id, this.taskMachine.GetTaskStatus(task.Id));
     }
     else
     {
         this.TaskStatus = "No task selected";
     }
 }
 internal TaskCompletedEventArgs(Task task)
 {
     this.Task = task;
 }