Table of Contents

Class FragmentEditingExtensions

Namespace
DocWright.Dom.Editing
Assembly
DocWright.Dom.dll

Formatted content copied out of a span and inserted at a position, as Word's copy and paste (keep source formatting) do (WQ-0095): each insertion one DocumentEdit that undo takes back exactly, definitions it added included.

public static class FragmentEditingExtensions
Inheritance
FragmentEditingExtensions
Inherited Members

Remarks

A fragment carries only the definitions its content uses (styles with their based-on chain, lists, notes, media, link targets). Inserted, a style or list the destination already defines under the same id takes the destination's definition, as Word's paste does; the others are added. A bookmark whose name the destination already has is dropped from the inserted copy.

A paragraph's properties travel with its mark: the destination splits at the position, the fragment's first paragraph joins the first half (its properties win when its mark is part of the fragment), a last paragraph without its mark joins the second half, and the paragraphs between go in whole. A fragment's sections are flattened: their breaks do not travel.

Methods

ExtractFragment(WordDocument, DocumentSpan)

Copies the content of a span into a fragment.

InsertFragment(WordDocument, DocumentPosition, DocumentFragment)

Inserts a fragment at a position, as Word pastes with the source formatting kept.