private void LoadVinabiz() { BindVinabiz(); setCheckedListBox(false); List <dm_DialogColumn> column = SQLDatabase.Loaddm_DialogColumn(string.Format("select * from dm_DialogColumn where IDLoad='{0}'", fromparent)); for (int i = 0; i < checkedListBox1.Items.Count && column.Count() > 0; i++) { ListItemBox view = (ListItemBox)checkedListBox1.Items[i]; string value = view.Name; if (column.Count(p => p.Keys == value) > 0) { checkedListBox1.SetItemChecked(i, true); } } }
/// <summary> /// Paints the fragment /// </summary> /// <param name="g"></param> private void PaintImp(Graphics g) { if (Display != CssConstants.None && (Display != CssConstants.TableCell || EmptyCells != CssConstants.Hide || !IsSpaceOrEmpty)) { var areas = Rectangles.Count == 0 ? new List <RectangleF>(new[] { Bounds }) : new List <RectangleF>(Rectangles.Values); RectangleF[] rects = areas.ToArray(); PointF offset = HtmlContainer != null ? HtmlContainer.ScrollOffset : PointF.Empty; for (int i = 0; i < rects.Length; i++) { var actualRect = rects[i]; actualRect.Offset(offset); PaintBackground(g, actualRect, i == rects.Length - 1); PaintBorder(g, actualRect, i == 0, i == rects.Length - 1); } if (IsImage) { var word = Words[0]; RectangleF r = word.Bounds; r.Offset(offset); r.Height -= ActualBorderTopWidth + ActualBorderBottomWidth + ActualPaddingTop + ActualPaddingBottom; r.Y += ActualBorderTopWidth + ActualPaddingTop; //HACK: round rectangle only when necessary g.DrawImage(word.Image, Rectangle.Round(r)); if (word.Selected) { g.FillRectangle(CssUtils.SelectionBackcolor, word.Left - word.LastMeasureOffset.X + offset.X, word.Top + offset.Y, word.Width, DomUtils.GetCssLineBoxByWord(word).LineHeight); } } else if (Words.Count > 0) { Font font = ActualFont; var brush = CssUtils.GetSolidBrush(CssValueParser.GetActualColor(Color)); foreach (var word in Words) { if (word.Selected) { // handle paint selected word background and with partial word selection var left = word.SelectedStartOffset > -1 ? word.SelectedStartOffset : 0; var width = word.SelectedEndOffset > -1 ? word.SelectedEndOffset + word.LastMeasureOffset.X : word.Width; //REFACTOR THIS STUFF Brush b = CssUtils.SelectionBackcolor; CssLineBox box = DomUtils.GetCssLineBoxByWord(word); float h = box != null ? box.LineHeight : 0; float w = width - left; float x = word.Left - word.LastMeasureOffset.X + offset.X + left; float y = word.Top + offset.Y; g.FillRectangle(b, x, y, w, h); } g.DrawString(word.Text, font, brush, word.Left - word.LastMeasureOffset.X + offset.X, word.Top + offset.Y); } } for (int i = 0; i < rects.Length; i++) { var actualRect = rects[i]; actualRect.Offset(offset); PaintDecoration(g, actualRect, i == 0, i == rects.Length - 1); } foreach (CssBox b in Boxes) { b.Paint(g); } CreateListItemBox(g); if (ListItemBox != null) { ListItemBox.Paint(g); } } }