Пример #1
0
 public static void Register(BarManagerPaintStyleCollection styles)
 {
     for (int i = 0; i < styles.Count; i++)
     {
         BarManagerPaintStyle paintStyle = styles[i];
         BarItemInfo          list       = paintStyle.ItemInfoCollection[BaseBarItemName];
         if (list != null && paintStyle.ItemInfoCollection[BarItemName] == null)
         {
             paintStyle.ItemInfoCollection.Add(new BarItemInfo(BarItemName, BarItemCaption, -1, typeof(BarTransparentButtonItem), list.LinkType,
                                                               typeof(BarTransparentButtonLinkViewInfo), list.LinkPainter, true, false));
         }
     }
 }
        private DataTable CreateTable(int RowCount)
        {
            BarManagerPaintStyle  paintStyle      = barManager1.GetController().PaintStyle;
            BarItemInfoCollection itemsCollection = new BarItemInfoCollection(paintStyle);

            for (int i = 0; i < 5; i++)
            {
                if (paintStyle.ItemInfoCollection[i].ItemType != typeof(BarSubItem))
                {
                    itemsCollection.Add(paintStyle.ItemInfoCollection[i]);
                }
            }

            DataTable tbl = new DataTable();

            tbl.Columns.Add("Id", typeof(int));
            tbl.Columns.Add("ParentId", typeof(int));
            tbl.Columns.Add("Caption", typeof(string));
            tbl.Columns.Add("ItemKind", typeof(BarItemInfo));

            Random rnd = new Random();

            for (int i = 0; i < RowCount; i++)
            {
                int parentId = rnd.Next(RowCount * -1, RowCount);
                if (parentId == i)
                {
                    parentId--;
                }

                tbl.Rows.Add(new object[] { i + 1, parentId <= 0 ? -1 : parentId, String.Format("Caption {0}", i),
                                            itemsCollection[rnd.Next(0, itemsCollection.Count - 1)] });
            }

            return(tbl);
        }
Пример #3
0
 public CustomBarLinkPainter(BarManagerPaintStyle paintStyle)
     : base(paintStyle)
 {
 }
 public BarCheckAndDropDownButtonLinkPainter(BarManagerPaintStyle style)
     : base(style)
 {
 }