internal bool CustomizeCells(Resco.Controls.AdvancedComboBox.ListItem item) { bool flag = false; if (!this.HasCustomizedCells || (this.Parent == null)) { return(false); } int count = this.m_CellTemplates.Count; for (int i = 0; i < count; i++) { Cell cell = this.m_CellTemplates[i]; if (cell.CustomizeCell) { object data = cell[item, i]; CustomizeCellEventArgs e = new CustomizeCellEventArgs(cell, data, item); this.OnCustomizeCell(e); ItemSpecificCellProperties itemSpecificProperties = cell.GetItemSpecificProperties(item); bool flag2 = itemSpecificProperties.Visible.HasValue ? itemSpecificProperties.Visible.Value : cell.Visible; itemSpecificProperties.Visible = new bool?(e.Cell.Visible); itemSpecificProperties.CachedAutoHeight = e.Cell.GetAutoHeight(e.DataItem, i, itemSpecificProperties); itemSpecificProperties.Cea = e; if (e.Cell.Visible != flag2) { flag = true; } } } return(flag); }
protected internal virtual void Draw(Graphics gr, Rectangle rect, Resco.Controls.AdvancedComboBox.ListItem item) { this.CurrentItem = item; int height = this.GetHeight(item); if ((this.Parent != null) && (this.m_BackColor != Color.Transparent)) { gr.FillRectangle(Resco.Controls.AdvancedComboBox.AdvancedComboBox.GetBrush(this.m_BackColor), rect.Left, rect.Top, rect.Width, height); } for (int i = 0; i < this.m_CellTemplates.Count; i++) { Cell cell = this.m_CellTemplates[i]; ItemSpecificCellProperties iscp = null; object data = null; if (cell.CustomizeCell && (this.Parent != null)) { iscp = cell.GetItemSpecificProperties(item); if (iscp.Cea != null) { cell = iscp.Cea.Cell; data = iscp.Cea.Data; } } else { data = cell[item, i]; } if (cell is ButtonCell) { ((ButtonCell)cell).Pressed = item.PressedButtonIndex == i; } if ((cell != null) && cell.Visible) { cell.Draw(gr, 0, rect.Top, rect.Width, data, iscp); } if (iscp != null) { iscp.Cea = null; } } }
protected internal virtual void Draw(Graphics gr, int xOffset, int yOffset, Resco.Controls.AdvancedComboBox.ListItem item, int width, int height) { int num = (((this.Parent != null) ? this.Parent.RightToLeft : false) && this.Parent.List.ScrollbarVisible) ? this.Parent.List.ClientScrollbarWidth : 0; Color backColor = this.m_BackColor; this.CurrentItem = item; if (height == -1) { height = this.GetHeight(item); } if (backColor == Color.Transparent) { if (this.Parent.List.UseGradient) { backColor = this.Parent.m_colorKey; } else { backColor = this.Parent.BackColor; } } if (!this.m_useGradient && (this.Parent != null)) { if ((this.Parent.DoubleBuffered && (this.Parent.List.GradientBackColor.FillDirection == FillDirection.Vertical)) || (!this.Parent.List.UseGradient || (this.m_BackColor != Color.Transparent))) { gr.FillRectangle(Resco.Controls.AdvancedComboBox.AdvancedComboBox.GetBrush(backColor), xOffset + num, yOffset, width, height); } } else { this.m_bgRect.X = xOffset + num; this.m_bgRect.Y = yOffset; this.m_bgRect.Width = width; this.m_bgRect.Height = height; this.m_gradientBackColor.DrawGradient(gr, this.m_bgRect); } int count = this.m_CellTemplates.Count; for (int i = 0; i < count; i++) { Cell cell = this.m_CellTemplates[i]; ItemSpecificCellProperties iscp = null; object data = null; if (cell.CustomizeCell && (this.Parent != null)) { iscp = cell.GetItemSpecificProperties(item); if (iscp.Cea != null) { cell = iscp.Cea.Cell; data = iscp.Cea.Data; } } else { data = cell[item, i]; } if (cell is ButtonCell) { ((ButtonCell)cell).Pressed = item.PressedButtonIndex == i; } if ((cell != null) && cell.Visible) { cell.Draw(gr, xOffset, yOffset, width, data, iscp); } if (iscp != null) { iscp.Cea = null; } } }