// Token: 0x06003AFE RID: 15102 RVA: 0x0010A744 File Offset: 0x00108944 internal virtual void ApplyPropertyToTextVirtual(DependencyProperty formattingProperty, object value, bool applyToParagraphs, PropertyValueAction propertyValueAction) { TextRangeBase.BeginChange(this); try { for (int i = 0; i < this._textSegments.Count; i++) { TextSegment textSegment = this._textSegments[i]; if (formattingProperty == FrameworkElement.FlowDirectionProperty) { if (applyToParagraphs || this.IsEmpty || TextRangeBase.IsParagraphBoundaryCrossed(this)) { TextRangeEdit.SetParagraphProperty((TextPointer)textSegment.Start, (TextPointer)textSegment.End, formattingProperty, value, propertyValueAction); } else { TextRangeEdit.SetInlineProperty((TextPointer)textSegment.Start, (TextPointer)textSegment.End, formattingProperty, value, propertyValueAction); } } else if (TextSchema.IsCharacterProperty(formattingProperty)) { TextRangeEdit.SetInlineProperty((TextPointer)textSegment.Start, (TextPointer)textSegment.End, formattingProperty, value, propertyValueAction); } else if (TextSchema.IsParagraphProperty(formattingProperty)) { if (formattingProperty.PropertyType == typeof(Thickness) && (FlowDirection)textSegment.Start.GetValue(Block.FlowDirectionProperty) == FlowDirection.RightToLeft) { value = new Thickness(((Thickness)value).Right, ((Thickness)value).Top, ((Thickness)value).Left, ((Thickness)value).Bottom); } TextRangeEdit.SetParagraphProperty((TextPointer)textSegment.Start, (TextPointer)textSegment.End, formattingProperty, value, propertyValueAction); } } } finally { TextRangeBase.EndChange(this); } }