protected virtual void SetParagraphProperties(ParagraphPropertiesBase style) { if (style is CharacterPropertiesBase characterStyle) { base.SetCharacterProperties(characterStyle); } if (Alignment.HasValue) { style.Alignment = Alignment; } if (ContextualSpacing) { style.ContextualSpacing = true; } if (ResetContextualSpacing) { style.ContextualSpacing = false; } if (FirstLineIdent.HasValue) { style.FirstLineIndent = FirstLineIdent; } if (FirstLineIndentType.HasValue) { style.FirstLineIndentType = FirstLineIndentType; } if (KeepLinesTogether) { style.KeepLinesTogether = true; } if (ResetKeepLinesTogether) { style.KeepLinesTogether = false; } if (KeepWithNext) { style.KeepWithNext = true; } if (ResetKeepWithNext) { style.KeepWithNext = false; } if (LeftIndent.HasValue) { style.LeftIndent = LeftIndent; } if (LineSpacing.HasValue) { style.LineSpacing = LineSpacing; } if (LineSpacingMultiplier.HasValue) { style.LineSpacingMultiplier = LineSpacingMultiplier; } if (LineSpacingType.HasValue) { style.LineSpacingType = LineSpacingType; } if (NumberingListIndex.HasValue && style is ParagraphStyle paragraphStyle) { paragraphStyle.NumberingListIndex = NumberingListIndex.Value; } if (OutlineLevel.HasValue) { style.OutlineLevel = OutlineLevel; } if (PageBreakBefore) { style.PageBreakBefore = true; } if (ResetPageBreakBefore) { style.PageBreakBefore = false; } if (RightIndent.HasValue) { style.RightIndent = RightIndent; } if (RightToLeft) { style.RightToLeft = true; } if (ResetRightToLeft) { style.RightToLeft = false; } if (SpacingAfter.HasValue) { style.SpacingAfter = SpacingAfter; } if (SpacingBefore.HasValue) { style.SpacingBefore = SpacingBefore; } if (SuppressHyphenation) { style.SuppressHyphenation = true; } if (ResetSuppressHyphenation) { style.SuppressHyphenation = false; } if (SuppressLineNumbers) { style.SuppressLineNumbers = true; } if (ResetSuppressLineNumbers) { style.SuppressLineNumbers = false; } if (WidowOrphanControl) { style.WidowOrphanControl = true; } if (ResetWidowOrphanControl) { style.WidowOrphanControl = false; } }
protected virtual void SetParagraphOptions(ParagraphPropertiesBase style, ParagraphStyleOptions options) { if (options == null) { throw new ArgumentNullException(nameof(options), "Options are not provided."); } if (style is CharacterPropertiesBase characterStyle) { this.SetCharacterOptions(characterStyle, options); } if (options.Alignment.HasValue) { style.Alignment = (DevExpress.XtraRichEdit.API.Native.ParagraphAlignment)options.Alignment.Value; } if (options.ContextualSpacing.HasValue) { style.ContextualSpacing = options.ContextualSpacing.Value; } if (options.FirstLineIdent.HasValue) { style.FirstLineIndent = options.FirstLineIdent.Value; } if (options.FirstLineIndentType.HasValue) { style.FirstLineIndentType = (DevExpress.XtraRichEdit.API.Native.ParagraphFirstLineIndent)options.FirstLineIndentType.Value; } if (options.KeepLinesTogether.HasValue) { style.KeepLinesTogether = options.KeepLinesTogether.Value; } if (options.KeepWithNext.HasValue) { style.KeepWithNext = options.KeepWithNext.Value; } if (options.LeftIndent.HasValue) { style.LeftIndent = options.LeftIndent.Value; } if (options.LineSpacing.HasValue) { style.LineSpacing = options.LineSpacing.Value; } if (options.LineSpacingMultiplier.HasValue) { style.LineSpacingMultiplier = options.LineSpacingMultiplier.Value; } if (options.LineSpacingType.HasValue) { style.LineSpacingType = (DevExpress.XtraRichEdit.API.Native.ParagraphLineSpacing)options.LineSpacingType.Value; } if (options.NumberingListIndex.HasValue && style is ParagraphStyle paragraphStyle) { paragraphStyle.NumberingListIndex = options.NumberingListIndex.Value; } if (options.OutlineLevel.HasValue) { style.OutlineLevel = options.OutlineLevel; } if (options.PageBreakBefore.HasValue) { style.PageBreakBefore = options.PageBreakBefore.Value; } if (options.RightIndent.HasValue) { style.RightIndent = options.RightIndent.Value; } if (options.RightToLeft.HasValue) { style.RightToLeft = options.RightToLeft.Value; } if (options.SpacingAfter.HasValue) { style.SpacingAfter = options.SpacingAfter.Value; } if (options.SpacingBefore.HasValue) { style.SpacingBefore = options.SpacingBefore.Value; } if (options.SuppressHyphenation.HasValue) { style.SuppressHyphenation = options.SuppressHyphenation.Value; } if (options.SuppressLineNumbers.HasValue) { style.SuppressLineNumbers = options.SuppressLineNumbers.Value; } if (options.WidowOrphanControl.HasValue) { style.WidowOrphanControl = options.WidowOrphanControl.Value; } }