StoryBreak 类

定义

标识由一个或多个 StoryFragment 元素组成的文章的开头或结尾。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
继承
StoryBreak

注解

只能是的子元素StoryFragmentStoryBreakA StoryBreak can only be a child element of a StoryFragment. 此外, StoryBreak只能是StoryFragment中的第一个子元素、最后一个子元素或第一个和最后一个子元素。Additionally, a StoryBreak can only be the first child, last child, or both the first and last child elements in a StoryFragment. 中元素StoryBreak的位置指示该情景是否包含在其他片段中,以及在当前片段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.

作为中第一个元素的, 用于指示情景的开头。StoryFragment StoryBreakA 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>.  -->  

作为中最后一个元素的,指示故事结束。StoryFragment StoryBreakA 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>  

单个StoryFragment包含在一个中的情景将具有两个StoryBreak元素作为片段的第一个和最后一个子元素。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完全包含在一页上的元素将以StoryBreak元素开头和结尾, 因为内容完全包含在单个片段中。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.

当您想StoryBreak要在文档StoryFragment中的正向或反向访问内容时, 中元素的位置很有用。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. 例如, 在按前序合并片段时, StoryFragment以结尾StoryBreak的表示情景结尾, 且没有其他要合并的片段。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. 同样, 如果按相反的顺序合并故事片段StoryFragment , 则以开头StoryBreak的表示情景的开头, 并且没有之前要合并的片段。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. 此外, 如果用户在第一页开始的段落中三次单击, 则应用程序必须标识StoryFragment StoryBreak以开头但不以StoryBreak结尾的。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. 这会指示必须加载StoryFragment下一页中包含的, 并将其添加到当前片段的末尾。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. 同样, 如果用户三次单击位于最后一页上的部分, 应用程序必须确定StoryFragment以结尾StoryBreak , 但不以开头StoryBreakSimilarly 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. 这会指示必须加载StoryFragment上一页中包含的, 并将其添加到当前片段的开头。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.

由于仅限于单个页面, 因此StoryBreak使用元素可以使每个StoryFragment元素都包含格式正确的 XML, 但仍在整个文档中具有层次结构。 StoryFragmentSince 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.

构造函数

StoryBreak()

初始化 StoryBreak 类的新实例。Initializes a new instance of the StoryBreak class.

方法

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)

适用于