예제 #1
0
 /// <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);
 }
예제 #3
0
파일: Block.cs 프로젝트: beda2280/wpf-1
        private static bool IsValidLineStackingStrategy(object o)
        {
            LineStackingStrategy value = (LineStackingStrategy)o;

            return(value == LineStackingStrategy.MaxHeight ||
                   value == LineStackingStrategy.BlockLineHeight);
        }
예제 #4
0
 /// <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);
 }
예제 #6
0
 /// <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();
 }
예제 #7
0
        /// <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);
        }
예제 #8
0
 public static TTextBlock LineStackingStrategy <TTextBlock>(this TTextBlock @this, LineStackingStrategy lineStackingStrategy)
     where TTextBlock : TextBlock
 {
     @this.LineStackingStrategy = lineStackingStrategy;
     return(@this);
 }
예제 #9
0
 protected virtual void OnLineStackingStrategyChanged(DependencyPropertyChangedEventArgs e)
 {
     this.textBlock.LineStackingStrategy = (LineStackingStrategy)e.NewValue;
     this.InvalidateMeasure();
 }
예제 #10
0
        public static IntPtr Box_LineStackingStrategy(LineStackingStrategy val)
        {
            IntPtr ret = NoesisGUI_PINVOKE.Box_LineStackingStrategy((int)val);

            return(ret);
        }
예제 #11
0
        public static LineStackingStrategy Unbox_LineStackingStrategy(IntPtr val)
        {
            LineStackingStrategy ret = (LineStackingStrategy)NoesisGUI_PINVOKE.Unbox_LineStackingStrategy(val);

            return(ret);
        }
예제 #12
0
 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);
 }
예제 #13
0
        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);
 }