XpsDocument.FixedDocumentSequenceReader プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
ドキュメントを読み取るための IXpsFixedDocumentSequenceReader を取得します。
public:
property System::Windows::Xps::Packaging::IXpsFixedDocumentSequenceReader ^ FixedDocumentSequenceReader { System::Windows::Xps::Packaging::IXpsFixedDocumentSequenceReader ^ get(); };
public System.Windows.Xps.Packaging.IXpsFixedDocumentSequenceReader FixedDocumentSequenceReader { get; }
member this.FixedDocumentSequenceReader : System.Windows.Xps.Packaging.IXpsFixedDocumentSequenceReader
Public ReadOnly Property FixedDocumentSequenceReader As IXpsFixedDocumentSequenceReader
プロパティ値
ドキュメントを読み取るための IXpsFixedDocumentSequenceReader。
例
次の例では、.FixedDocumentSequenceReader FixedDocument XpsDocument
ShowStatus(" Getting FixedDocumentSequenceReader.");
IXpsFixedDocumentSequenceReader fixedDocSeqReader =
xpsDocument.FixedDocumentSequenceReader;
ShowStatus(" Getting FixedDocumentReaders.");
ICollection<IXpsFixedDocumentReader> fixedDocuments =
fixedDocSeqReader.FixedDocuments;
ShowStatus(" Getting FixedPageReaders.");
IEnumerator<IXpsFixedDocumentReader> enumerator =
fixedDocuments.GetEnumerator();
enumerator.MoveNext();
ICollection<IXpsFixedPageReader> fixedPages =
enumerator.Current.FixedPages;
// Add a document structure to each fixed page.
int i = 0;
foreach (IXpsFixedPageReader fixedPageReader in fixedPages)
{
XpsResource pageStructure;
ShowStatus(" Adding page structure resource:\n '" +
Filename(_fixedPageStructures[i]) + "'");
try
{ // Add a new StoryFragment to hold the page structure.
pageStructure = fixedPageReader.AddStoryFragment();
}
catch (System.InvalidOperationException)
{
MessageBox.Show(xpsUnstructuredFile +
"\n\nDocument structure cannot be added.\n\n" +
Filename(xpsUnstructuredFile) + " might already " +
"contain an existing document structure.",
"Cannot Add Document Structure",
MessageBoxButton.OK, MessageBoxImage.Error);
break;
}
// Copy the page structure to the new StoryFragment.
WriteResource(pageStructure, _fixedPageStructures[i++]);
}
ShowStatus(" Saving and closing the new document.\n");
xpsDocument.Close();
ShowStatus(" Getting FixedDocumentSequenceReader.")
Dim fixedDocSeqReader As IXpsFixedDocumentSequenceReader = xpsDocument.FixedDocumentSequenceReader
ShowStatus(" Getting FixedDocumentReaders.")
Dim fixedDocuments As ICollection(Of IXpsFixedDocumentReader) = fixedDocSeqReader.FixedDocuments
ShowStatus(" Getting FixedPageReaders.")
Dim enumerator As IEnumerator(Of IXpsFixedDocumentReader) = fixedDocuments.GetEnumerator()
enumerator.MoveNext()
Dim fixedPages As ICollection(Of IXpsFixedPageReader) = enumerator.Current.FixedPages
' Add a document structure to each fixed page.
Dim i As Integer = 0
For Each fixedPageReader As IXpsFixedPageReader In fixedPages
Dim pageStructure As XpsResource
ShowStatus(" Adding page structure resource:" & vbLf & " '" & Filename(_fixedPageStructures(i)) & "'")
Try
pageStructure = fixedPageReader.AddStoryFragment()
Catch e2 As InvalidOperationException
System.Windows.MessageBox.Show(xpsUnstructuredFile & vbLf & vbLf & "Document structure cannot be added." & vbLf & vbLf & Filename(xpsUnstructuredFile) & " might already " & "contain an existing document structure.",
"Cannot Add Document Structure",
MessageBoxButton.OK,
MessageBoxImage.Error)
Exit For
End Try
' Copy the page structure to the new StoryFragment.
WriteResource(pageStructure, _fixedPageStructures(i))
i += 1
Next fixedPageReader
ShowStatus(" Saving and closing the new document." & vbLf)
xpsDocument.Close()
注釈
このクラスでは単一の名前を XpsDocument 使用しますが、1 つまたは FixedDocument 複数のドキュメントのセット (シーケンス) を指定できます。