Пример #1
0
        /// <summary>
        /// Ensure that a task source for the output pane is created. If it is the first task source output, make it the visible task source output.
        /// </summary>
        /// <param name="tasksource">Name of the task source.</param>
        /// <param name="executingTask">The currently executing task.</param>
        /// <param name="executingTask">The executer the currently executing task is running in.</param>
        /// <returns>The existing or newly created task source output.</returns>
        internal TaskSourceOutput EnsureTaskSourceOutputForExecutingTask(string tasksource, Process executingProcess, Executer executer)
        {
            bool makeVisible = false;
            TaskSourceOutput tso;

            if (CurrentTaskSourceOutput == null)
            {
                makeVisible = true;
            }

            // Get TaskSource output
            tso = GetTaskSourceOutput(tasksource);
            if (tso == null)
            {
                tso = new TaskSourceOutput { TaskSource = tasksource, ExecutingProcess = executingProcess, ProcessExecuter = executer, Output = String.Empty };
                _taskSourceOutputs.Add(tso);
            }
            else
            {
                tso.ExecutingProcess = executingProcess;
                tso.ProcessExecuter = executer;
            }

            if (makeVisible)
            {
                CurrentTaskSourceOutput = tso;
                WebMatrixContext.OutputPaneInstance.Show(tasksource);
            }

            return tso;
        }
Пример #2
0
        public void Show(string tasksource)
        {
            this.Dispatcher.Invoke(new Action(() =>
            {
                WebMatrixContext.EditorTaskPanelService.ShowBottomPane();
                WebMatrixContext.EditorTaskPanelService.ShowTaskTab(OutputPane.OutputPaneTaskPanelId);
                CurrentTaskSourceOutput = _taskSourceOutputs.Where(n => n.TaskSource == tasksource).FirstOrDefault();
            }));

        }