Esempio n. 1
0
        private void AdjustPadding()
        {
            Thickness thickness = this.ComputePageMargin((FlowDocumentScrollViewerElement)this.TextSource);

            thickness = new Thickness(RichTextBoxEditProxyBase.AdjustPaddingByOffset(thickness.Left, -1.0), RichTextBoxEditProxyBase.AdjustPaddingByOffset(thickness.Top, -1.0), RichTextBoxEditProxyBase.AdjustPaddingByOffset(thickness.Right, -1.0), RichTextBoxEditProxyBase.AdjustPaddingByOffset(thickness.Bottom, -1.0));
            this.RichTextBox.Document.PagePadding = thickness;
        }
Esempio n. 2
0
        private void AdjustPadding()
        {
            Thickness thickness = (Thickness)this.TextSource.GetComputedValueAsWpf(TextBlockElement.PaddingProperty);

            thickness = new Thickness(RichTextBoxEditProxyBase.AdjustPaddingByOffset(thickness.Left, 0.0), RichTextBoxEditProxyBase.AdjustPaddingByOffset(thickness.Top, 0.0), RichTextBoxEditProxyBase.AdjustPaddingByOffset(thickness.Right, -1.0), RichTextBoxEditProxyBase.AdjustPaddingByOffset(thickness.Bottom, -1.0));
            this.RichTextBox.Padding                       = thickness;
            this.RichTextBox.BorderThickness               = new Thickness(0.0);
            this.RichTextBox.Document.PagePadding          = new Thickness(0.0);
            this.RichTextBox.Document.LineStackingStrategy = (LineStackingStrategy)this.TextSource.GetComputedValueAsWpf(TextBlockElement.LineStackingStrategyProperty);
            double num = (double)this.TextSource.GetComputedValue(TextBlockElement.LineHeightProperty);

            if (FlowDocument.LineHeightProperty.IsValidValue((object)num))
            {
                this.RichTextBox.Document.LineHeight = num;
            }
            Style style = new Style(typeof(Paragraph));

            style.Setters.Add((SetterBase) new Setter(Block.MarginProperty, (object)new Thickness(0.0)));
            style.Seal();
            ((FrameworkElement)this.RichTextBox.PlatformSpecificObject).Resources.Add((object)typeof(Paragraph), (object)style);
        }