Exemple #1
0
        private ColumnTreeNode getNodeFrom(ColumnData data)
        {
            ItemsColumn column = Packages.InstantiateColumn(data, Host);
            string      key    = Guid.NewGuid().ToString();

            this.ImageList.Images.Add(key, column.GetIcon());
            return(new ColumnTreeNode()
            {
                Text = column.GetHeaderText(),
                SubColumn = data,
                ImageKey = key,
                SelectedImageKey = key
            });
        }
Exemple #2
0
        protected override void OnDoWork(DoWorkEventArgs e)
        {
            while (queue.Count > 0)
            {
                ColumnListViewItem item     = queue.Dequeue();
                ListView           listView = item.ListView;
                ImageList          images   = listView.SmallImageList;
                ItemsColumn        column   = listView.Parent as ItemsColumn;

                Image    image = column.GetIcon(item);
                Image    final = new Bitmap(20, 20);
                Graphics g     = Graphics.FromImage(final);

                g.DrawImage(image, new Rectangle(2, 2, 16, 16));
                this.ReportProgress(0, new Tuple <ColumnListViewItem, Image>(item, final));

                g.Dispose();
                image.Dispose();
            }
            base.OnDoWork(e);
        }