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(); } } }
static object[] GetValues(Task t) { return new object[] { t.SeverityImage, t.Description, t.FileName, t.Line, t.Column }; }
void AddRow(Task t) { }
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; }
internal void OnTaskChanged(Task t) { int i = GetTaskIndex(t); if (i >= 0) { t.Parent = this; this.dataGridView1.Rows[i].SetValues(GetValues(t)); } }
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; }
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; }
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; }
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; }
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 } }