Exemplo n.º 1
0
 public TaskEventArgs(Task task)
 {
     this.task = task;
 }
        public void AddTask(Task t)
        {
            if (tasks.Contains (t)) return;
            tasks [t] = t;

            Gdk.Pixbuf stock;
            switch (t.TaskType) {
                case TaskType.Warning:
                    stock = sw.RenderIcon (Gtk.Stock.DialogWarning, Gtk.IconSize.SmallToolbar, "");
                    break;
                case TaskType.Error:
                    stock = sw.RenderIcon (Gtk.Stock.DialogError, Gtk.IconSize.SmallToolbar, "");
                    break;
                case TaskType.Comment:
                    stock = sw.RenderIcon (Gtk.Stock.DialogInfo, Gtk.IconSize.SmallToolbar, "");
                    break;
                case TaskType.SearchResult:
                    stock = sw.RenderIcon (Gtk.Stock.DialogQuestion, Gtk.IconSize.SmallToolbar, "");
                    break;
                default:
                    stock = null;
                    break;
            }

            string tmpPath = t.FileName;
            if (t.Project != null)
                tmpPath = Runtime.FileUtilityService.AbsoluteToRelativePath (t.Project.BaseDirectory, t.FileName);

            string fileName = tmpPath;
            string path     = tmpPath;

            try {
                fileName = Path.GetFileName(tmpPath);
            } catch (Exception) {}

            try {
                path = Path.GetDirectoryName(tmpPath);
            } catch (Exception) {}

            store.AppendValues (
                stock,
                t.Line,
                t.Description,
                fileName,
                path,
                t, false, false, (int) Pango.Weight.Bold);
        }
Exemplo n.º 3
0
        public void AddTask(Task task)
        {
            tasks.Add (task);

            switch (task.TaskType) {
                case TaskType.Warning:
                    ++warnings;
                    break;
                case TaskType.Error:
                    ++errors;
                    break;
                default:
                    ++comments;
                    break;
            }

            OnTaskAdded (new TaskEventArgs (task));
        }
 public void BeginTask(string name, int totalWork)
 {
     Task t = new Task ();
     t.Name = name;
     t.TotalWork = totalWork;
     tasks.Add (t);
 }