private void dataGridView_CellValueChanged(object sender, DataGridViewCellEventArgs e) { if (!_isReady) { return; } DataGridViewRow row = dataGridView.Rows[e.RowIndex]; DebugDataPool.Action action = row.Tag as DebugDataPool.Action; if (action != null) { bool actionEnable = (bool)row.Cells["Enable"].Value; string behaviorFilename = (string)row.Cells["BehaviorFilename"].Value; string nodeType = (string)row.Cells["NodeType"].Value; string nodeId = (string)row.Cells["NodeId"].Value; string actionName = getResourceName((string)row.Cells["ActionName"].Value); string actionResult = getResourceName((string)row.Cells["ActionResult"].Value); int hitCount = getHitCount(row); selectRowNode(row); _isReady = false; DebugDataPool.AddBreakPoint(behaviorFilename, nodeId, nodeType, actionName, actionEnable, actionResult, hitCount); _isReady = true; } }
private void deleteAllButton_Click(object sender, EventArgs e) { int rowCount = dataGridView.Rows.Count; if (rowCount < 0) { return; } DialogResult dr = MessageBox.Show(Resources.DeleteAllBreakpointsWarning, Resources.DeleteAllBreakpoints, MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (dr != DialogResult.Yes) { return; } string[] behaviorFilenames = new string[rowCount]; string[] nodeIds = new string[rowCount]; DebugDataPool.Action[] actions = new DebugDataPool.Action[rowCount]; for (int i = 0; i < rowCount; i++) { DataGridViewRow row = dataGridView.Rows[i]; behaviorFilenames[i] = (string)row.Cells["BehaviorFilename"].Value; nodeIds[i] = (string)row.Cells["NodeId"].Value; actions[i] = row.Tag as DebugDataPool.Action; } deleteBreakpoints(behaviorFilenames, nodeIds, actions); }
private void removeBreakPoint(string behaviorFilename, string nodeType, string nodeId, DebugDataPool.Action action) { if (!_isReady) { return; } int index = getRowIndex(behaviorFilename, nodeId, action.Name); if (index > -1) { dataGridView.Rows.RemoveAt(index); if (dataGridView.CurrentCell != null) { DataGridViewRow row = dataGridView.Rows[dataGridView.CurrentCell.RowIndex]; row.Selected = true; } } }
private void addBreakPoint(string behaviorFilename, string nodeType, string nodeId, DebugDataPool.Action action) { if (!_isReady) { return; } int index = newBreakPoint(behaviorFilename, nodeType, nodeId, action); DataGridViewRow row = dataGridView.Rows[index]; dataGridView.CurrentCell = row.Cells["BehaviorFilename"]; dataGridView.Sort(dataGridView.Columns["BehaviorFilename"], System.ComponentModel.ListSortDirection.Ascending); selectRowNode(row); }
private int newBreakPoint(string behaviorFilename, string nodeType, string nodeId, DebugDataPool.Action action) { _isReady = false; int index = getRowIndex(behaviorFilename, nodeId, action.Name); if (index < 0) { index = dataGridView.Rows.Add(); } DataGridViewRow row = dataGridView.Rows[index]; row.Tag = action; row.Cells["Enable"].Value = action.Enable; row.Cells["BehaviorFilename"].Value = behaviorFilename; row.Cells["NodeType"].Value = nodeType; row.Cells["NodeId"].Value = nodeId; row.Cells["ActionName"].Value = action.Name; row.Cells["ActionResult"].Value = action.Result; row.Cells["HitCount"].Value = action.HitCount; _isReady = true; return(index); }
private void removeBreakPoint(string behaviorFilename, string nodeType, string nodeId, DebugDataPool.Action action) { SendBreakpoint(behaviorFilename, nodeType, nodeId, action.Name, false, 0, "all"); }
private void addBreakPoint(string behaviorFilename, string nodeType, string nodeId, DebugDataPool.Action action) { if (action.Enable) { SendBreakpoint(behaviorFilename, nodeType, nodeId, action.Name, true, action.HitCount, action.Result); } else { removeBreakPoint(behaviorFilename, nodeType, nodeId, action); } }