/// <summary> /// Builds a new layout with the specified parameters. /// </summary> public LayoutBuilder( Java.Lang.ICharSequence textFormatted, TextPaint paint, TextUtils.TruncateAt ellipsize, Android.Text.Layout.Alignment layoutAlignment, TextWrapping textWrapping, int maxLines, Size availableSize, bool exactWidth, float lineHeight, LineStackingStrategy lineStackingStrategy, LayoutBuilder existingBuilder ) { _textFormatted = textFormatted; _paint = paint; _ellipsize = ellipsize; _layoutAlignment = layoutAlignment; _textWrapping = textWrapping; _maxLines = maxLines; AvailableSize = availableSize; _exactWidth = exactWidth; _lineHeight = lineHeight; _lineStackingStrategy = lineStackingStrategy; Layout = existingBuilder?.Layout; _metrics = existingBuilder?._metrics; }
// Token: 0x06006661 RID: 26209 RVA: 0x001CC214 File Offset: 0x001CA414 internal double CalcLineAdvanceForTextParagraph(TextParagraph textParagraph, int dcp, double lineAdvance) { if (!DoubleUtil.IsNaN(this._lineHeight)) { LineStackingStrategy lineStackingStrategy = this.LineStackingStrategy; if (lineStackingStrategy != LineStackingStrategy.BlockLineHeight) { if (lineStackingStrategy != LineStackingStrategy.MaxHeight) { } if (dcp == 0 && textParagraph.HasFiguresOrFloaters() && textParagraph.GetLastDcpAttachedObjectBeforeLine(0) + textParagraph.ParagraphStartCharacterPosition == textParagraph.ParagraphEndCharacterPosition) { lineAdvance = this._lineHeight; } else { lineAdvance = Math.Max(lineAdvance, this._lineHeight); } } else { lineAdvance = this._lineHeight; } } return(lineAdvance); }
private static bool IsValidLineStackingStrategy(object o) { LineStackingStrategy value = (LineStackingStrategy)o; return(value == LineStackingStrategy.MaxHeight || value == LineStackingStrategy.BlockLineHeight); }
/// <summary>Sets the value of the <see cref="P:System.Windows.Documents.Block.LineStackingStrategy" /> attached property on a specified dependency object.</summary> /// <param name="element">The dependency object on which to set the value of the <see cref="P:System.Windows.Documents.Block.LineStackingStrategy" /> property.</param> /// <param name="value">The new value to set the property to.</param> /// <exception cref="T:System.ArgumentNullException"> /// <paramref name="element" /> is <see langword="null" />.</exception> // Token: 0x06002AF5 RID: 10997 RVA: 0x000C3EB0 File Offset: 0x000C20B0 public static void SetLineStackingStrategy(DependencyObject element, LineStackingStrategy value) { if (element == null) { throw new ArgumentNullException("element"); } element.SetValue(Block.LineStackingStrategyProperty, value); }
// Token: 0x06006662 RID: 26210 RVA: 0x001CC284 File Offset: 0x001CA484 internal double CalcLineAdvance(double lineAdvance) { if (!DoubleUtil.IsNaN(this._lineHeight)) { LineStackingStrategy lineStackingStrategy = this.LineStackingStrategy; if (lineStackingStrategy != LineStackingStrategy.BlockLineHeight) { if (lineStackingStrategy != LineStackingStrategy.MaxHeight) { } lineAdvance = Math.Max(lineAdvance, this._lineHeight); } else { lineAdvance = this._lineHeight; } } return(lineAdvance); }
/// <summary> /// Called when the <see cref="E:LineStackingStrategyChanged" /> event occurs. /// </summary> /// <param name="e">The <see cref="DependencyPropertyChangedEventArgs"/> instance containing the event data.</param> protected virtual void OnLineStackingStrategyChanged(DependencyPropertyChangedEventArgs e) { this.textBlock.LineStackingStrategy = (LineStackingStrategy)e.NewValue; this.InvalidateMeasure(); }
/// <summary> /// DependencyProperty setter for <see cref="LineStackingStrategy" /> property. /// </summary> /// <param name="element">The element to which to write the attached property.</param> /// <param name="value">The property value to set</param> public static void SetLineStackingStrategy(DependencyObject element, LineStackingStrategy value) { if (element == null) { throw new ArgumentNullException("element"); } element.SetValue(LineStackingStrategyProperty, value); }
public static TTextBlock LineStackingStrategy <TTextBlock>(this TTextBlock @this, LineStackingStrategy lineStackingStrategy) where TTextBlock : TextBlock { @this.LineStackingStrategy = lineStackingStrategy; return(@this); }
protected virtual void OnLineStackingStrategyChanged(DependencyPropertyChangedEventArgs e) { this.textBlock.LineStackingStrategy = (LineStackingStrategy)e.NewValue; this.InvalidateMeasure(); }
public static IntPtr Box_LineStackingStrategy(LineStackingStrategy val) { IntPtr ret = NoesisGUI_PINVOKE.Box_LineStackingStrategy((int)val); return(ret); }
public static LineStackingStrategy Unbox_LineStackingStrategy(IntPtr val) { LineStackingStrategy ret = (LineStackingStrategy)NoesisGUI_PINVOKE.Unbox_LineStackingStrategy(val); return(ret); }
public void Layout(TextAlignment alignment, TextWrapping wrapping, TextTrimming trimming, float maxWidth, float maxHeight, float lineHeight, LineStackingStrategy lineStacking) { NoesisGUI_PINVOKE.FormattedText_Layout(swigCPtr, (int)alignment, (int)wrapping, (int)trimming, maxWidth, maxHeight, lineHeight, (int)lineStacking); }
public Size Measure(TextAlignment alignment, TextWrapping wrapping, TextTrimming trimming, float maxWidth, float maxHeight, float lineHeight, LineStackingStrategy lineStacking) { IntPtr ret = NoesisGUI_PINVOKE.FormattedText_Measure(swigCPtr, (int)alignment, (int)wrapping, (int)trimming, maxWidth, maxHeight, lineHeight, (int)lineStacking); if (ret != IntPtr.Zero) { return(Marshal.PtrToStructure <Size>(ret)); } else { return(new Size()); } }
public static double MeasureHeight(double width, string text, FontFamily fontFamily, double fontSize, double lineHeight, LineStackingStrategy lineStackingStrategy, TextWrapping textWrapping, Thickness margin) { ((FrameworkElement)TextBlockMeasurementHelper._textBlock).Width = width; TextBlockMeasurementHelper._textBlock.Text = text; TextBlockMeasurementHelper._textBlock.FontFamily = fontFamily; TextBlockMeasurementHelper._textBlock.FontSize = fontSize; TextBlockMeasurementHelper._textBlock.LineHeight = lineHeight; TextBlockMeasurementHelper._textBlock.LineStackingStrategy = lineStackingStrategy; TextBlockMeasurementHelper._textBlock.TextWrapping = textWrapping; // ISSUE: explicit reference operation // ISSUE: explicit reference operation return(((FrameworkElement)TextBlockMeasurementHelper._textBlock).ActualHeight + ((Thickness)@margin).Top + ((Thickness)@margin).Bottom); }