protected Brush GetPaletteBrush(PaletteVisualPart part) { ChartSeries series = this.model.presenter as ChartSeries; if (series == null) { return(null); } return(series.chart.GetPaletteBrush(series.ActualPaletteIndex, part, series.Family, series.IsSelected)); }
internal Brush GetPaletteBrush(int index, PaletteVisualPart part, string seriesFamily, bool selected) { Brush paletteBrush = null; if (selected && this.selectionPaletteCache != null) { paletteBrush = this.selectionPaletteCache.GetBrush(index, part, seriesFamily); } if (paletteBrush == null && this.paletteCache != null) { paletteBrush = this.paletteCache.GetBrush(index, part, seriesFamily); } return(paletteBrush); }
/// <summary> /// Gets the <see cref="Brush"/> (if present) for the specified <see cref="PaletteVisualPart"/> instance at the specified index and for the specified series family. /// </summary> /// <param name="index">The index for which to look-up a brush.</param> /// <param name="visualPart">The visual part for which a brush is required.</param> /// <param name="seriesFamily">The family of the series that request the brush.</param> public Brush GetBrush(int index, PaletteVisualPart visualPart, string seriesFamily) { PaletteEntryCollection brushCollection; switch (visualPart) { case PaletteVisualPart.Stroke: if (!string.IsNullOrEmpty(seriesFamily)) { brushCollection = FindCollectionByFamily(this.strokeEntriesByFamily, seriesFamily); if (brushCollection != null) { break; } } brushCollection = this.strokeEntries; break; case PaletteVisualPart.SpecialStroke: if (!string.IsNullOrEmpty(seriesFamily)) { brushCollection = FindCollectionByFamily(this.specialStrokeEntriesByFamily, seriesFamily); if (brushCollection != null) { break; } } brushCollection = this.specialStrokeEntries; break; case PaletteVisualPart.SpecialFill: if (!string.IsNullOrEmpty(seriesFamily)) { brushCollection = FindCollectionByFamily(this.specialFillEntriesByFamily, seriesFamily); if (brushCollection != null) { break; } } brushCollection = this.specialFillEntries; break; default: // PaletteVisualPart.Fill if (!string.IsNullOrEmpty(seriesFamily)) { brushCollection = FindCollectionByFamily(this.fillEntriesByFamily, seriesFamily); if (brushCollection != null) { break; } } brushCollection = this.fillEntries; break; } if (index >= 0 && brushCollection.Brushes.Count > 0) { return(brushCollection.Brushes[index % brushCollection.Brushes.Count]); } return(null); }
/// <summary> /// Gets the <see cref="Brush"/> (if present) for the specified <see cref="PaletteVisualPart"/> instance at the specified index. /// </summary> /// <param name="index">The index for which to look-up a brush.</param> /// <param name="visualPart">The visual part for which a brush is required.</param> public Brush GetBrush(int index, PaletteVisualPart visualPart) { return(this.GetBrush(index, visualPart, string.Empty)); }