public override void DrawItem(Graphics graphics) { base.DrawItem(graphics); ILineDecorator lineDecorator = base.StyleDecorator as LineDecorator; if (lineDecorator != null) { throw new ArgumentException("Line is not a valid Container"); } else { IGraphicStyleDecorator style = base.StyleDecorator as GraphicStyleDecorator; if (style != null) { base.FillShape(graphics, style.Shape); BaseLine baseLine = null; if (style.BackColor == GlobalValues.DefaultBackColor) { baseLine = new BaseLine(style.ForeColor, style.DashStyle, style.Thickness); } else { baseLine = new BaseLine(style.BackColor, style.DashStyle, style.Thickness); } style.Shape.DrawShape(graphics, baseLine, style.DisplayRectangle); } Items.ForEach(item => item.DrawItem(graphics)); } }
public override void DrawItem(Graphics graphics) { if (graphics == null) { throw new ArgumentNullException("graphics"); } base.DrawItem(graphics); ILineDecorator lineDecorator = base.StyleDecorator as LineDecorator; if (lineDecorator != null) { GraphicsLineDrawer(graphics); } else { IGraphicStyleDecorator style = base.StyleDecorator as GraphicStyleDecorator; if (style != null) { base.FillShape(graphics, style.Shape); BaseLine baseLine = null; if (style.BackColor == GlobalValues.DefaultBackColor) { baseLine = new BaseLine(style.ForeColor, style.DashStyle, style.Thickness); } else { baseLine = new BaseLine(style.BackColor, style.DashStyle, style.Thickness); } style.Shape.DrawShape(graphics, baseLine, style.DisplayRectangle); } } }
/// <summary> /// Initializes a new instance of the <see cref="Indent"/> class. /// </summary> /// <param name="view">Text view to create the adornment for</param> //Ignoring warning since this adornment is always on UI thread #pragma warning disable VSTHRD010 public Indent(IWpfTextView view, ITextDocumentFactoryService textDocumentFactory) { if (view == null) { throw new ArgumentNullException(nameof(view)); } if (textDocumentFactory == null) { throw new ArgumentNullException(nameof(textDocumentFactory)); } layer = view.GetAdornmentLayer("Indent"); this.view = view; this.view.LayoutChanged += OnLayoutChanged; drawer = new BackgroundTextIndexDrawer(layer, this.view); colorGetter = new RainbowBrushGetter(OptionsManager.brushes.Get(), OptionsManager.errorBrush.Get()); validator = new IndentValidator( OptionsManager.indentSize.Get() ); bool result = textDocumentFactory.TryGetTextDocument(this.view.TextBuffer, out ITextDocument textDocument); if (result) { string filePath = textDocument.FilePath; string[] filePathSplit = filePath.Split('.'); string extension = filePathSplit[filePathSplit.Length - 1]; if (OptionsManager.fileExtensionsDictionary.Get().ContainsKey(extension)) { validator = new IndentValidator(OptionsManager.fileExtensionsDictionary.Get()[extension]); } } if (OptionsManager.highlightingMode.Get() == HighlightingMode.Alternating) { decorator = new AlternatingLineDecorator( drawer, colorGetter, validator) { detectErrors = OptionsManager.detectErrors.Get() }; } if (OptionsManager.highlightingMode.Get() == HighlightingMode.Monocolor) { decorator = new MonocolorLineDecorator( drawer, colorGetter, validator) { detectErrors = OptionsManager.detectErrors.Get() }; } }
public override void DrawItem(PdfWriter pdfWriter, ICSharpCode.Reports.Core.Exporter.ExportRenderer.PdfUnitConverter converter) { base.DrawItem(pdfWriter, converter); ILineDecorator lineDecorator = base.StyleDecorator as LineDecorator; if (lineDecorator != null) { PdfLineDrawer(); } else { // http://www.mikesdotnetting.com/Article/88/iTextSharp-Drawing-shapes-and-Graphics IGraphicStyleDecorator style = base.StyleDecorator as GraphicStyleDecorator; style.Shape.DrawShape(base.PdfWriter.DirectContent, new BaseLine(style.ForeColor, style.DashStyle, style.Thickness), style, base.ConvertToPdfRectangle()); } }
public override void DrawItem(PdfWriter pdfWriter, ICSharpCode.Reports.Core.Exporter.ExportRenderer.PdfUnitConverter converter) { base.DrawItem(pdfWriter, converter); ILineDecorator lineDecorator = base.StyleDecorator as LineDecorator; if (lineDecorator != null) { PdfLineDrawer(pdfWriter); } else { IGraphicStyleDecorator style = base.StyleDecorator as GraphicStyleDecorator; if (style != null) { style.Shape.DrawShape(base.PdfWriter.DirectContent, new BaseLine(style.ForeColor, style.DashStyle, style.Thickness), style, base.ConvertToPdfRectangle()); } } }
/// <summary> /// Initializes a new instance of the <see cref="Indent"/> class. /// </summary> /// <param name="view">Text view to create the adornment for</param> //Ignoring warning since this adornment is always on UI thread #pragma warning disable VSTHRD010 public Indent(IWpfTextView view) { if (view == null) { throw new ArgumentNullException("view"); } this.layer = view.GetAdornmentLayer("Indent"); this.view = view; this.view.LayoutChanged += this.OnLayoutChanged; this.drawer = new BackgroundTextIndexDrawer(this.layer, this.view); this.colorGetter = new RainbowBrushGetter() { brushes = OptionsManager.GetColors() }; this.validator = new IndentValidator( OptionsManager.GetIndentSize() ); this.decorator = new LineDecorator( this.drawer, this.colorGetter, this.validator ); }
public void AddDecorator(ILineDecorator decorator) { m_Decorators.Add(decorator); }