public object GetImage(ICoreIconProvider coreIconProvider) { //if its a ColumnInfo and RAW then use the basic ColumnInfo icon if (_column is ColumnInfo && _bubble <= LoadBubble.Raw) { return(coreIconProvider.GetImage(RDMPConcept.ColumnInfo)); } //otherwise use the default Live/PreLoadDiscardedColumn icon return(coreIconProvider.GetImage(_column)); }
private Bitmap GetImageForStage(LoadStage loadStage) { switch (loadStage) { case LoadStage.GetFiles: return(_iconProvider.GetImage(RDMPConcept.GetFilesStage)); case LoadStage.Mounting: return(_iconProvider.GetImage(RDMPConcept.LoadBubbleMounting)); case LoadStage.AdjustRaw: return(_iconProvider.GetImage(RDMPConcept.LoadBubble)); case LoadStage.AdjustStaging: return(_iconProvider.GetImage(RDMPConcept.LoadBubble)); case LoadStage.PostLoad: return(_iconProvider.GetImage(RDMPConcept.LoadFinalDatabase)); default: throw new ArgumentOutOfRangeException(); } }
private object CheckImageGetter(object rowobject) { var checkable = rowobject as ICheckable; if (checkable == null) { return(null); } lock (ocheckResultsDictionaryLock) { if (checkResultsDictionary.ContainsKey(checkable)) { return(_iconProvider.GetImage(checkResultsDictionary[checkable])); } } //not been checked yet return(null); }
public void Setup(ICoreIconProvider iconProvider, LoadStage stage) { pictureBox1.Image = iconProvider.GetImage(stage); lblLoadStage.Text = stage.ToString(); this.Width = lblLoadStage.Right; }
public Bitmap GetImage(ICoreIconProvider coreIconProvider) { return(coreIconProvider.GetImage(_bubble)); }
protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); float maxWidthUsedDuringRender = 0; int renderWidth = panel1.Right; lock (oMatches) { //draw Form background e.Graphics.FillRectangle(new SolidBrush(SystemColors.Control), 0, 0, renderWidth, (int)((_matches.Count * RowHeight) + DrawMatchesStartingAtY)); //draw the search icon e.Graphics.DrawImage(_magnifier, 0, 0); //the match diagram if (_matches != null) { //draw the icon that represents the object being displayed and it's name on the right for (int i = 0; i < _matches.Count; i++) { bool isFavourite = _favouriteProvider.IsFavourite(_matches[i]); float currentRowStartY = DrawMatchesStartingAtY + (RowHeight * i); var img = _coreIconProvider.GetImage(_matches[i], isFavourite?OverlayKind.FavouredItem:OverlayKind.None); SolidBrush fillColor; if (i == keyboardSelectedIndex) { fillColor = new SolidBrush(keyboardSelectionColor); } else if (i == mouseSelectedIndex) { fillColor = new SolidBrush(mouseSelectionColor); } else { fillColor = new SolidBrush(Color.White); } e.Graphics.FillRectangle(fillColor, 1, currentRowStartY, renderWidth, RowHeight); string text = _matches[i].ToString(); float textRight = e.Graphics.MeasureString(text, Font).Width + 20; //record how wide it is so we know how much space is left to draw parents maxWidthUsedDuringRender = Math.Max(maxWidthUsedDuringRender, textRight); e.Graphics.DrawImage(img, 1, currentRowStartY); e.Graphics.DrawString(text, Font, Brushes.Black, 20, currentRowStartY); string extraText = " " + GetUsefulProperties(_matches[i]); if (!string.IsNullOrWhiteSpace(extraText)) { e.Graphics.DrawString(extraText, Font, Brushes.Gray, textRight, currentRowStartY); float extraTextRight = textRight + e.Graphics.MeasureString(extraText, Font).Width; maxWidthUsedDuringRender = Math.Max(maxWidthUsedDuringRender, extraTextRight); } } //now draw parent string and icon on the right for (int i = 0; i < _matches.Count; i++) { //get first parent that isn't one of the explicitly useless parent types (I'd rather know the Catalogue of an AggregateGraph than to know it's an under an AggregatesGraphNode) var descendancy = Activator.CoreChildProvider.GetDescendancyListIfAnyFor(_matches[i]); object lastParent = null; if (descendancy != null) { lastParent = descendancy.Parents.LastOrDefault(parent => !TypesThatAreNotUsefulParents.Contains(parent.GetType()) && !(parent is IContainer) ); } float currentRowStartY = DrawMatchesStartingAtY + (RowHeight * i); if (lastParent != null) { ColorMatrix cm = new ColorMatrix(); cm.Matrix33 = 0.55f; ImageAttributes ia = new ImageAttributes(); ia.SetColorMatrix(cm); var rect = new Rectangle(renderWidth - 20, (int)currentRowStartY, 19, 19); var img = _coreIconProvider.GetImage(lastParent); //draw the parents image on the right e.Graphics.DrawImage(img, rect, 0, 0, img.Width, img.Height, GraphicsUnit.Pixel, ia); var horizontalSpaceAvailableToDrawTextInto = renderWidth - (maxWidthUsedDuringRender + 20); string text = ShrinkTextToFitWidth(lastParent.ToString(), horizontalSpaceAvailableToDrawTextInto, e.Graphics); var spaceRequiredForCurrentText = e.Graphics.MeasureString(text, Font).Width; e.Graphics.DrawString(text, Font, Brushes.DarkGray, renderWidth - (spaceRequiredForCurrentText + 20), currentRowStartY); } } } } }