Exemple #1
0
 public QueuedTextWrite(TaskResult task)
 {
     this.task = task;
 }
Exemple #2
0
 public QueuedTextWrite(TaskResult task)
 {
     this.task = task;
 }
Exemple #3
0
        protected void UnsafeAddText(TaskResult task)
        {
            try {

                TreeIter iter = outputModel.AppendValues(task.name, task.status, "", "");
                if (task.errors != null) {

                    foreach (TaskMessage tm in task.errors){

                        TreeIter ti;
                        if (!String.IsNullOrEmpty(tm.File))
                            ti= outputModel.AppendValues(iter, System.IO.Path.GetFileName(tm.File), tm.Line, tm.Message, tm.File);
                        else
                            ti = outputModel.AppendValues(iter, "", tm.Line, tm.Message, "");

                        if (tm.Child != null){
                            //TaskMessage tmChild = tm.Child;
                            //TreeIter ti = outputModel.AppendValues( System.IO.Path.GetFileName(tm.File), tm.Line, tm.Message, tm.File);
                            AppendChild(ti,tm.Child);

                        }
                    }
                }
                ScrolledWindow window = treeView.Parent as ScrolledWindow;
                bool scrollToEnd = true;
                if (window != null) {
                    scrollToEnd = window.Vadjustment.Value >= window.Vadjustment.Upper - 2 * window.Vadjustment.PageSize;
                }
                //if (extraTag != null)
                //	buffer.InsertWithTags(ref it, text, tag, extraTag);
                //else
                //	buffer.InsertWithTags(ref it, text, tag);

                if (scrollToEnd) {
                    //it.LineOffset = 0;
                    TreePath path = outputModel.GetPath(iter);
                    treeView.ScrollToCell(path, null, false, 0, 0);
                    //outputModel.MoveBefore(iter,TreeIter.Zero);
                    //buffer.MoveMark(endMark, it);
                    //treeView.ScrollToCell() ScrollToMark(endMark, 0, false, 0, 0);
                }
            } catch(Exception ex) {
                Logger.Error(ex.Message,null);
            }
        }
Exemple #4
0
 public void WriteTask_II(object task, string name, string status, List<TaskMessage> error, bool clearOutput)
 {
     if (clearOutput)
         Clear();
     TaskResult tr = new TaskResult(name, status, error);
     //raw text has an extra optimisation here, as we can append it to existing updates
                 /*lock (updates) {
         if (lastTextWrite != null) {
             if (lastTextWrite.Tag == null) {
                 lastTextWrite.Write(tr);
                 return;
             }
         }
     }*/
     QueuedTextWrite qtw = new QueuedTextWrite(tr);
     AddQueuedUpdate(qtw);
 }
Exemple #5
0
        //
        protected void UnsafeAddText(TaskResult task)
        {
            try {
                TreeIter iter = TreeIter.Zero;
                //TreeIter iter = outputModel.AppendValues(task.name, task.status, "", "");
                if (task.errors != null) {
                    foreach (TaskMessage tm in task.errors){
                        bool find = false;
                        outputModel.Foreach((model, path, iterr) => {
                                string category = outputModel.GetValue(iterr, 0).ToString();
                                if (category == tm.File){
                                        outputModel.SetValue(iterr,1,tm.Message);
                                        find = true;
                                        return true;
                                }
                                    return false;
                            });
                        if(!find)
                            iter = outputModel.AppendValues(tm.File, tm.Message, tm.Line);
                    }
                }
                ScrolledWindow window = treeView.Parent as ScrolledWindow;
                bool scrollToEnd = true;
                if (window != null) {
                    scrollToEnd = window.Vadjustment.Value >= window.Vadjustment.Upper - 2 * window.Vadjustment.PageSize;
                }

                if (scrollToEnd) {
                    //it.LineOffset = 0;
                    if(!iter.Equals(TreeIter.Zero)){
                        TreePath path = outputModel.GetPath(iter);
                        treeView.ScrollToCell(path, null, false, 0, 0);
                    }

                }
            } catch(Exception ex) {
                Logger.Error(ex.Message,null);
            }
        }
Exemple #6
0
        //
        protected void UnsafeAddText(TaskResult task)
        {
            try {
                TreeIter iter = TreeIter.Zero;
                //TreeIter iter = outputModel.AppendValues(task.name, task.status, "", "");
                if (task.errors != null) {

                    foreach (TaskMessage tm in task.errors){
                        CountItem++;
                        iter= outputModel.AppendValues(tm.Message);
                    }
                }
                ScrolledWindow window = treeView.Parent as ScrolledWindow;
                bool scrollToEnd = true;
                if (window != null) {
                    scrollToEnd = window.Vadjustment.Value >= window.Vadjustment.Upper - 2 * window.Vadjustment.PageSize;
                }

                if (scrollToEnd) {
                    //it.LineOffset = 0;
                    if(!iter.Equals(TreeIter.Zero)){
                        TreePath path = outputModel.GetPath(iter);
                        treeView.ScrollToCell(path, null, false, 0, 0);
                    }

                }
            } catch(Exception ex) {
                Logger.Error(ex.Message,null);
            }
        }
Exemple #7
0
 public void WriteTask_II(object task, string name, string status, List<TaskMessage> error, bool clearOutput)
 {
     if (clearOutput)
         Clear();
     TaskResult tr = new TaskResult(name, status, error);
     QueuedTextWrite qtw = new QueuedTextWrite(tr);
     AddQueuedUpdate(qtw);
 }