Export (0) Print
Expand All

FixedDocumentSequence Class

Hosts one or more DocumentReference elements that define a sequence of fixed documents.

Namespace: System.Windows.Documents
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

[ContentPropertyAttribute("References")] 
public class FixedDocumentSequence : FrameworkContentElement, IDocumentPaginatorSource, IAddChild, IServiceProvider, 
	IUriContext
/** @attribute ContentPropertyAttribute("References") */ 
public class FixedDocumentSequence extends FrameworkContentElement implements IDocumentPaginatorSource, IAddChild, 
	IServiceProvider, IUriContext
ContentPropertyAttribute("References") 
public class FixedDocumentSequence extends FrameworkContentElement implements IDocumentPaginatorSource, IAddChild, 
	IServiceProvider, IUriContext
<FixedDocumentSequence>
  References
</FixedDocumentSequence>

FixedDocumentSequence hosts an ordered sequence of one or more fixed documents that are organized as a single unit.

DocumentReference is the only allowable child element in a FixedDocumentSequence. Each DocumentReference refers to a single FixedDocument. Document reference elements must be in sequential order, matching the order in which the fixed documents are processed.

A collection of the DocumentReference elements contained in a FixedDocumentSequence can be obtained using the References property.

The following example show how to obtain the FixedDocumentSequence of an XpsDocument by use of the GetFixedDocumentSequence method . For the full sample, see Saving an XPS Document Sample.

// ------------------------- LoadDocumentViewer -----------------------
/// <summary>
///   Loads content from a file to a DocumentViewer control.</summary>
/// <param name="xpsFilename">
///   The path and name of the XPS file to
///   load to the DocumentViewer control.</param>
/// <remarks>
///   Exception handling should be added if the xpsFilename may not be
///   valid or if the FixedDocumentSequence contained in the file is
///   incorrect.  (In this sample the files are hardcoded.)</remarks>
private void LoadDocumentViewer(string xpsFilename)
{
    // Save a reference to the currently open XPS package.
    XpsDocument oldXpsPackage = _xpsPackage;

    // Open the package for the new XPS document.
    _xpsPackage = new XpsDocument(xpsFilename,
        FileAccess.Read, CompressionOption.NotCompressed);

    // Get the FixedDocumentSequence from the package.
    FixedDocumentSequence fixedDocumentSequence =
        _xpsPackage.GetFixedDocumentSequence();

    // Set the new FixedDocumentSequence as
    // the DocumentViewer's paginator source.
    docViewer.Document =
        fixedDocumentSequence as IDocumentPaginatorSource;

    // If there was an old XPS package, close it now that
    // DocumentViewer no longer needs to access it.
    if (oldXpsPackage != null)
        oldXpsPackage.Close();

    // Leave the new _xpsPackage open for DocumentViewer
    // to access additional required resources.

}// end:LoadDocumentViewer()

System.Object
   System.Windows.Threading.DispatcherObject
     System.Windows.DependencyObject
       System.Windows.ContentElement
         System.Windows.FrameworkContentElement
          System.Windows.Documents.FixedDocumentSequence

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2014 Microsoft