예제 #1
0
        /// <summary>
        /// Sets the breakpoint state
        /// </summary>
        /// <param name="rowPosition">
        /// Position in the grid
        /// </param>
        /// <param name="breakPointStates">
        /// The breakpoint state to set
        /// </param>
        private void SetBreakPointState(int rowPosition, BreakPointStates breakPointStates)
        {
            var rowToEdit = this.dataGridViewOpcodes.Rows[rowPosition];

            switch (breakPointStates)
            {
            case BreakPointStates.None:
                rowToEdit.Cells[this.BreakPointStateColumn.Index].Value = BreakPointStates.None;
                rowToEdit.Cells[this.BreakPointColumn.Index].Value      = null;
                rowToEdit.DefaultCellStyle.BackColor          = Color.White;
                rowToEdit.DefaultCellStyle.ForeColor          = Color.Black;
                rowToEdit.DefaultCellStyle.SelectionBackColor =
                    this.dataGridViewOpcodes.DefaultCellStyle.SelectionBackColor;
                rowToEdit.DefaultCellStyle.SelectionForeColor =
                    this.dataGridViewOpcodes.DefaultCellStyle.SelectionForeColor;
                this.SetValueOfBreakPointColumn(rowToEdit);
                break;

            case BreakPointStates.Hit:
                rowToEdit.Cells[this.BreakPointStateColumn.Index].Value = BreakPointStates.Hit;
                rowToEdit.Cells[this.BreakPointColumn.Index].Value      = Properties.Resources.BreakPointHit;
                rowToEdit.DefaultCellStyle.BackColor          = Color.Yellow;
                rowToEdit.DefaultCellStyle.ForeColor          = Color.Black;
                rowToEdit.DefaultCellStyle.SelectionBackColor = Color.Yellow;
                rowToEdit.DefaultCellStyle.SelectionForeColor = Color.Black;
                this.SetValueOfBreakPointColumn(rowToEdit);
                break;

            case BreakPointStates.Set:
                rowToEdit.Cells[this.BreakPointStateColumn.Index].Value = BreakPointStates.Set;
                rowToEdit.Cells[this.BreakPointColumn.Index].Value      = Properties.Resources.BreakPointSet;
                rowToEdit.DefaultCellStyle.BackColor          = Color.IndianRed;
                rowToEdit.DefaultCellStyle.ForeColor          = Color.Black;
                rowToEdit.DefaultCellStyle.SelectionBackColor = Color.IndianRed;
                rowToEdit.DefaultCellStyle.SelectionForeColor = Color.White;
                this.SetValueOfBreakPointColumn(rowToEdit);
                break;

            case BreakPointStates.Step:
                rowToEdit.Cells[this.BreakPointStateColumn.Index].Value = BreakPointStates.Step;
                rowToEdit.Cells[this.BreakPointColumn.Index].Value      = Properties.Resources.BreakPointStep;
                rowToEdit.DefaultCellStyle.BackColor          = Color.Yellow;
                rowToEdit.DefaultCellStyle.ForeColor          = Color.Black;
                rowToEdit.DefaultCellStyle.SelectionBackColor = Color.Yellow;
                rowToEdit.DefaultCellStyle.SelectionForeColor = Color.Black;
                this.SetValueOfBreakPointColumn(rowToEdit);
                break;
            }
        }
예제 #2
0
        private Brush getBrush(BreakPointStates state)
        {
            switch (state) {
            case BreakPointStates.Normal:
                return Brushes.Purple;

            case BreakPointStates.Disable:
                return Brushes.White;

            case BreakPointStates.Highlight:
                return Brushes.Yellow;
            }

            return null;
        }