แก้ไข

แชร์ผ่าน


StoryBreak Class

Definition

Identifies the start or end of story composed of one or more StoryFragment elements.

public ref class StoryBreak : System::Windows::Documents::DocumentStructures::BlockElement
public class StoryBreak : System.Windows.Documents.DocumentStructures.BlockElement
type StoryBreak = class
    inherit BlockElement
Public Class StoryBreak
Inherits BlockElement
Inheritance
StoryBreak

Remarks

A StoryBreak can only be a child element of a StoryFragment. Additionally, a StoryBreak can only be the first child, last child, or both the first and last child elements in a StoryFragment. The location of the StoryBreak element in a StoryFragment indicates if the story is contained in additional fragments, and if the additional fragments either precede or follow the current fragment.

A StoryBreak as the first element in a StoryFragment indicates the start of a story.

<!-- Fragment 1 -->  
<StoryFragment>  
  <StoryBreak />   <!-- Identifies the start of a story when          -->  
                   <!-- immediately after an opening <StoryFragment>. -->  
  <ParagraphStructure>  
    <NamedElement NameReference="a" />  
    <NamedElement NameReference="b" />  
  </ParagraphStructure>  
</StoryFragment>   <!-- Story continues in the next <StoryFragment>.  -->  

A StoryBreak as the last element in a StoryFragment indicates the end of a story.

<!-- Fragment 2 -->  
<StoryFragment>    <!-- Story continued from prior <StoryFragment>.    -->  
  <ParagraphStructure>    
    <NamedElement NameReference="c" />  
  </ParagraphStructure>  
  <StoryBreak />   <!-- Identifies the end of a story when             -->  
                   <!-- immediately before a closing </StoryFragment>. -->  
</StoryFragment>  

A story that is contained in a single StoryFragment will have two StoryBreak elements as the first and last child elements of the fragment.

<!-- Fragments 1 and 2 Merged -->  
<ParagraphStructure>  
  <NamedElement NameReference="a" />  
  <NamedElement NameReference="b" />  
  <NamedElement NameReference="c" />  
</ParagraphStructure>  

StoryFragment elements that are entirely contained on one page will start and end with StoryBreak elements since the content is completely contained in a single fragment.

The position of StoryBreak elements in a StoryFragment is useful when you want to access content in either forward or reverse direction in the document. For example when merging fragments in forward order, a StoryFragment that ends with a StoryBreak indicates the end of the story and that there are no more fragments to merge. Similarly when merging story fragments in reverse order, a StoryFragment that starts with a StoryBreak indicates the start of the story and that there are no prior fragments to merge.

The ability to process story fragments in either forward or reverse directions is important for many application uses. For example, a paragraph that spans page breaks is divided into multiple story fragments, one fragment for each page. A user interface that provides a triple-click feature to select and copy a whole paragraph to the clipboard must be able to merge multiple story fragments when a paragraph spans multiple pages. Additionally if the user triple-clicks on part of a paragraph that starts on the first page, the application must identify that the StoryFragment starts with a StoryBreak but does not end with a StoryBreak. This would indicate that the StoryFragment that is contained on the next page must be loaded and added to the end of the current fragment. Similarly if the user triple-clicks on part of the paragraph located on the last page, the application must identify that the StoryFragment ends with a StoryBreak but does not begin with a StoryBreak. This would indicate that the StoryFragment that is contained on previous page must be loaded and added to the start of the current fragment. The application should also be able to process both forward and reverse directions for the case of large paragraphs that span three or more pages and where the user's selection point is on an inner page.

Since a StoryFragment is limited to a single page, the use of StoryBreak elements allow each StoryFragment to contain well-formed XML but still have a hierarchical structure across an entire document.

Constructors

StoryBreak()

Initializes a new instance of the StoryBreak class.

Methods

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to