private FrmPopoutClusterSheet(Size size, List <Visualisable> items, IPreviewProvider previewProvider) : this() { this._imageSize = size; this._items = items; this._previewProvider = previewProvider; this.imageList1.ImageSize = this._imageSize; this.listView1.TileSize = this._imageSize; this.listView1.VirtualListSize = items.Count; this.imageList1.Images.Add(ChartHelperForClusters.CreatePlaceholderBitmap(null, this._imageSize)); }
private Image GeneratePreviewImage(object item) { if (!this.EnablePreviews) { return(UiControls.GetImage(item)); } Image img = this._previewProvider.ProvidePreview(this._imageList.ImageList.ImageSize, item); if (img == null) { return(ChartHelperForClusters.CreatePlaceholderBitmap(item, this._imageList.ImageList.ImageSize)); } return(img); }
private int GeneratePreviewImage(Visualisable item) { int index; if (item.Hidden) { return(0); } if (!this._imgListPreviewIndexes.TryGetValue(item, out index)) { Image img = this._previewProvider.ProvidePreview(this._imageSize, item) ?? ChartHelperForClusters.CreatePlaceholderBitmap(item, this._imageSize); index = this.imageList1.Images.Count; this.imageList1.Images.Add(item.DisplayName, img); this._imgListPreviewIndexes.Add(item, index); } return(index); }