private Image GeneratePreview(Graphics graphics) { if (this.previewedActivityImage == null) { ActivityDesigner previewDesigner = this.PreviewDesigner; if ((previewDesigner != null) && (this.parentDesigner != null)) { this.previewedActivityImage = previewDesigner.GetPreviewImage(graphics); } } return(this.previewedActivityImage); }
protected override void CreateDragFeedbackImages(IList <Activity> draggedActivities) { base.CreateDragFeedbackImages(draggedActivities); List <Image> list = new List <Image>(); using (Graphics graphics = base.ParentView.CreateGraphics()) { foreach (Activity activity in draggedActivities) { ActivityDesigner designer = ActivityDesigner.GetDesigner(activity); if (designer == null) { designer = ActivityDesigner.CreateDesigner(base.ParentView, activity); } list.Add(designer.GetPreviewImage(graphics)); } } base.ParentView.InvalidateClientRectangle(Rectangle.Empty); this.draggedDesignerImages = list; }
protected override void CreateDragFeedbackImages(IList <Activity> draggedActivities) { base.CreateDragFeedbackImages(draggedActivities); List <Image> imageList = new List <Image>(); using (Graphics graphics = ParentView.CreateGraphics()) { foreach (Activity activity in draggedActivities) { ActivityDesigner previewDesigner = ActivityDesigner.GetDesigner(activity); if (previewDesigner == null) { previewDesigner = ActivityDesigner.CreateDesigner(ParentView, activity); } imageList.Add(previewDesigner.GetPreviewImage(graphics)); } } //We create the designer images for designers associates with existing activities ParentView.InvalidateClientRectangle(Rectangle.Empty); this.draggedDesignerImages = imageList; }