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
- 属性
- 実装
例
次の例は、 <StoryFragment>
XML Paper Specification (XPS) ドキュメントの一部を示しています。
<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 ページ目に続くフロント ページの新聞記事のように、ストーリーは不連続になる場合もあります。 したがって、1 つのページに複数のストーリーと複数のストーリーの一部を含めることができます。 ヘッダーまたはフッターは、1 つのページに完全に含まれる特別な種類のストーリーでもあります。
は StoryFragment 、ストーリーのすべてまたは一部を表します。 複数のページにまたがることは決してできませんが、ページ全体を占有したり、ページを他のフラグメントと共有したりできます。 ストーリーが複数のページにある場合、各ページのストーリーの各部分は個別のフラグメントになります。 ストーリーは不連続なフラグメントのセットを持つことができますが、フラグメント自体は不連続である可能性はありません。
StoryFragments要素のみを の親にすることができますStoryFragment。 内StoryFragmentの要素のStoryBreak場所は、ストーリーが複数のフラグメントに含まれているかどうか、および追加のフラグメントが現在のフラグメントの前または後にあるかどうかを示します。
StoryFragmentが構造要素の途中で終了する場合 (たとえば<TableRowGroupStructure>
、 など)、XPS ドキュメント生成アプリケーションは、後のフラグメントで構造が継続されている場合でも、要素の適切な終了タグ (この場合</TableRowGroupStructure>
は ) をタグの前</StoryFragment>
に挿入する必要があります。 (これは、 内 StoryFragment の要素ツリーが有効な XML であることを確認するために必要です)。ストーリーを続けるフラグメントは、中断された構造体の開始タグで始まる必要があります。 中断された構造体のツリー全体を同じ方法で処理する必要があります (1 つの例外を除き、以下で説明します)。中断ポイントの上に、一致しない開始タグごとに終了タグを追加する必要があります。
例外は、ストーリーの中断がタグの直後 </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>
ドキュメントを読み取るアプリケーションでは、このコンテンツをマージする必要がある場合があります。 たとえば、[ Copy Whole Story to Clipboard]\(ストーリー全体をクリップボードにコピー \) ボタンを含む XPS ビューアーを考えてみましょう。または音声シンセサイザーにストーリーを渡した ブラインド アプリケーションの XPS 。 ドキュメントを読み取る一部のアプリケーションでは、ストーリーのフラグメントのサブセットをマージする必要がある場合があります。 たとえば、3 回クリックして段落全体をクリップボードにコピーする機能は、段落が改ページにまたがるたびにマージを実行する必要があります。このような段落は 2 つの StoryFragment間で分割されるためです。
マージするには、次のアルゴリズムを使用します。
</StoryFragment>
マージする最初のフラグメントの末尾から を削除し、2 番目のフラグメントの先頭から を削除<StoryFragment>
します。最初のフラグメントの最後の終了タグが、2 番目のフラグメントの最初の開始タグと同じ型である場合 (およびタグではない
<NamedElement>
) 場合は、両方を削除します。2 つのフラグメントが 次のいずれかの 状態になるまで、手順 2 を繰り返します。
先頭フラグメントの最後の終了タグと末尾のフラグメントの最初の開始タグの間に型の一致がなくなりました。
先頭フラグメントの最後の終了タグは、末尾のフラグメントの最初の開始タグが両方とも
<NamedElement>
タグです。
上記の例では、空のセルが生成元のアプリケーションによって追加されていない場合、フラグメントの結合によって、最初の行に 2 つのセルを含む元の最初の行ではなく、"SomeContent" と "MoreContent" の両方の参照を含む 1 つのセルのみが含まれるテーブルが生成されます。それぞれに 1 つの参照が含まれています
ストーリー全体がマージされている場合は、同じストーリーの一部である後続のフラグメントごとにアルゴリズムを繰り返す必要があります。 ストーリーに属するフラグメントは、 要素で <Story>
インデックスが作成されます。 「XPS: 仕様とライセンスのダウンロード」で取得できる XML Paper Specification (XPS) 仕様のセクション 9.1.15 を参照してください。 特定のストーリーの最後のフラグメントには、最後の StoryBreak 子として 要素があります。
コンストラクター
StoryFragment() |
StoryFragment クラスの新しいインスタンスを初期化します。 |
プロパティ
FragmentName |
ストーリー フラグメントの名前を取得または設定します。 |
FragmentType |
フラグメントの種類を取得または設定します。 |
StoryName |
ストーリーの名前を取得または設定します。 |
メソッド
Add(BlockElement) |
ストーリー フラグメントにブロックを追加します。 |
Equals(Object) |
指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。 (継承元 Object) |
GetHashCode() |
既定のハッシュ関数として機能します。 (継承元 Object) |
GetType() |
現在のインスタンスの Type を取得します。 (継承元 Object) |
MemberwiseClone() |
現在の Object の簡易コピーを作成します。 (継承元 Object) |
ToString() |
現在のオブジェクトを表す文字列を返します。 (継承元 Object) |
明示的なインターフェイスの実装
IAddChild.AddChild(Object) |
このメンバーは .NET Framework インフラストラクチャをサポートします。独自に作成したコードから直接使用するためのものではありません。 |
IAddChild.AddText(String) |
オブジェクトにノードのテキスト コンテンツを追加します。 |
IEnumerable.GetEnumerator() |
このメソッドは実装されていません。 |
IEnumerable<BlockElement>.GetEnumerator() |
このメソッドは実装されていません。 |
拡張メソッド
適用対象
こちらもご覧ください
.NET
フィードバック
https://aka.ms/ContentUserFeedback。
近日公開予定: 2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub イシューを段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、以下を参照してください:フィードバックの送信と表示