private void ToggleNode(System.Windows.Forms.TreeNode node, bool bSelectNode) { if (bSelectNode) { this.m_SelectedNode = node; if (!this.m_SelectedNodes.Contains(node)) { this.m_SelectedNodes.Add(node); } node.set_BackColor(System.Drawing.SystemColors.Highlight); } else { this.m_SelectedNodes.Remove(node); node.set_BackColor(this.BackColor); } }
private static System.Windows.Forms.DataGridViewCellStyle CalculateCellStyle(System.Windows.Forms.DataGridViewCellStyle baseStyle, System.Drawing.Color color) { int num = (color.get_R() > 0x33) ? ((int) (color.get_R() - 0x33)) : ((int) 0); int num2 = (color.get_G() > 0x33) ? ((int) (color.get_G() - 0x33)) : ((int) 0); int num3 = (color.get_B() > 0x33) ? ((int) (color.get_B() - 0x33)) : ((int) 0); System.Drawing.Color color2 = System.Drawing.Color.FromArgb(num, num2, num3); baseStyle.set_BackColor(color); baseStyle.set_ForeColor((color.GetBrightness() > 0.5) ? System.Drawing.Color.Black : System.Drawing.Color.White); baseStyle.set_SelectionBackColor(color2); baseStyle.set_SelectionForeColor((color2.GetBrightness() > 0.5) ? System.Drawing.Color.Black : System.Drawing.Color.White); return baseStyle; }