public InspectorGrid() { DoubleBuffered = true; AllowUserToAddRows = false; AllowUserToDeleteRows = false; MultiSelect = false; ReadOnly = false; SelectionMode = DataGridViewSelectionMode.FullRowSelect; RowHeadersVisible = false; // TODO-Linux: VirtualMode is not supported on Mono. VirtualMode = true; AllowUserToResizeRows = false; Font = SystemFonts.MenuFont; DefaultCellStyle.ForeColor = SystemColors.WindowText; GridColor = DefaultCellStyle.BackColor; m_clrGrid = Color.FromArgb(40, ForeColor); m_clrShading = CalculateColor(DefaultCellStyle.ForeColor, DefaultCellStyle.BackColor, 25); m_list = new GenericInspectorObjectList(); using (Image img = Properties.Resources.kimidExpand) { m_szHotSpot = new Size(img.Width, img.Height); m_dxVLine = (int)(m_szHotSpot.Width * 1.5); } }
/// ------------------------------------------------------------------------------------ /// <summary> /// Sets the top level object. /// </summary> /// ------------------------------------------------------------------------------------ public void SetTopLevelObject(object obj, IInspectorList list) { if (m_list != null) { m_list.BeginItemExpanding -= m_list_BeginItemExpanding; m_list.EndItemExpanding -= m_list_EndItemExpanding; } m_list = list; m_list.Initialize(obj); gridInspector.List = m_list; m_list.BeginItemExpanding += m_list_BeginItemExpanding; m_list.EndItemExpanding += m_list_EndItemExpanding; }
/// ------------------------------------------------------------------------------------ /// <summary> /// Initializes a new instance of the <see cref="InspectorGrid"/> class. /// </summary> /// ------------------------------------------------------------------------------------ public InspectorGrid(IInspectorList list) : this() { List = list; }