void taskList_Navigate(object sender, Task task)
 {
     XmlNode node = task.Data as XmlNode;
     if (node != null) {
         XmlTreeNode tn = this.xmlTreeView1.FindNode(node);
         if (tn != null) {
             this.xmlTreeView1.SelectedNode = tn;
             this.SelectTreeView();
         }
     }
 }
Exemple #2
0
 static object[] GetValues(Task t)
 {
     return new object[] { t.SeverityImage, t.Description, t.FileName, t.Line, t.Column };
 }
Exemple #3
0
 void AddRow(Task t)
 {
 }
Exemple #4
0
 public bool Remove(Task t)
 {
     int i = GetTaskIndex(t);
     if (i >= 0) {
         t.Parent = null;
         if (navigated != null && navigated.Index == i)
             navigated = null;
         this.dataGridView1.Rows.RemoveAt(i);
         return true;
     }
     return false;
 }
Exemple #5
0
 internal void OnTaskChanged(Task t)
 {
     int i = GetTaskIndex(t);
     if (i >= 0) {
         t.Parent = this;
         this.dataGridView1.Rows[i].SetValues(GetValues(t));
     }
 }
Exemple #6
0
 public void Insert(int index, Task t)
 {
     t.Parent = this;
     this.dataGridView1.Rows.Insert(index, GetValues(t));
     DataGridViewRow row = this.dataGridView1.Rows[index];
     row.Tag = t;
 }
Exemple #7
0
 public int GetTaskIndex(Task t)
 {
     for (int i = 0, n = this.Count; i < n; i++) {
         DataGridViewRow row = this.dataGridView1.Rows[i];
         if (row.Tag == t) {
             return i;
         }
     }
     return -1;
 }
Exemple #8
0
 public bool Contains(Task t)
 {
     foreach (DataGridViewRow row in this.dataGridView1.Rows) {
         Task o = row.Tag as Task;
         if (o != null && o.Equals(t)) {
             return true;
         }
     }
     return false;
 }
Exemple #9
0
 public int Add(Task t)
 {
     t.Parent = this;
     int index = this.dataGridView1.Rows.Add(GetValues(t));
     DataGridViewRow row = this.dataGridView1.Rows[index];
     row.Tag = t; // keep mapping to original task!
     return index;
 }
Exemple #10
0
 public override void HandleError(Severity sev, string reason, string filename, int line, int col, object data)
 {
     Task nt = new Task(sev, reason, filename, line, col, data);
     if (!unique.Contains(nt)) {
         unique[nt] = nt;
         errors.Add(nt); // preserve order
     }
 }