StoryFragment 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
XPS 문서 내의 텍스트 영역 전체 또는 일부를 나타냅니다.
public ref class StoryFragment
public ref class StoryFragment : System::Collections::Generic::IEnumerable<System::Windows::Documents::DocumentStructures::BlockElement ^>, System::Windows::Markup::IAddChild
public class StoryFragment
[System.Windows.Markup.ContentProperty("BlockElementList")]
public class StoryFragment : System.Collections.Generic.IEnumerable<System.Windows.Documents.DocumentStructures.BlockElement>, System.Windows.Markup.IAddChild
type StoryFragment = class
interface IAddChild
[<System.Windows.Markup.ContentProperty("BlockElementList")>]
type StoryFragment = class
interface IAddChild
interface seq<BlockElement>
interface IEnumerable
[<System.Windows.Markup.ContentProperty("BlockElementList")>]
type StoryFragment = class
interface seq<BlockElement>
interface IEnumerable
interface IAddChild
Public Class StoryFragment
Public Class StoryFragment
Implements IAddChild, IEnumerable(Of BlockElement)
- 상속
-
StoryFragment
- 특성
- 구현
예제
다음 예제에서는 XPS(XML Paper Specification) 문서의 일부를 보여 <StoryFragment> 줍니다.
<StoryFragment StoryName="DocumentBody" FragmentType="Content">
<SectionStructure>
<ParagraphStructure>
<NamedElement NameReference="Pg1Heading1" />
</ParagraphStructure>
<ParagraphStructure>
<NamedElement NameReference="Pg1P1" />
</ParagraphStructure>
<ParagraphStructure>
<NamedElement NameReference="Pg1P2" />
</ParagraphStructure>
<ParagraphStructure>
<NamedElement NameReference="Pg1P3" />
</ParagraphStructure>
<ParagraphStructure>
<NamedElement NameReference="Pg1P4" />
</ParagraphStructure>
<ParagraphStructure>
<NamedElement NameReference="Pg1P5" />
</ParagraphStructure>
<ParagraphStructure>
<NamedElement NameReference="Pg1Heading2" />
</ParagraphStructure>
<ParagraphStructure>
<NamedElement NameReference="Pg1P6" />
</ParagraphStructure>
<ParagraphStructure>
<NamedElement NameReference="Pg1P7" />
</ParagraphStructure>
<TableStructure>
<TableRowGroupStructure>
<TableRowStructure>
<TableCellStructure>
<ParagraphStructure>
<NamedElement NameReference="R1C1P1" />
</ParagraphStructure>
</TableCellStructure>
<TableCellStructure>
<ParagraphStructure>
<NamedElement NameReference="R1C2P1" />
</ParagraphStructure>
</TableCellStructure>
</TableRowStructure>
<TableRowStructure>
<TableCellStructure>
<ParagraphStructure>
<NamedElement NameReference="R2C1P1" />
</ParagraphStructure>
</TableCellStructure>
<TableCellStructure>
<ParagraphStructure>
<NamedElement NameReference="R2C2P1" />
</ParagraphStructure>
<ParagraphStructure>
<NamedElement NameReference="R2C2P2" />
</ParagraphStructure>
</TableCellStructure>
</TableRowStructure>
<TableRowStructure>
<TableCellStructure>
<ParagraphStructure>
<NamedElement NameReference="R3C1P1" />
</ParagraphStructure>
</TableCellStructure>
<TableCellStructure>
<ParagraphStructure>
<NamedElement NameReference="R3C2P1" />
</ParagraphStructure>
</TableCellStructure>
</TableRowStructure>
<TableRowStructure>
<TableCellStructure>
<ParagraphStructure>
<NamedElement NameReference="R4C1P1" />
</ParagraphStructure>
</TableCellStructure>
<TableCellStructure>
<ParagraphStructure>
<NamedElement NameReference="R4C2P1" />
</ParagraphStructure>
</TableCellStructure>
</TableRowStructure>
<TableRowStructure>
<TableCellStructure>
<ParagraphStructure>
<NamedElement NameReference="R5C1P1" />
</ParagraphStructure>
</TableCellStructure>
<TableCellStructure>
<ParagraphStructure>
<NamedElement NameReference="R5C2P1" />
</ParagraphStructure>
</TableCellStructure>
</TableRowStructure>
</TableRowGroupStructure>
</TableStructure>
</SectionStructure>
</StoryFragment>
설명
XPS 문서의 XPS 이야기는 신문이나 잡지의 이야기와 거의 비슷합니다. 일반적으로 단일 XPS 문서 내에서 단일 항목에 대한 텍스트 및 그래픽 콘텐츠의 구절입니다. 일반적으로 여러 페이지에 걸쳐 있지만 잡지의 사이드바(박스형 스토리)와 같은 페이지보다 짧을 수 있습니다. 이야기는 4페이지에서 계속되는 첫 페이지 신문 기사처럼 불연속적일 수도 있습니다. 따라서 지정된 페이지에는 둘 이상의 스토리와 둘 이상의 스토리 부분이 있을 수 있습니다. 머리글 또는 바닥글은 단일 페이지에 완전히 포함된 특수한 종류의 스토리이기도 합니다.
A StoryFragment 는 스토리의 전체 또는 일부를 나타냅니다. 둘 이상의 페이지에 걸쳐서는 안 되지만 페이지 전체를 차지하거나 다른 조각과 페이지를 공유할 수 있습니다. 스토리가 둘 이상의 페이지에 있는 경우 각 페이지의 각 부분은 별도의 조각입니다. 스토리에는 불연속 조각 집합이 있을 수 있지만, 어떤 조각도 불연속적일 수 없습니다.
요소만 . StoryFragments 의 StoryFragment부모일 수 있습니다. 요소 내 StoryBreak 의 StoryFragment 위치는 스토리가 여러 조각에 포함되어 있는지 여부와 추가 조각이 현재 조각 앞에 있거나 뒤에 오는지 여부를 나타냅니다.
StoryFragment 일부 구조 요소의 중간에 끝나는 경우, 예를 들어 <TableRowGroupStructure>XPS 문서 생성 애플리케이션은 이후 조각에서 구조가 계속되더라도 태그 앞에 </TableRowGroupStructure> 요소(이 경우</StoryFragment>)에 적절한 끝 태그를 삽입해야 합니다. (이 값은 요소 트리 내 StoryFragment 의 XML이 유효한지 확인하는 데 필요합니다.) 스토리를 계속하는 조각은 중단된 구조에 대한 여는 태그로 시작해야 합니다. 중단된 구조체의 전체 트리는 동일한 방식으로 처리되어야 합니다(한 가지 예외는 아래 설명됨). 중단 지점 위의 타의 추종을 불허하는 모든 시작 태그에 대해 끝 태그를 추가해야 합니다.
예외는 스토리 중단이 태그 바로 뒤에 </TableCellStructure> 올 때 적용되며, 생성 애플리케이션은 스토리를 계속하는 조각의 해당 지점에 빈 테이블 셀 구조(<TableCellStructure></TableCellStructure>)를 삽입해야 합니다. 지정된 스토리의 모든 조각을 병합해야 하는 애플리케이션을 사용하는 경우 간단한 알고리즘을 사용하여 이 작업을 수행할 수 있도록 이 작업이 필요합니다.
예를 들어 애플리케이션에서 XPS 문서에 다음 자료를 추가하려고 했습니다.
<SectionStructure>
<TableStructure>
<TableRowGroupStructure>
<TableRowStructure>
<TableCellStructure>
<ParagraphStructure>
<NamedElement NameReference="SomeContent" />
</ParagraphStructure>
</TableCellStructure>
<TableCellStructure>
<ParagraphStructure>
<NamedElement NameReference="MoreContent" />
</ParagraphStructure>
</TableCellStructure>
</TableRowStructure>
<TableRowStructure>
<TableCellStructure>
<ParagraphStructure>
<NamedElement NameReference="EvenMoreContent" />
</ParagraphStructure>
</TableCellStructure>
<TableCellStructure>
<ParagraphStructure>
<NamedElement NameReference="LastContent" />
</ParagraphStructure>
</TableCellStructure>
</TableRowStructure>
</TableRowGroupStructure>
</TableStructure>
</SectionStructure>
페이지 나누기가 "SomeContent"에 대한 바로 뒤 </TableCellStructure> 의 조각에 강제로 끝나는 경우 애플리케이션은 다음 예제와 같이 분할을 만들어야 합니다.
<StoryFragment StoryName="MyStory" FragmentType="Content">
<SectionStructure>
<TableStructure>
<TableRowGroupStructure>
<TableRowStructure>
<TableCellStructure>
<ParagraphStructure>
<NamedElement NameReference="SomeContent" />
</ParagraphStructure>
</TableCellStructure>
<!-- lines from here to end of fragment added by producer-->
</TableRowStructure>
</TableRowGroupStructure>
</TableStructure>
</SectionStructure>
</StoryFragment>
<StoryFragment StoryName="MyStory" FragmentType="Content">
<SectionStructure>
<TableStructure>
<TableRowGroupStructure>
<TableRowStructure>
<TableCellStructure>
<!-- extra cell added by producer-->
</TableCellStructure>
<!-- lines from here to start of fragment added by producer-->
<TableCellStructure>
<ParagraphStructure>
<NamedElement NameReference="MoreContent" />
</ParagraphStructure>
</TableCellStructure>
</TableRowStructure>
<TableRowStructure>
<TableCellStructure>
<ParagraphStructure>
<NamedElement NameReference="EvenMoreContent" />
</ParagraphStructure>
</TableCellStructure>
<TableCellStructure>
<ParagraphStructure>
<NamedElement NameReference="LastContent" />
</ParagraphStructure>
</TableCellStructure>
</TableRowStructure>
</TableRowGroupStructure>
</TableStructure>
</SectionStructure>
</StoryFragment>
문서를 읽는 애플리케이션은 이 콘텐츠를 병합해야 할 수 있습니다. 예를 들어 전체 스토리를 클립보드로 복사 단추가 있는 XPS 뷰어를 고려합니다. 또는 음성 신시사이저에 스토리를 전달한 블라인드 애플리케이션용 XPS 입니다. 문서를 읽는 일부 애플리케이션은 스토리 조각의 하위 집합을 병합해야 할 수 있습니다. 예를 들어 전체 단락을 세 번 클릭하여 클립보드에 복사하는 기능은 단락이 페이지 나누기에 걸쳐 있을 때마다 병합을 수행해야 합니다. 이러한 단락은 두 StoryFragment단락으로 분할되기 때문입니다.
병합하려면 다음 알고리즘을 사용합니다.
</StoryFragment>병합할 첫 번째 조각의 끝에서 삭제하고 두 번째 조각의 시작 부분에서 삭제<StoryFragment>합니다.첫 번째 조각의 마지막 닫는 태그가 두 번째 조각의 첫 번째 여는 태그와 동일한 형식인 경우(태그가 아님
<NamedElement>) 둘 다 삭제합니다.두 조각이 다음 상태 중 하나에 오를 때까지 2단계를 반복합니다.
- 선행 조각의 마지막 끝 태그 사이에 후행 조각의 첫 번째 시작 태그 사이에는 더 이상 형식 일치가 없습니다.
- 후행 조각의 첫 번째 시작 태그인 선행 조각의 마지막 끝 태그는 모두
<NamedElement>태그입니다.
위의 예제에서 생성 애플리케이션에서 빈 셀을 추가하지 않은 경우 조각의 병합은 첫 번째 행에 두 개의 셀이 있는 원래 첫 번째 행 대신 "SomeContent" 및 "MoreContent" 참조를 모두 포함하는 셀이 하나만 있는 테이블을 생성합니다.
전체 스토리가 병합되는 경우 동일한 스토리의 일부인 각 후속 조각에 대해 알고리즘을 반복해야 합니다. 스토리에 속하는 조각은 요소에 <Story> 인덱싱됩니다.
XPS: 사양 및 라이선스 다운로드에서 얻을 수 있는 XPS(XML Paper Specification) 사양의 섹션 9.1.15를 참조하세요. 지정된 스토리의 마지막 조각에는 요소가 마지막 자식으로 있습니다 StoryBreak .
생성자
| Name | Description |
|---|---|
| StoryFragment() |
StoryFragment 클래스의 새 인스턴스를 초기화합니다. |
속성
| Name | Description |
|---|---|
| FragmentName |
스토리 조각의 이름을 가져오거나 설정합니다. |
| FragmentType |
조각의 형식을 가져오거나 설정합니다. |
| StoryName |
스토리의 이름을 가져오거나 설정합니다. |
메서드
| Name | Description |
|---|---|
| Add(BlockElement) |
스토리 조각에 블록을 추가합니다. |
| Equals(Object) |
지정된 개체가 현재 개체와 같은지 여부를 확인합니다. (다음에서 상속됨 Object) |
| GetHashCode() |
기본 해시 함수로 사용됩니다. (다음에서 상속됨 Object) |
| GetType() |
현재 인스턴스의 Type 가져옵니다. (다음에서 상속됨 Object) |
| MemberwiseClone() |
현재 Object단순 복사본을 만듭니다. (다음에서 상속됨 Object) |
| ToString() |
현재 개체를 나타내는 문자열을 반환합니다. (다음에서 상속됨 Object) |
명시적 인터페이스 구현
| Name | Description |
|---|---|
| IAddChild.AddChild(Object) |
이 멤버는 .NET Framework 인프라를 지원하며 코드에서 직접 사용할 수 없습니다. |
| IAddChild.AddText(String) |
개체에 노드의 텍스트 내용을 추가합니다. |
| IEnumerable.GetEnumerator() |
이 메서드는 구현되지 않았습니다. |
| IEnumerable<BlockElement>.GetEnumerator() |
이 메서드는 구현되지 않았습니다. |