private static void DecreaseIndentation(TextSelection thisSelection, ListItem parentListItem, ListItem immediateListItem) { if (immediateListItem != null) { TextRangeEditLists.UnindentListItems(thisSelection); } else if (parentListItem != null) { TextRangeEditLists.ConvertParagraphsToListItems(thisSelection, TextMarkerStyle.Disc); TextRangeEditLists.UnindentListItems(thisSelection); } else { if (thisSelection.IsEmpty) { // When selection is empty, handle indentation based on current TextIndent property of the paragraph. Block paragraphOrBlockUIContainer = thisSelection.Start.ParagraphOrBlockUIContainer; if (paragraphOrBlockUIContainer is BlockUIContainer) { // Decrement BlockUIContainer's leading margin. TextRangeEdit.IncrementParagraphLeadingMargin(thisSelection, /*increment:*/ 20, PropertyValueAction.DecreaseByAbsoluteValue); } else { // Create implicit paragraph if at a potential paragraph position, such as empty FlowDocument, TableCell. CreateImplicitParagraphIfNeededAndUpdateSelection(thisSelection); Paragraph paragraph = thisSelection.Start.Paragraph; Invariant.Assert(paragraph != null, "EnsureInsertionPosition must guarantee a position in text content"); // When selection is empty, handle indentation based on current TextIndent property of the paragraph. if (paragraph.TextIndent > 20) { // Reset text indent to 20. TextRangeEdit.SetParagraphProperty(thisSelection.Start, thisSelection.End, Paragraph.TextIndentProperty, 20.0, PropertyValueAction.SetValue); } else if (paragraph.TextIndent > 0) { // Reset text indent to 0. TextRangeEdit.SetParagraphProperty(thisSelection.Start, thisSelection.End, Paragraph.TextIndentProperty, 0.0, PropertyValueAction.SetValue); } else { // Decrement paragraph leading margin. TextRangeEdit.IncrementParagraphLeadingMargin(thisSelection, /*increment:*/ 20, PropertyValueAction.DecreaseByAbsoluteValue); } } } else { // For non-empty selection, always decrement paragraph margin. TextRangeEdit.IncrementParagraphLeadingMargin(thisSelection, /*increment:*/ 20, PropertyValueAction.DecreaseByAbsoluteValue); } } }
// Token: 0x06003878 RID: 14456 RVA: 0x000FCFC8 File Offset: 0x000FB1C8 private static void DecreaseIndentation(TextSelection thisSelection, ListItem parentListItem, ListItem immediateListItem) { if (immediateListItem != null) { TextRangeEditLists.UnindentListItems(thisSelection); return; } if (parentListItem != null) { TextRangeEditLists.ConvertParagraphsToListItems(thisSelection, TextMarkerStyle.Disc); TextRangeEditLists.UnindentListItems(thisSelection); return; } if (!thisSelection.IsEmpty) { TextRangeEdit.IncrementParagraphLeadingMargin(thisSelection, 20.0, PropertyValueAction.DecreaseByAbsoluteValue); return; } Block paragraphOrBlockUIContainer = thisSelection.Start.ParagraphOrBlockUIContainer; if (paragraphOrBlockUIContainer is BlockUIContainer) { TextRangeEdit.IncrementParagraphLeadingMargin(thisSelection, 20.0, PropertyValueAction.DecreaseByAbsoluteValue); return; } TextEditorLists.CreateImplicitParagraphIfNeededAndUpdateSelection(thisSelection); Paragraph paragraph = thisSelection.Start.Paragraph; Invariant.Assert(paragraph != null, "EnsureInsertionPosition must guarantee a position in text content"); if (paragraph.TextIndent > 20.0) { TextRangeEdit.SetParagraphProperty(thisSelection.Start, thisSelection.End, Paragraph.TextIndentProperty, 20.0, PropertyValueAction.SetValue); return; } if (paragraph.TextIndent > 0.0) { TextRangeEdit.SetParagraphProperty(thisSelection.Start, thisSelection.End, Paragraph.TextIndentProperty, 0.0, PropertyValueAction.SetValue); return; } TextRangeEdit.IncrementParagraphLeadingMargin(thisSelection, 20.0, PropertyValueAction.DecreaseByAbsoluteValue); }