System - Windows.Documents - Serialization Namespace
System - Windows.Documents - Serialization Namespace
System.Windows.Documents.Serialization
ISerializerFactory
CreateSerializerWriter
DefaultFileExtension
DisplayName
ManufacturerName
ManufacturerWebsite
SerializerDescriptor
AssemblyName
AssemblyPath
AssemblyVersion
CreateFromFactoryInstance
DefaultFileExtension
DisplayName
Equals
FactoryInterfaceName
GetHashCode
IsLoadable
ManufacturerName
ManufacturerWebsite
WinFXVersion
SerializerProvider
CreateSerializerWriter
InstalledSerializers
RegisterSerializer
SerializerProvider
UnregisterSerializer
SerializerWriter
CancelAsync
CreateVisualsCollator
SerializerWriter
Write
WriteAsync
WritingCancelled
WritingCompleted
WritingPrintTicketRequired
WritingProgressChanged
SerializerWriterCollator
BeginBatchWrite
Cancel
CancelAsync
EndBatchWrite
SerializerWriterCollator
Write
WriteAsync
WritingCancelledEventArgs
Error
WritingCancelledEventArgs
WritingCancelledEventHandler
WritingCompletedEventArgs
WritingCompletedEventArgs
WritingCompletedEventHandler
WritingPrintTicketRequiredEventArgs
CurrentPrintTicket
CurrentPrintTicketLevel
Sequence
WritingPrintTicketRequiredEventArgs
WritingPrintTicketRequiredEventHandler
WritingProgressChangedEventArgs
Number
WritingLevel
WritingProgressChangedEventArgs
WritingProgressChangedEventHandler
WritingProgressChangeLevel
System.Windows.Documents.Serialization Namespace
Provides types that support the creation and use of run-time accessible plug-in serializers that read and write
documents in different data formats.
Introduction
Plug-in serializers can only be used with full trust applications.
When called by the application, the plug-in serializer runs in the same thread as the application and can only access
elements created within the application thread. When designing a custom plug-in serializer, it is important to properly
handle all possible error conditions. A failure within a plug-in serializer can cause an application to fail.
Classes
SerializerDescriptor
Provides information about installed plug-in serializers.
SerializerProvider
Manages serialization plug-ins created, using ISerializerFactory
and SerializerDescriptor, by manufacturers who have their own
proprietary serialization formats.
SerializerWriter
Defines the abstract methods and events that are required to
implement a plug-in document output serializer.
SerializerWriterCollator
Defines the abstract methods required to implement a plug-in
document serialization Visual collator.
WritingCancelledEventArgs
Provides data for the WritingCancelled event.
WritingCompletedEventArgs
Provides data for the WritingCompleted event.
WritingPrintTicketRequiredEventArgs
Provides data for the WritingPrintTicketRequired event.
WritingProgressChangedEventArgs
Provides data for the WritingProgressChanged event.
Interfaces
ISerializerFactory
Provides a means for creating a software component that can
serialize any part of a Windows Presentation Foundation
(WPF) application's content to a manufacturer's proprietary
format.
Enums
WritingProgressChangeLevel
Specifies the scope of a WritingProgressChanged event.
Delegates
WritingCancelledEventHandler
Represents a method that will handle the WritingCancelled
event.
WritingCompletedEventHandler
Represents a method that handles the WritingCompleted
event of the XpsDocumentWriter class.
WritingPrintTicketRequiredEventHandler
Represents the method that handles the
WritingPrintTicketRequired event of an XpsDocumentWriter.
WritingProgressChangedEventHandler
Represents a method that will handle the
WritingProgressChanged event of an XpsDocumentWriter.
ISerializerFactory ISerializerFactory Interface
Provides a means for creating a software component that can serialize any part of a Windows Presentation Foundation
(WPF ) application's content to a manufacturer's proprietary format.
D eclaration
public interface ISerializerFactory
type ISerializerFactory = interface
I nheritance H ierarchy
None
Remarks
XpsSerializerFactory in the System.Windows.Xps.Serialization namespace is Microsoft's implementation of this
interface for serialized XML Paper Specification (XPS ) content.
Properties
DefaultFileExtension
DefaultFileExtension
Gets the default extension for files of the manufacturer's proprietary format.
DisplayName
DisplayName
ManufacturerName
ManufacturerName
ManufacturerWebsite
ManufacturerWebsite
Methods
CreateSerializerWriter(Stream)
CreateSerializerWriter(Stream)
Initializes an object derived from the abstract SerializerWriter class for the specified Stream.
ISerializerFactory.CreateSerializerWriter ISerializer
Factory.CreateSerializerWriter
I n this Article
Initializes an object derived from the abstract SerializerWriter class for the specified Stream.
Parameters
stream Stream Stream
The Stream to which the returned object writes.
Returns
SerializerWriter SerializerWriter
An object of a class derived from SerializerWriter.
ISerializerFactory.DefaultFileExtension ISerializerFactory.
DefaultFileExtension
I n this Article
Gets the default extension for files of the manufacturer's proprietary format.
Returns
String String
A String representing the proprietary format's default file extension.
Remarks
This method is most useful if the leading period is included, for example, ".zzz"
ISerializerFactory.DisplayName ISerializerFactory.Display
Name
I n this Article
Gets the public name of the manufacturer's serializing component.
Returns
String String
A String representing the public name of the serializing component.
ISerializerFactory.ManufacturerName ISerializerFactory.
ManufacturerName
I n this Article
Gets the name of the serializing component's manufacturer.
Returns
String String
A String representing the manufacturer's name.
ISerializerFactory.ManufacturerWebsite ISerializer
Factory.ManufacturerWebsite
I n this Article
Gets the web address of the serializing component's manufacturer.
Returns
Uri Uri
A Uri representing the manufacturer's website.
SerializerDescriptor SerializerDescriptor Class
Provides information about installed plug-in serializers.
D eclaration
public sealed class SerializerDescriptor
type SerializerDescriptor = class
I nheritance H ierarchy
Object Object
Remarks
Plug-in serializer classes derive from and implement the ISerializerFactory interface.
Properties
AssemblyName
AssemblyName
AssemblyPath
AssemblyPath
Gets the path to the assembly file that contains the serializer.
AssemblyVersion
AssemblyVersion
DefaultFileExtension
DefaultFileExtension
Gets the default extension associated with files that the serializer outputs.
DisplayName
DisplayName
FactoryInterfaceName
FactoryInterfaceName
Gets the name of the ISerializerFactory derived class that implements the serializer.
IsLoadable
IsLoadable
Gets a value indicating whether the serializer can be loaded with the currently installed version of the .NET
Framework.
ManufacturerName
ManufacturerName
ManufacturerWebsite
ManufacturerWebsite
Gets the web address of the company that developed the serializer.
WinFXVersion
WinFXVersion
Methods
CreateFromFactoryInstance(ISerializerFactory)
CreateFromFactoryInstance(ISerializerFactory)
Equals(Object)
Equals(Object)
GetHashCode()
GetHashCode()
Returns
String String
The name of the assembly (usually a DLL ) that contains the plug-in serializer.
See AssemblyPathAssemblyPath
Also AssemblyVersionAssemblyVersion
SerializerDescriptor.AssemblyPath SerializerDescriptor.
AssemblyPath
I n this Article
Gets the path to the assembly file that contains the serializer.
Returns
String String
The path to the assembly file that contains the plug-in serializer.
See AssemblyNameAssemblyName
Also AssemblyVersionAssemblyVersion
SerializerDescriptor.AssemblyVersion SerializerDescriptor.
AssemblyVersion
I n this Article
Gets the version of the assembly that contains the serializer.
Returns
Version Version
The version of the assembly that contains the plug-in serializer.
See AssemblyNameAssemblyName
Also AssemblyPathAssemblyPath
SerializerDescriptor.CreateFromFactoryInstance Serializer
Descriptor.CreateFromFactoryInstance
I n this Article
Creates a new SerializerDescriptor through a given ISerializerFactory implementation.
Parameters
factoryInstance ISerializerFactory ISerializerFactory
The source of data for the new SerializerDescriptor.
Returns
SerializerDescriptor SerializerDescriptor
A new SerializerDescriptor with its properties initialized with values from the given ISerializerFactory implementation.
Exceptions
ArgumentNullException ArgumentNullException
factoryInstance is null.
ArgumentException ArgumentException
One or more of the following properties of the factoryInstance is null: DisplayName, ManufacturerName,
ManufacturerWebsite, and DefaultFileExtension
Remarks
Only full trust callers can use this method.
SerializerDescriptor.DefaultFileExtension Serializer
Descriptor.DefaultFileExtension
I n this Article
Gets the default extension associated with files that the serializer outputs.
Returns
String String
The default extension associated with files that the serializer outputs.
Examples
The following examples illustrate using DefaultFileExtension to return the default file extensions for installed plug-in
serializers.
// Create a SerializerProvider for accessing plug-in serializers.
SerializerProvider serializerProvider = new SerializerProvider();
Returns
String String
The public display name of the serializer.
Examples
The following example shows using DisplayName to obtain and display the public name of a plug-in serializer.
// ------------------------ PlugInFileFilter --------------------------
/// <summary>
/// Gets a filter string for installed plug-in serializers.</summary>
/// <remark>
/// PlugInFileFilter is used to set the SaveFileDialog or
/// OpenFileDialog "Filter" property when saving or opening files
/// using plug-in serializers.</remark>
private string PlugInFileFilter
{
get
{ // Create a SerializerProvider for accessing plug-in serializers.
SerializerProvider serializerProvider = new SerializerProvider();
string filter = "";
Parameters
obj Object Object
The object to be compared with this SerializerDescriptor.
Returns
Boolean Boolean
true if both are equal; otherwise, false .
Remarks
Equals returns true even if the two objects differ in one or more of the following properties: ManufacturerName,
ManufacturerWebsite, and IsLoadable.
SerializerDescriptor.FactoryInterfaceName Serializer
Descriptor.FactoryInterfaceName
I n this Article
Gets the name of the ISerializerFactory derived class that implements the serializer.
Returns
String String
The name of the ISerializerFactory derived class that implements the serializer.
SerializerDescriptor.GetHashCode SerializerDescriptor.
GetHashCode
I n this Article
Gets the unique hash code value of the serializer.
Returns
Int32 Int32
The unique hash code value of the serializer.
Remarks
The unique hash code value is created based on the DisplayName, AssemblyName, AssemblyPath, AssemblyVersion,
FactoryInterfaceName, and WinFXVersion properties of the serializer.
SerializerDescriptor.IsLoadable SerializerDescriptor.Is
Loadable
I n this Article
Gets a value indicating whether the serializer can be loaded with the currently installed version of the .NET Framework.
Returns
Boolean Boolean
true if the serializer assembly can be loaded; otherwise, false . The default is false .
Examples
The following examples illustrate using IsLoadable to determine if the associated plug-in serializer can be loaded and
used.
// ------------------------ PlugInFileFilter --------------------------
/// <summary>
/// Gets a filter string for installed plug-in serializers.</summary>
/// <remark>
/// PlugInFileFilter is used to set the SaveFileDialog or
/// OpenFileDialog "Filter" property when saving or opening files
/// using plug-in serializers.</remark>
private string PlugInFileFilter
{
get
{ // Create a SerializerProvider for accessing plug-in serializers.
SerializerProvider serializerProvider = new SerializerProvider();
string filter = "";
Remarks
IsLoadable should be false unless AssemblyVersion has the same value as WinFXVersion.
SerializerDescriptor.ManufacturerName Serializer
Descriptor.ManufacturerName
I n this Article
Gets the name of the company that developed the serializer.
Returns
String String
The name of the company that developed the plug-in serializer.
Remarks
Plug-in serializer classes derive from and implement the ISerializerFactory interface.
SerializerDescriptor.ManufacturerWebsite Serializer
Descriptor.ManufacturerWebsite
I n this Article
Gets the web address of the company that developed the serializer.
Returns
Uri Uri
The web address of the company that developed the serializer.
SerializerDescriptor.WinFXVersion SerializerDescriptor.
WinFXVersion
I n this Article
Gets the version of the .NET Framework required by the serializer.
Returns
Version Version
The version of the .NET Framework required by the plug-in serializer.
Remarks
WinFXVersion must have the same value as the AssemblyVersion or the serializer assembly cannot be loaded.
SerializerProvider SerializerProvider Class
Manages serialization plug-ins created, using ISerializerFactory and SerializerDescriptor, by manufacturers who have
their own proprietary serialization formats.
D eclaration
public sealed class SerializerProvider
type SerializerProvider = class
I nheritance H ierarchy
Object Object
Constructors
SerializerProvider()
SerializerProvider()
Properties
InstalledSerializers
InstalledSerializers
Methods
CreateSerializerWriter(SerializerDescriptor, Stream)
CreateSerializerWriter(SerializerDescriptor, Stream)
Initializes an object derived from the abstract SerializerWriter class for the specified Stream that will use the
specified descriptor.
RegisterSerializer(SerializerDescriptor, Boolean)
RegisterSerializer(SerializerDescriptor, Boolean)
UnregisterSerializer(SerializerDescriptor)
UnregisterSerializer(SerializerDescriptor)
Parameters
serializerDescriptor SerializerDescriptor SerializerDescriptor
A SerializerDescriptor that contains serialization information for the SerializerWriter.
stream Stream Stream
The Stream to which the returned object writes.
Returns
SerializerWriter SerializerWriter
An object of a class derived from SerializerWriter.
Exceptions
ArgumentNullException ArgumentNullException
One of the parameters is null.
ArgumentException ArgumentException
The serializerDescriptor is specifying the wrong version.
-or-
It is not registered.
-or-
The assembly file cannot be found.
-or-
The assembly cannot be loaded.
Examples
The following example shows using CreateSerializerWriter to return a plug-in serialization writer for saving a file.
// Create a SerializerProvider for accessing plug-in serializers.
SerializerProvider serializerProvider = new SerializerProvider();
Remarks
Only fully trusted applications can call CreateSerializerWriter.
SerializerProvider.InstalledSerializers SerializerProvider.
InstalledSerializers
I n this Article
Gets a collection of the installed plug-in serializers.
public
System.Collections.ObjectModel.ReadOnlyCollection<System.Windows.Documents.Serialization.SerializerD
escriptor> InstalledSerializers { get; }
member this.InstalledSerializers :
System.Collections.ObjectModel.ReadOnlyCollection<System.Windows.Documents.Serialization.SerializerD
escriptor>
Returns
ReadOnlyCollection<SerializerDescriptor>
A ReadOnlyCollection<T> of the SerializerDescriptor objects already registered.
Examples
The following examples show using InstalledSerializers to enumerate the plug-in serializers when saving a file.
// Create a SerializerProvider for accessing plug-in serializers.
SerializerProvider serializerProvider = new SerializerProvider();
Parameters
serializerDescriptor SerializerDescriptor SerializerDescriptor
The SerializerDescriptor for the plug-in.
overwrite Boolean Boolean
true to overwrite an existing registration for the same plug-in; otherwise, false .
Exceptions
ArgumentNullException ArgumentNullException
serializerDescriptor is null.
ArgumentException ArgumentException
overwrite is false and the plug-in is already registered.
Remarks
Only fully trusted callers can use this method.
The method will interpret an already registered plug-in as the same one if it is the same in all these properties:
DisplayName, AssemblyName, AssemblyVersion, and WinFXVersion.
SerializerProvider
I n this Article
Initializes a new instance of the SerializerProvider class.
public SerializerProvider ();
Examples
The following examples show use of the SerializerProvider constructor.
// ------------------------ PlugInFileFilter --------------------------
/// <summary>
/// Gets a filter string for installed plug-in serializers.</summary>
/// <remark>
/// PlugInFileFilter is used to set the SaveFileDialog or
/// OpenFileDialog "Filter" property when saving or opening files
/// using plug-in serializers.</remark>
private string PlugInFileFilter
{
get
{ // Create a SerializerProvider for accessing plug-in serializers.
SerializerProvider serializerProvider = new SerializerProvider();
string filter = "";
Remarks
Only fully trusted callers can create a SerializerProvider.
SerializerProvider.UnregisterSerializer SerializerProvider.
UnregisterSerializer
I n this Article
Deletes a serializer plug-in from the registry.
Parameters
serializerDescriptor SerializerDescriptor SerializerDescriptor
The SerializerDescriptor for the plug-in.
Exceptions
ArgumentNullException ArgumentNullException
serializerDescriptor is null.
ArgumentException ArgumentException
The plug-in is not registered. See Remarks.
Remarks
Only fully trusted callers can use this method.
The method will interpret a registered plug-in as the same one passed to this method only if it is the same in all these
properties: DisplayName, AssemblyName, AssemblyVersion, and WinFXVersion.
SerializerWriter SerializerWriter Class
Defines the abstract methods and events that are required to implement a plug-in document output serializer.
D eclaration
public abstract class SerializerWriter
type SerializerWriter = class
I nheritance H ierarchy
Object Object
Constructors
SerializerWriter()
SerializerWriter()
Methods
CancelAsync()
CancelAsync()
CreateVisualsCollator()
CreateVisualsCollator()
When overridden in a derived class, returns a SerializerWriterCollator that writes collated Visual elements.
CreateVisualsCollator(PrintTicket, PrintTicket)
CreateVisualsCollator(PrintTicket, PrintTicket)
When overridden in a derived class, returns a SerializerWriterCollator that writes collated Visual elements
together with the given print tickets.
Write(Visual, PrintTicket)
Write(Visual, PrintTicket)
When overridden in a derived class, synchronously writes a given Visual element together with an associated
PrintTicket to the serialization Stream.
Write(FixedPage, PrintTicket)
Write(FixedPage, PrintTicket)
When overridden in a derived class, synchronously writes a given FixedPage together with an associated
PrintTicket to the serialization Stream.
Write(FixedDocument, PrintTicket)
Write(FixedDocument, PrintTicket)
When overridden in a derived class, synchronously writes a given FixedDocument together with an associated
PrintTicket to the serialization Stream.
Write(DocumentPaginator, PrintTicket)
Write(DocumentPaginator, PrintTicket)
When overridden in a derived class, synchronously writes paginated content together with an associated
PrintTicket to the serialization Stream.
Write(FixedDocumentSequence, PrintTicket)
Write(FixedDocumentSequence, PrintTicket)
When overridden in a derived class, synchronously writes a given FixedDocumentSequence together with an
associated PrintTicket to the serialization Stream.
Write(FixedPage)
Write(FixedPage)
When overridden in a derived class, synchronously writes a given FixedPage to the serialization Stream.
Write(FixedDocumentSequence)
Write(FixedDocumentSequence)
When overridden in a derived class, synchronously writes a given FixedDocumentSequence to the serialization
Stream.
Write(FixedDocument)
Write(FixedDocument)
When overridden in a derived class, synchronously writes a given FixedDocument to the serialization Stream.
Write(DocumentPaginator)
Write(DocumentPaginator)
When overridden in a derived class, synchronously writes the content of a given DocumentPaginator to the
serialization Stream.
Write(Visual)
Write(Visual)
When overridden in a derived class, synchronously writes a given Visual element to the serialization Stream.
WriteAsync(FixedPage, Object)
WriteAsync(FixedPage, Object)
When overridden in a derived class, asynchronously writes a given FixedPage to the serialization Stream.
When overridden in a derived class, asynchronously writes a given Visual element together with an associated
PrintTicket and identifier to the serialization Stream.
When overridden in a derived class, asynchronously writes a given FixedPage together with an associated
PrintTicket to the serialization Stream.
When overridden in a derived class, asynchronously writes a given FixedDocumentSequence together with an
associated PrintTicket to the serialization Stream.
When overridden in a derived class, asynchronously writes a given FixedDocument together with an associated
PrintTicket to the serialization Stream.
When overridden in a derived class, asynchronously writes paginated content together with an associated
PrintTicket to the serialization Stream.
WriteAsync(Visual, PrintTicket)
WriteAsync(Visual, PrintTicket)
When overridden in a derived class, asynchronously writes a given Visual element together with an associated
PrintTicket to the serialization Stream.
WriteAsync(Visual, Object)
WriteAsync(Visual, Object)
When overridden in a derived class, asynchronously writes a given Visual element to the serialization Stream.
WriteAsync(FixedPage, PrintTicket)
WriteAsync(FixedPage, PrintTicket)
When overridden in a derived class, asynchronously writes a given FixedPage together with an associated
PrintTicket to the serialization Stream.
WriteAsync(FixedDocumentSequence, PrintTicket)
WriteAsync(FixedDocumentSequence, PrintTicket)
When overridden in a derived class, asynchronously writes a given FixedDocumentSequence together with an
associated PrintTicket to the serialization Stream.
WriteAsync(Visual)
WriteAsync(Visual)
When overridden in a derived class, asynchronously writes a given Visual element to the serialization Stream.
WriteAsync(FixedDocument, PrintTicket)
WriteAsync(FixedDocument, PrintTicket)
When overridden in a derived class, asynchronously writes a given FixedDocument together with an associated
PrintTicket to the serialization Stream.
WriteAsync(FixedDocument, Object)
WriteAsync(FixedDocument, Object)
When overridden in a derived class, asynchronously writes a given FixedDocument to the serialization Stream.
WriteAsync(DocumentPaginator, PrintTicket)
WriteAsync(DocumentPaginator, PrintTicket)
When overridden in a derived class, asynchronously writes the content of a given DocumentPaginator to the
serialization Stream.
WriteAsync(DocumentPaginator, Object)
WriteAsync(DocumentPaginator, Object)
When overridden in a derived class, asynchronously writes the content of a given DocumentPaginator to the
serialization Stream.
WriteAsync(FixedPage)
WriteAsync(FixedPage)
When overridden in a derived class, asynchronously writes a given FixedPage to the serialization Stream.
WriteAsync(FixedDocumentSequence)
WriteAsync(FixedDocumentSequence)
When overridden in a derived class, asynchronously writes a given FixedDocumentSequence to the serialization
Stream.
WriteAsync(FixedDocument)
WriteAsync(FixedDocument)
When overridden in a derived class, asynchronously writes a given FixedDocument to the serialization Stream.
WriteAsync(DocumentPaginator)
WriteAsync(DocumentPaginator)
When overridden in a derived class, asynchronously writes the content of a given DocumentPaginator to the
serialization Stream.
WriteAsync(FixedDocumentSequence, Object)
WriteAsync(FixedDocumentSequence, Object)
When overridden in a derived class, asynchronously writes a given FixedDocumentSequence to the serialization
Stream.
Events
WritingCancelled
WritingCancelled
WritingCompleted
WritingCompleted
WritingPrintTicketRequired
WritingPrintTicketRequired
When overridden in a derived class, occurs just before a PrintTicket is added to a stream by a Write or WriteAsync
method.
WritingProgressChanged
WritingProgressChanged
When overridden in a derived class, occurs when the SerializerWriter updates its progress.
See Also
SerializerWriterCollator SerializerWriterCollator
SerializerWriter.CancelAsync SerializerWriter.Cancel
Async
I n this Article
When overridden in a derived class, cancels an asynchronous write operation.
Overloads
CreateVisualsCollator() CreateVisualsCollator()
When overridden in a derived class, returns a
SerializerWriterCollator that writes collated Visual elements.
Examples
The following example shows the use of the CreateVisualsCollator method.
private void SaveVisuals(XpsDocumentWriter xpsdw, List<Visual> vc)
{
// Setup for writing multiple visuals
VisualsToXpsDocument vToXpsD = (VisualsToXpsDocument)xpsdw.CreateVisualsCollator();
CreateVisualsCollator() CreateVisualsCollator()
When overridden in a derived class, returns a SerializerWriterCollator that writes collated Visual elements.
public abstract System.Windows.Documents.Serialization.SerializerWriterCollator
CreateVisualsCollator ();
abstract member CreateVisualsCollator : unit ->
System.Windows.Documents.Serialization.SerializerWriterCollator
Returns
SerializerWriterCollator SerializerWriterCollator
A SerializerWriterCollator that writes collated Visual elements to the document output serialization Stream.
Examples
The following example shows the use of the CreateVisualsCollator method.
private void SaveVisuals(XpsDocumentWriter xpsdw, List<Visual> vc)
{
// Setup for writing multiple visuals
VisualsToXpsDocument vToXpsD = (VisualsToXpsDocument)xpsdw.CreateVisualsCollator();
CreateVisualsCollator(PrintTicket, PrintTicket)
CreateVisualsCollator(PrintTicket, PrintTicket)
When overridden in a derived class, returns a SerializerWriterCollator that writes collated Visual elements together
with the given print tickets.
public abstract System.Windows.Documents.Serialization.SerializerWriterCollator
CreateVisualsCollator (System.Printing.PrintTicket documentSequencePT, System.Printing.PrintTicket
documentPT);
abstract member CreateVisualsCollator : System.Printing.PrintTicket * System.Printing.PrintTicket ->
System.Windows.Documents.Serialization.SerializerWriterCollator
Parameters
documentSequencePT PrintTicket PrintTicket
The default print preferences for FixedDocumentSequence content.
documentPT PrintTicket PrintTicket
The default print preferences for FixedDocument content.
Returns
SerializerWriterCollator SerializerWriterCollator
A SerializerWriterCollator that writes collated Visual elements to the document output serialization Stream.
Examples
The following example shows the use of the CreateVisualsCollator method.
This method does not validate or modify the given print tickets for a particular PrintQueue. If needed, use the
PrintQueue.MergeAndValidatePrintTicket method to create a PrintQueue-specific PrintTicket that is valid for a given
printer.
SerializerWriter
I n this Article
Initializes a new instance of the SerializerWriter class.
protected SerializerWriter ();
Examples
The following example shows how to create a SerializerWriter using the SerializerProvider.CreateSerializerWriter
method.
// Create a SerializerProvider for accessing plug-in serializers.
SerializerProvider serializerProvider = new SerializerProvider();
Remarks
Instances of SerializerWriter should be created by using the CreateSerializerWriter method of a SerializerProvider
object, not the CreateSerializerWriter method of an ISerializerFactory object.
SerializerWriter.Write SerializerWriter.Write
I n this Article
Overloads
Write(Visual, PrintTicket) Write(Visual, PrintTicket)
When overridden in a derived class, synchronously writes a
given Visual element together with an associated PrintTicket
to the serialization Stream.
Write(FixedPage) Write(FixedPage)
When overridden in a derived class, synchronously writes a
given FixedPage to the serialization Stream.
Write(FixedDocumentSequence) Write(FixedDocument
Sequence) When overridden in a derived class, synchronously writes a
given FixedDocumentSequence to the serialization Stream.
Write(FixedDocument) Write(FixedDocument)
When overridden in a derived class, synchronously writes a
given FixedDocument to the serialization Stream.
Write(DocumentPaginator) Write(DocumentPaginator)
When overridden in a derived class, synchronously writes the
content of a given DocumentPaginator to the serialization
Stream.
Write(Visual) Write(Visual)
When overridden in a derived class, synchronously writes a
given Visual element to the serialization Stream.
Examples
The following example shows the use of the Write method to serialize a flow document to an output file.
// Create a SerializerProvider for accessing plug-in serializers.
SerializerProvider serializerProvider = new SerializerProvider();
Remarks
The output Stream of the write operation is normally specified as a parameter to the constructor of the derived class
that implements SerializerWriter.
Parameters
visual Visual Visual
The Visual element to write to the serialization Stream.
printTicket PrintTicket PrintTicket
The default print preferences for the visual element.
Examples
The following example shows the use of the Write(DocumentPaginator, PrintTicket) method to serialize a flow
document to an output file.
// Create a SerializerProvider for accessing plug-in serializers.
SerializerProvider serializerProvider = new SerializerProvider();
Remarks
printTicket can be null if there are no preferred print settings.
This method does not validate or modify the given printTicket for a particular PrintQueue. If needed, use the
PrintQueue.MergeAndValidatePrintTicket method to create a PrintQueue-specific PrintTicket that is valid for a given
printer.
The output Stream of the write operation is normally specified as a parameter to the constructor of the derived class
that implements SerializerWriter.
See WriteAsync(Visual, PrintTicket)WriteAsync(Visual, PrintTicket)
Also
Parameters
fixedPage FixedPage FixedPage
The page to write to the serialization Stream.
printTicket PrintTicket PrintTicket
The default print preferences for the fixedPage content.
Examples
The following example shows the use of the Write(DocumentPaginator, PrintTicket) method to serialize a flow
document to an output file.
Remarks
printTicket can be null if there are no preferred print settings.
This method does not validate or modify the given printTicket for a particular PrintQueue. If needed, use the
PrintQueue.MergeAndValidatePrintTicket method to create a PrintQueue-specific PrintTicket that is valid for a given
printer.
The output Stream of the write operation is normally specified as a parameter to the constructor of the derived class
that implements SerializerWriter.
See WriteAsync(FixedPage, PrintTicket)WriteAsync(FixedPage, PrintTicket)
Also
Parameters
fixedDocument FixedDocument FixedDocument
The document to write to the serialization Stream.
printTicket PrintTicket PrintTicket
The default print preferences for the fixedDocument content.
Examples
The following example shows the use of the Write(DocumentPaginator, PrintTicket) method to serialize a flow
document to an output file.
Remarks
printTicket can be null if there are no preferred print settings.
This method does not validate or modify the given printTicket for a particular PrintQueue. If needed, use the
PrintQueue.MergeAndValidatePrintTicket method to create a PrintQueue-specific PrintTicket that is valid for a given
printer.
The output Stream of the write operation is normally specified as a parameter to the constructor of the derived class
that implements SerializerWriter.
See WriteAsync(FixedDocument, PrintTicket)WriteAsync(FixedDocument, PrintTicket)
Also
Parameters
documentPaginator DocumentPaginator DocumentPaginator
The document paginator that defines the content to write to the serialization Stream.
printTicket PrintTicket PrintTicket
The default print preferences for the documentPaginator content.
Examples
The following example shows the use of the Write(DocumentPaginator, PrintTicket) method to serialize a flow
document to an output file.
Remarks
printTicket can be null if there are no preferred print settings.
This method does not validate or modify the given printTicket for a particular PrintQueue. If needed, use the
PrintQueue.MergeAndValidatePrintTicket method to create a PrintQueue-specific PrintTicket that is valid for a given
printer.
The output Stream of the write operation is normally specified as a parameter to the constructor of the derived class
that implements SerializerWriter.
See WriteAsync(DocumentPaginator, PrintTicket)WriteAsync(DocumentPaginator, PrintTicket)
Also
Write(FixedDocumentSequence, PrintTicket)
Write(FixedDocumentSequence, PrintTicket)
When overridden in a derived class, synchronously writes a given FixedDocumentSequence together with an
associated PrintTicket to the serialization Stream.
Parameters
fixedDocumentSequence FixedDocumentSequence FixedDocumentSequence
The document sequence that defines the content to write to the serialization Stream.
printTicket PrintTicket PrintTicket
The default print preferences for the fixedDocumentSequence content.
Examples
The following example shows the use of the Write(DocumentPaginator, PrintTicket) method to serialize a flow
document to an output file.
// Create a SerializerProvider for accessing plug-in serializers.
SerializerProvider serializerProvider = new SerializerProvider();
Remarks
printTicket can be null if there are no preferred print settings.
This method does not validate or modify the given printTicket for a particular PrintQueue. If needed, use the
PrintQueue.MergeAndValidatePrintTicket method to create a PrintQueue-specific PrintTicket that is valid for a given
printer.
The output Stream of the write operation is normally specified as a parameter to the constructor of the derived class
that implements SerializerWriter.
See WriteAsync(FixedDocumentSequence, PrintTicket)WriteAsync(FixedDocumentSequence, PrintTicket)
Also
Write(FixedPage) Write(FixedPage)
When overridden in a derived class, synchronously writes a given FixedPage to the serialization Stream.
Parameters
fixedPage FixedPage FixedPage
The page to write to the serialization Stream.
Examples
The following example shows the use of the Write(DocumentPaginator, PrintTicket) method to serialize a flow
document to an output file.
Remarks
The output Stream of the write operation is normally specified as a parameter to the constructor of the derived class
that implements SerializerWriter.
See WriteAsync(FixedPage)WriteAsync(FixedPage)
Also
Write(FixedDocumentSequence) Write(FixedDocumentSequence)
When overridden in a derived class, synchronously writes a given FixedDocumentSequence to the serialization Stream.
Parameters
fixedDocumentSequence FixedDocumentSequence FixedDocumentSequence
The document sequence that defines the content to write to the serialization Stream.
Examples
The following example shows the use of the Write(DocumentPaginator, PrintTicket) method to serialize a flow
document to an output file.
// Create a SerializerProvider for accessing plug-in serializers.
SerializerProvider serializerProvider = new SerializerProvider();
Remarks
The output Stream of the write operation is normally specified as a parameter to the constructor of the derived class
that implements SerializerWriter.
See WriteAsync(FixedDocumentSequence)WriteAsync(FixedDocumentSequence)
Also
Write(FixedDocument) Write(FixedDocument)
When overridden in a derived class, synchronously writes a given FixedDocument to the serialization Stream.
Parameters
fixedDocument FixedDocument FixedDocument
The document to write to the serialization Stream.
Examples
The following example shows the use of the Write(DocumentPaginator, PrintTicket) method to serialize a flow
document to an output file.
// Create a SerializerProvider for accessing plug-in serializers.
SerializerProvider serializerProvider = new SerializerProvider();
Remarks
The output Stream of the write operation is normally specified as a parameter to the constructor of the derived class
that implements SerializerWriter.
See WriteAsync(FixedDocument)WriteAsync(FixedDocument)
Also
Write(DocumentPaginator) Write(DocumentPaginator)
When overridden in a derived class, synchronously writes the content of a given DocumentPaginator to the
serialization Stream.
public abstract void Write (System.Windows.Documents.DocumentPaginator documentPaginator);
abstract member Write : System.Windows.Documents.DocumentPaginator -> unit
Parameters
documentPaginator DocumentPaginator DocumentPaginator
The document paginator that defines the content to write to the serialization Stream.
Examples
The following example shows the use of the Write(DocumentPaginator, PrintTicket) method to serialize a flow
document to an output file.
// Create a SerializerProvider for accessing plug-in serializers.
SerializerProvider serializerProvider = new SerializerProvider();
Remarks
The output Stream of the write operation is normally specified as a parameter to the constructor of the derived class
that implements SerializerWriter.
See WriteAsync(DocumentPaginator)WriteAsync(DocumentPaginator)
Also
Write(Visual) Write(Visual)
When overridden in a derived class, synchronously writes a given Visual element to the serialization Stream.
public abstract void Write (System.Windows.Media.Visual visual);
abstract member Write : System.Windows.Media.Visual -> unit
Parameters
visual Visual Visual
The Visual element to write to the serialization Stream.
Examples
The following example shows the use of the Write(DocumentPaginator, PrintTicket) method to serialize a flow
document to an output file.
// Create a SerializerProvider for accessing plug-in serializers.
SerializerProvider serializerProvider = new SerializerProvider();
Remarks
The output Stream of the write operation is normally specified as a parameter to the constructor of the derived class
that implements SerializerWriter.
See WriteAsync(Visual)WriteAsync(Visual)
Also
SerializerWriter.WriteAsync SerializerWriter.WriteAsync
I n this Article
Overloads
WriteAsync(FixedPage, Object) WriteAsync(FixedPage, Object)
When overridden in a derived class, asynchronously writes a
given FixedPage to the serialization Stream.
WriteAsync(FixedPage) WriteAsync(FixedPage)
When overridden in a derived class, asynchronously writes a
given FixedPage to the serialization Stream.
WriteAsync(FixedDocumentSequence) WriteAsync(Fixed
DocumentSequence) When overridden in a derived class, asynchronously writes a
given FixedDocumentSequence to the serialization Stream.
WriteAsync(FixedDocument) WriteAsync(FixedDocument)
When overridden in a derived class, asynchronously writes a
given FixedDocument to the serialization Stream.
WriteAsync(DocumentPaginator) WriteAsync(Document
Paginator) When overridden in a derived class, asynchronously writes the
content of a given DocumentPaginator to the serialization
Stream.
Remarks
The output Stream of the write operation is normally specified as a parameter to the constructor of the derived class
that implements SerializerWriter.
Parameters
fixedPage FixedPage FixedPage
The page to write to the serialization Stream.
userState Object Object
A caller-specified object to identify the asynchronous write operation.
Remarks
userState is passed to the WritingCompletedEventHandler when the WritingCompleted event occurs.
The output Stream of the write operation is normally specified as a parameter to the constructor of the derived class
that implements SerializerWriter.
See Write(FixedPage)Write(FixedPage)
Also CancelAsync()CancelAsync()
WritingCancelledWritingCancelled
WritingCompletedWritingCompleted
WritingProgressChangedWritingProgressChanged
Parameters
visual Visual Visual
The Visual element to write to the serialization Stream.
printTicket PrintTicket PrintTicket
The default print preferences for the visual element.
This method does not validate or modify the given printTicket for a particular PrintQueue. If needed, use the
PrintQueue.MergeAndValidatePrintTicket method to create a PrintQueue-specific PrintTicket that is valid for a given
printer.
userState is passed to the WritingCompletedEventHandler when the WritingCompleted event occurs.
The output Stream of the write operation is normally specified as a parameter to the constructor of the derived class
that implements SerializerWriter.
See CancelAsync()CancelAsync()
Also WritingCancelledWritingCancelled
WritingCompletedWritingCompleted
WritingProgressChangedWritingProgressChanged
Parameters
fixedPage FixedPage FixedPage
The page to write to the serialization Stream.
printTicket PrintTicket PrintTicket
The default print preferences for the fixedPage content.
This method does not validate or modify the given printTicket for a particular PrintQueue. If needed, use the
PrintQueue.MergeAndValidatePrintTicket method to create a PrintQueue-specific PrintTicket that is valid for a given
printer.
userState is passed to the WritingCompletedEventHandler when the WritingCompleted event occurs.
The output Stream of the write operation is normally specified as a parameter to the constructor of the derived class
that implements SerializerWriter.
See Write(FixedPage, PrintTicket)Write(FixedPage, PrintTicket)
Also CancelAsync()CancelAsync()
WritingCancelledWritingCancelled
WritingCompletedWritingCompleted
WritingProgressChangedWritingProgressChanged
Parameters
fixedDocumentSequence FixedDocumentSequence FixedDocumentSequence
The document sequence that defines the content to write to the serialization Stream.
printTicket PrintTicket PrintTicket
The default print preferences for the fixedDocumentSequence content.
This method does not validate or modify the given printTicket for a particular PrintQueue. If needed, use the
PrintQueue.MergeAndValidatePrintTicket method to create a PrintQueue-specific PrintTicket that is valid for a given
printer.
userState is passed to the WritingCompletedEventHandler when the WritingCompleted event occurs.
The output Stream of the write operation is normally specified as a parameter to the constructor of the derived class
that implements SerializerWriter.
See Write(FixedDocument, PrintTicket)Write(FixedDocument, PrintTicket)
Also CancelAsync()CancelAsync()
WritingCancelledWritingCancelled
WritingCompletedWritingCompleted
WritingProgressChangedWritingProgressChanged
Parameters
fixedDocument FixedDocument FixedDocument
The document to write to the serialization Stream.
printTicket PrintTicket PrintTicket
The default print preferences for the fixedDocument content.
This method does not validate or modify the given printTicket for a particular PrintQueue. If needed, use the
PrintQueue.MergeAndValidatePrintTicket method to create a PrintQueue-specific PrintTicket that is valid for a given
printer.
userState is passed to the WritingCompletedEventHandler when the WritingCompleted event occurs.
The output Stream of the write operation is normally specified as a parameter to the constructor of the derived class
that implements SerializerWriter.
See Write(DocumentPaginator, PrintTicket)Write(DocumentPaginator, PrintTicket)
Also CancelAsync()CancelAsync()
WritingCancelledWritingCancelled
WritingCompletedWritingCompleted
WritingProgressChangedWritingProgressChanged
Parameters
documentPaginator DocumentPaginator DocumentPaginator
The document paginator that defines the content to write to the serialization Stream.
printTicket PrintTicket PrintTicket
The default print preferences for the documentPaginator content.
The output Stream of the write operation is normally specified as a parameter to the constructor of the derived class
that implements SerializerWriter.
See Write(DocumentPaginator, PrintTicket)Write(DocumentPaginator, PrintTicket)
Also CancelAsync()CancelAsync()
WritingCancelledWritingCancelled
WritingCompletedWritingCompleted
WritingProgressChangedWritingProgressChanged
Parameters
visual Visual Visual
The Visual element to write to the serialization Stream.
printTicket PrintTicket PrintTicket
The default print preferences for the visual element.
Remarks
This method does not validate or modify the given printTicket for a particular PrintQueue. If needed, use the
PrintQueue.MergeAndValidatePrintTicket method to create a PrintQueue-specific PrintTicket that is valid for a given
printer.
The output Stream of the write operation is normally specified as a parameter to the constructor of the derived class
that implements SerializerWriter.
See Write(Visual, PrintTicket)Write(Visual, PrintTicket)
Also CancelAsync()CancelAsync()
WritingCancelledWritingCancelled
WritingCompletedWritingCompleted
WritingProgressChangedWritingProgressChanged
Parameters
visual Visual Visual
The Visual element to write to the serialization Stream.
userState Object Object
A caller-specified object to identify the asynchronous write operation.
Remarks
userState is passed to the WritingCompletedEventHandler when the WritingCompleted event occurs.
The output Stream of the write operation is normally specified as a parameter to the constructor of the derived class
that implements SerializerWriter.
See Write(Visual)Write(Visual)
Also CancelAsync()CancelAsync()
WritingCancelledWritingCancelled
WritingCompletedWritingCompleted
WritingProgressChangedWritingProgressChanged
Parameters
fixedPage FixedPage FixedPage
The page to write to the serialization Stream.
printTicket PrintTicket PrintTicket
The default print preferences for the fixedPage content.
Remarks
printTicket can be null if there are no preferred print settings.
This method does not validate or modify the given printTicket for a particular PrintQueue. If needed, use the
PrintQueue.MergeAndValidatePrintTicket method to create a PrintQueue-specific PrintTicket that is valid for a given
printer.
The output Stream of the write operation is normally specified as a parameter to the constructor of the derived class
that implements SerializerWriter.
See Write(FixedPage, PrintTicket)Write(FixedPage, PrintTicket)
Also CancelAsync()CancelAsync()
WritingCancelledWritingCancelled
WritingCompletedWritingCompleted
WritingProgressChangedWritingProgressChanged
WriteAsync(FixedDocumentSequence, PrintTicket)
WriteAsync(FixedDocumentSequence, PrintTicket)
When overridden in a derived class, asynchronously writes a given FixedDocumentSequence together with an
associated PrintTicket to the serialization Stream.
Parameters
fixedDocumentSequence FixedDocumentSequence FixedDocumentSequence
The document sequence that defines the content to write to the serialization Stream.
printTicket PrintTicket PrintTicket
The default print preferences for the fixedDocumentSequence content.
Remarks
printTicket can be null if there are no preferred print settings.
This method does not validate or modify the given printTicket for a particular PrintQueue. If needed, use the
PrintQueue.MergeAndValidatePrintTicket method to create a PrintQueue-specific PrintTicket that is valid for a given
printer.
The output Stream of the write operation is normally specified as a parameter to the constructor of the derived class
that implements SerializerWriter.
See Write(FixedDocumentSequence, PrintTicket)Write(FixedDocumentSequence, PrintTicket)
Also CancelAsync()CancelAsync()
WritingCancelledWritingCancelled
WritingCompletedWritingCompleted
WritingProgressChangedWritingProgressChanged
WriteAsync(Visual) WriteAsync(Visual)
When overridden in a derived class, asynchronously writes a given Visual element to the serialization Stream.
Parameters
visual Visual Visual
The Visual element to write to the serialization Stream.
Remarks
The output Stream of the write operation is normally specified as a parameter to the constructor of the derived class
that implements SerializerWriter.
See Write(Visual)Write(Visual)
Also CancelAsync()CancelAsync()
WritingCancelledWritingCancelled
WritingCompletedWritingCompleted
WritingProgressChangedWritingProgressChanged
WriteAsync(FixedDocument, PrintTicket)
WriteAsync(FixedDocument, PrintTicket)
When overridden in a derived class, asynchronously writes a given FixedDocument together with an associated
PrintTicket to the serialization Stream.
Parameters
fixedDocument FixedDocument FixedDocument
The document to write to the serialization Stream.
printTicket PrintTicket PrintTicket
The default print preferences for the fixedDocument content.
Remarks
printTicket can be null if there are no preferred print settings.
This method does not validate or modify the given printTicket for a particular PrintQueue. If needed, use the
PrintQueue.MergeAndValidatePrintTicket method to create a PrintQueue-specific PrintTicket that is valid for a given
printer.
The output Stream of the write operation is normally specified as a parameter to the constructor of the derived class
that implements SerializerWriter.
See Write(FixedDocument, PrintTicket)Write(FixedDocument, PrintTicket)
Also CancelAsync()CancelAsync()
WritingCancelledWritingCancelled
WritingCompletedWritingCompleted
WritingProgressChangedWritingProgressChanged
Parameters
fixedDocument FixedDocument FixedDocument
The document to write to the serialization Stream.
userState Object Object
A caller-specified object to identify the asynchronous write operation.
Remarks
userState is passed to the WritingCompletedEventHandler when the WritingCompleted event occurs.
The output Stream of the write operation is normally specified as a parameter to the constructor of the derived class
that implements SerializerWriter.
See Write(FixedDocument)Write(FixedDocument)
Also CancelAsync()CancelAsync()
WritingCancelledWritingCancelled
WritingCompletedWritingCompleted
WritingProgressChangedWritingProgressChanged
WriteAsync(DocumentPaginator, PrintTicket)
WriteAsync(DocumentPaginator, PrintTicket)
When overridden in a derived class, asynchronously writes the content of a given DocumentPaginator to the
serialization Stream.
public abstract void WriteAsync (System.Windows.Documents.DocumentPaginator documentPaginator,
System.Printing.PrintTicket printTicket);
abstract member WriteAsync : System.Windows.Documents.DocumentPaginator *
System.Printing.PrintTicket -> unit
Parameters
documentPaginator DocumentPaginator DocumentPaginator
The document paginator that defines the content to write to the serialization Stream.
printTicket PrintTicket PrintTicket
The default print preferences for the documentPaginator content.
Remarks
printTicket can be null if there are no preferred print settings.
This method does not validate or modify the given printTicket for a particular PrintQueue. If needed, use the
PrintQueue.MergeAndValidatePrintTicket method to create a PrintQueue-specific PrintTicket that is valid for a given
printer.
The output Stream of the write operation is normally specified as a parameter to the constructor of the derived class
that implements SerializerWriter.
See Write(DocumentPaginator, PrintTicket)Write(DocumentPaginator, PrintTicket)
Also CancelAsync()CancelAsync()
WritingCancelledWritingCancelled
WritingCompletedWritingCompleted
WritingProgressChangedWritingProgressChanged
WriteAsync(DocumentPaginator, Object)
WriteAsync(DocumentPaginator, Object)
When overridden in a derived class, asynchronously writes the content of a given DocumentPaginator to the
serialization Stream.
public abstract void WriteAsync (System.Windows.Documents.DocumentPaginator documentPaginator,
object userState);
abstract member WriteAsync : System.Windows.Documents.DocumentPaginator * obj -> unit
Parameters
documentPaginator DocumentPaginator DocumentPaginator
The document paginator that defines the content to write to the serialization Stream.
userState Object Object
A caller-specified object to identify the asynchronous write operation.
Remarks
userState is passed to the WritingCompletedEventHandler when the WritingCompleted event occurs.
The output Stream of the write operation is normally specified as a parameter to the constructor of the derived class
that implements SerializerWriter.
See Write(DocumentPaginator)Write(DocumentPaginator)
Also CancelAsync()CancelAsync()
WritingCancelledWritingCancelled
WritingCompletedWritingCompleted
WritingProgressChangedWritingProgressChanged
WriteAsync(FixedPage) WriteAsync(FixedPage)
When overridden in a derived class, asynchronously writes a given FixedPage to the serialization Stream.
public abstract void WriteAsync (System.Windows.Documents.FixedPage fixedPage);
abstract member WriteAsync : System.Windows.Documents.FixedPage -> unit
Parameters
fixedPage FixedPage FixedPage
The page to write to the serialization Stream.
Remarks
The output Stream of the write operation is normally specified as a parameter to the constructor of the derived class
that implements SerializerWriter.
See Write(FixedPage)Write(FixedPage)
Also CancelAsync()CancelAsync()
WritingCancelledWritingCancelled
WritingCompletedWritingCompleted
WritingProgressChangedWritingProgressChanged
WriteAsync(FixedDocumentSequence)
WriteAsync(FixedDocumentSequence)
When overridden in a derived class, asynchronously writes a given FixedDocumentSequence to the serialization
Stream.
public abstract void WriteAsync (System.Windows.Documents.FixedDocumentSequence
fixedDocumentSequence);
abstract member WriteAsync : System.Windows.Documents.FixedDocumentSequence -> unit
Parameters
fixedDocumentSequence FixedDocumentSequence FixedDocumentSequence
The document sequence that defines the content to write to the serialization Stream.
Remarks
The output Stream of the write operation is normally specified as a parameter to the constructor of the derived class
that implements SerializerWriter.
See Write(FixedDocumentSequence)Write(FixedDocumentSequence)
Also CancelAsync()CancelAsync()
WritingCancelledWritingCancelled
WritingCompletedWritingCompleted
WritingProgressChangedWritingProgressChanged
WriteAsync(FixedDocument) WriteAsync(FixedDocument)
When overridden in a derived class, asynchronously writes a given FixedDocument to the serialization Stream.
Parameters
fixedDocument FixedDocument FixedDocument
The document to write to the serialization Stream.
Remarks
The output Stream of the write operation is normally specified as a parameter to the constructor of the derived class
that implements SerializerWriter.
See Write(FixedDocument)Write(FixedDocument)
Also CancelAsync()CancelAsync()
WritingCancelledWritingCancelled
WritingCompletedWritingCompleted
WritingProgressChangedWritingProgressChanged
WriteAsync(DocumentPaginator) WriteAsync(DocumentPaginator)
When overridden in a derived class, asynchronously writes the content of a given DocumentPaginator to the
serialization Stream.
public abstract void WriteAsync (System.Windows.Documents.DocumentPaginator documentPaginator);
abstract member WriteAsync : System.Windows.Documents.DocumentPaginator -> unit
Parameters
documentPaginator DocumentPaginator DocumentPaginator
The document paginator that defines the content to write to the serialization Stream.
Remarks
The output Stream of the write operation is normally specified as a parameter to the constructor of the derived class
that implements SerializerWriter.
See Write(DocumentPaginator)Write(DocumentPaginator)
Also CancelAsync()CancelAsync()
WritingCancelledWritingCancelled
WritingCompletedWritingCompleted
WritingProgressChangedWritingProgressChanged
WriteAsync(FixedDocumentSequence, Object)
WriteAsync(FixedDocumentSequence, Object)
When overridden in a derived class, asynchronously writes a given FixedDocumentSequence to the serialization
Stream.
Parameters
fixedDocumentSequence FixedDocumentSequence FixedDocumentSequence
The document sequence that defines the content to write to the serialization Stream.
userState Object Object
A caller-specified object to identify the asynchronous write operation.
Remarks
userState is passed to the WritingCompletedEventHandler when the WritingCompleted event occurs.
The output Stream of the write operation is normally specified as a parameter to the constructor of the derived class
that implements SerializerWriter.
See Write(FixedDocumentSequence)Write(FixedDocumentSequence)
Also CancelAsync()CancelAsync()
WritingCancelledWritingCancelled
WritingCompletedWritingCompleted
WritingProgressChangedWritingProgressChanged
SerializerWriter.WritingCancelled SerializerWriter.Writing
Cancelled
I n this Article
When overridden in a derived class, occurs when a CancelAsync() operation is performed.
See CancelAsync()CancelAsync()
Also WritingCompletedWritingCompleted
WritingProgressChangedWritingProgressChanged
SerializerWriter.WritingCompleted SerializerWriter.
WritingCompleted
I n this Article
When overridden in a derived class, occurs when a write operation finishes.
See WritingCancelledWritingCancelled
Also WritingProgressChangedWritingProgressChanged
SerializerWriter.WritingPrintTicketRequired Serializer
Writer.WritingPrintTicketRequired
I n this Article
When overridden in a derived class, occurs just before a PrintTicket is added to a stream by a Write or WriteAsync
method.
public abstract event System.Windows.Documents.Serialization.WritingPrintTicketRequiredEventHandler
WritingPrintTicketRequired;
member this.WritingPrintTicketRequired :
System.Windows.Documents.Serialization.WritingPrintTicketRequiredEventHandler
Remarks
The WritingPrintTicketRequired event enables the event handler to substitute a new PrintTicket for the one specified in
the Write or WriteAsync method call.
See WritingCompletedWritingCompleted
Also WritingCancelledWritingCancelled
WritingProgressChangedWritingProgressChanged
SerializerWriter.WritingProgressChanged Serializer
Writer.WritingProgressChanged
I n this Article
When overridden in a derived class, occurs when the SerializerWriter updates its progress.
Remarks
For example, the SerializerWriter could update its progress after every page or after every document in a multi-
document write operation.
See WritingCancelledWritingCancelled
Also WritingCompletedWritingCompleted
SerializerWriterCollator SerializerWriterCollator Class
Defines the abstract methods required to implement a plug-in document serialization Visual collator.
D eclaration
public abstract class SerializerWriterCollator
type SerializerWriterCollator = class
I nheritance H ierarchy
Object Object
Constructors
SerializerWriterCollator()
SerializerWriterCollator()
Methods
BeginBatchWrite()
BeginBatchWrite()
When overridden in a derived class, initiates the start of a batch write operation.
Cancel()
Cancel()
CancelAsync()
CancelAsync()
EndBatchWrite()
EndBatchWrite()
Write(Visual)
Write(Visual)
When overridden in a derived class, synchronously writes a given Visual element to the serialization stream.
Write(Visual, PrintTicket)
Write(Visual, PrintTicket)
When overridden in a derived class, synchronously writes a given Visual element together with an associated print
ticket to the serialization stream.
WriteAsync(Visual)
WriteAsync(Visual)
When overridden in a derived class, asynchronously writes a given Visual element to the serialization stream.
WriteAsync(Visual, Object)
WriteAsync(Visual, Object)
When overridden in a derived class, asynchronously writes a given Visual element with a specified event identifier
to the serialization stream.
WriteAsync(Visual, PrintTicket)
WriteAsync(Visual, PrintTicket)
When overridden in a derived class, asynchronously writes a given Visual element together with an associated
print ticket to the serialization stream.
When overridden in a derived class, asynchronously writes a given Visual element together with an associated
print ticket and identifier to the serialization stream.
SerializerWriterCollator.BeginBatchWrite SerializerWriter
Collator.BeginBatchWrite
I n this Article
When overridden in a derived class, initiates the start of a batch write operation.
See EndBatchWrite()EndBatchWrite()
Also
SerializerWriterCollator.Cancel SerializerWriterCollator.
Cancel
I n this Article
When overridden in a derived class, cancels a synchronous Write operation.
See CancelAsync()CancelAsync()
Also
SerializerWriterCollator.CancelAsync SerializerWriter
Collator.CancelAsync
I n this Article
When overridden in a derived class, cancels an asynchronous WriteAsync operation.
See Cancel()Cancel()
Also
SerializerWriterCollator.EndBatchWrite SerializerWriter
Collator.EndBatchWrite
I n this Article
When overridden in a derived class, completes a batch write operation.
See BeginBatchWrite()BeginBatchWrite()
Also
SerializerWriterCollator
I n this Article
Initializes a new instance of the SerializerWriterCollator class.
protected SerializerWriterCollator ();
SerializerWriterCollator.Write SerializerWriterCollator.
Write
I n this Article
Overloads
Write(Visual) Write(Visual)
When overridden in a derived class, synchronously writes a
given Visual element to the serialization stream.
Remarks
The Write methods write to the stream associated with the SerializerWriter that created the SerializerWriterCollator
from the call to CreateVisualsCollator.
Write(Visual) Write(Visual)
When overridden in a derived class, synchronously writes a given Visual element to the serialization stream.
public abstract void Write (System.Windows.Media.Visual visual);
abstract member Write : System.Windows.Media.Visual -> unit
Parameters
visual Visual Visual
The visual element to write to the serialization Stream.
Remarks
The Write method writes to the stream associated with the SerializerWriter that created the SerializerWriterCollator
from the call to CreateVisualsCollator.
See Cancel()Cancel()
Also
Parameters
visual Visual Visual
A Visual that is written to the stream.
printTicket PrintTicket PrintTicket
An object specifying preferences for how the material should be printed.
Remarks
The Write method writes to the stream associated with the SerializerWriter that created the SerializerWriterCollator
from the call to CreateVisualsCollator.
See Cancel()Cancel()
Also
SerializerWriterCollator.WriteAsync SerializerWriter
Collator.WriteAsync
I n this Article
Overloads
WriteAsync(Visual) WriteAsync(Visual)
When overridden in a derived class, asynchronously writes a
given Visual element to the serialization stream.
Remarks
The WriteAsync methods write to the stream associated with the SerializerWriter that created the
SerializerWriterCollator from the call to CreateVisualsCollator.
WriteAsync(Visual) WriteAsync(Visual)
When overridden in a derived class, asynchronously writes a given Visual element to the serialization stream.
public abstract void WriteAsync (System.Windows.Media.Visual visual);
abstract member WriteAsync : System.Windows.Media.Visual -> unit
Parameters
visual Visual Visual
The visual element to write to the serialization Stream.
Remarks
The WriteAsync methods write to the stream associated with the SerializerWriter that created the
SerializerWriterCollator from the call to CreateVisualsCollator.
See CancelAsync()CancelAsync()
Also
Parameters
visual Visual Visual
The visual element to write to the serialization Stream.
userState Object Object
A caller-specified object to identify the asynchronous write operation.
Remarks
The WriteAsync methods write to the stream associated with the SerializerWriter that created the
SerializerWriterCollator from the call to CreateVisualsCollator.
userState is passed to the WritingCompletedEventHandler when the WritingCompleted event occurs.
See CancelAsync()CancelAsync()
Also
Parameters
visual Visual Visual
The visual element to write to the serialization Stream.
printTicket PrintTicket PrintTicket
The default print preferences for the visual element.
Remarks
The WriteAsync method writes to the stream associated with the SerializerWriter that created the
SerializerWriterCollator from the call to CreateVisualsCollator.
printTicket can be null if there are no preferred print settings.
See CancelAsync()CancelAsync()
Also
Parameters
visual Visual Visual
The visual element to write to the serialization Stream.
printTicket PrintTicket PrintTicket
The default print preferences for the visual element.
userState Object Object
A caller-specified object to identify the asynchronous write operation.
Remarks
The WriteAsync method writes to the stream associated with the SerializerWriter that created the
SerializerWriterCollator from the call to CreateVisualsCollator.
printTicket can be null if there are no preferred print settings.
See CancelAsync()CancelAsync()
Also
WritingCancelledEventArgs WritingCancelledEventArgs
Class
Provides data for the WritingCancelled event.
D eclaration
public class WritingCancelledEventArgs : EventArgs
type WritingCancelledEventArgs = class
inherit EventArgs
I nheritance H ierarchy
Object Object
EventArgs EventArgs
Constructors
WritingCancelledEventArgs(Exception)
WritingCancelledEventArgs(Exception)
Properties
Error
Error
Returns
Exception Exception
The exception that canceled the write operation.
WritingCancelledEventArgs WritingCancelledEventArgs
I n this Article
Initializes a new instance of the WritingCancelledEventArgs class.
public WritingCancelledEventArgs (Exception exception);
new System.Windows.Documents.Serialization.WritingCancelledEventArgs : Exception ->
System.Windows.Documents.Serialization.WritingCancelledEventArgs
Parameters
exception Exception Exception
The exception that canceled the write operation.
WritingCancelledEventHandler WritingCancelledEvent
Handler Delegate
Represents a method that will handle the WritingCancelled event.
D eclaration
public delegate void WritingCancelledEventHandler(object sender, WritingCancelledEventArgs e);
type WritingCancelledEventHandler = delegate of obj * WritingCancelledEventArgs -> unit
I nheritance H ierarchy
Object Object
Delegate Delegate
WritingCompletedEventArgs WritingCompletedEvent
Args Class
Provides data for the WritingCompleted event.
D eclaration
public class WritingCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs
type WritingCompletedEventArgs = class
inherit AsyncCompletedEventArgs
I nheritance H ierarchy
Object Object
EventArgs EventArgs
AsyncCompletedEventArgs AsyncCompletedEventArgs
Constructors
WritingCompletedEventArgs(Boolean, Object, Exception)
WritingCompletedEventArgs(Boolean, Object, Exception)
Parameters
cancelled Boolean Boolean
true if canceled; otherwise, false if the write operation completed normally.
state Object Object
The user-supplied state object that was passed to the WriteAsync method.
exception Exception Exception
Error that occurred during the write operation or null if there is no error.
WritingCompletedEventHandler WritingCompletedEvent
Handler Delegate
Represents a method that handles the WritingCompleted event of the XpsDocumentWriter class.
D eclaration
public delegate void WritingCompletedEventHandler(object sender, WritingCompletedEventArgs e);
type WritingCompletedEventHandler = delegate of obj * WritingCompletedEventArgs -> unit
I nheritance H ierarchy
Object Object
Delegate Delegate
WritingPrintTicketRequiredEventArgs WritingPrintTicket
RequiredEventArgs Class
Provides data for the WritingPrintTicketRequired event.
D eclaration
public class WritingPrintTicketRequiredEventArgs : EventArgs
type WritingPrintTicketRequiredEventArgs = class
inherit EventArgs
I nheritance H ierarchy
Object Object
EventArgs EventArgs
Constructors
WritingPrintTicketRequiredEventArgs(PrintTicketLevel, Int32)
WritingPrintTicketRequiredEventArgs(PrintTicketLevel, Int32)
Properties
CurrentPrintTicket
CurrentPrintTicket
Gets or sets the default printer settings to use when the document is printed.
CurrentPrintTicketLevel
CurrentPrintTicketLevel
Sequence
Sequence
See Also
PrintTicket PrintTicket
WritingPrintTicketRequiredEventArgs.CurrentPrintTicket
WritingPrintTicketRequiredEventArgs.CurrentPrintTicket
I n this Article
Gets or sets the default printer settings to use when the document is printed.
[get: System.Security.SecurityCritical]
[get: System.Security.SecurityTreatAsSafe]
[set: System.Security.SecurityCritical]
[set: System.Security.SecurityTreatAsSafe]
public System.Printing.PrintTicket CurrentPrintTicket { get; set; }
member this.CurrentPrintTicket : System.Printing.PrintTicket with get, set
Returns
PrintTicket PrintTicket
The default printer settings to use when the document is printed.
Attributes SecurityCriticalAttribute SecurityTreatAsSafeAttribute SecurityCriticalAttribute SecurityTreatAsSafeAttribute
Remarks
Setting the CurrentPrintTicket property does not validate or modify the specified PrintTicket for a particular
PrintQueue. If needed, use the MergeAndValidatePrintTicket method to create a PrintQueue-specific PrintTicket that is
valid for a given printer.
WritingPrintTicketRequiredEventArgs.CurrentPrintTicket
Level WritingPrintTicketRequiredEventArgs.CurrentPrint
TicketLevel
I n this Article
Gets a value that indicates the scope of the WritingPrintTicketRequired event.
[get: System.Security.SecurityCritical]
[get: System.Security.SecurityTreatAsSafe]
public System.Windows.Xps.Serialization.PrintTicketLevel CurrentPrintTicketLevel { get; }
member this.CurrentPrintTicketLevel : System.Windows.Xps.Serialization.PrintTicketLevel
Returns
PrintTicketLevel PrintTicketLevel
An enumeration that indicates the scope of the WritingPrintTicketRequired event as for a sequence of documents, a
single document, or a single page.
Attributes SecurityCriticalAttribute SecurityTreatAsSafeAttribute
Remarks
When the CurrentPrintTicketLevel property is FixedDocumentSequencePrintTicket, the Sequence property specifies
the number of documents output with the CurrentPrintTicket. For other CurrentPrintTicketLevel values, the Sequence
property specifies the number of pages output with the CurrentPrintTicket.
WritingPrintTicketRequiredEventArgs.Sequence Writing
PrintTicketRequiredEventArgs.Sequence
I n this Article
Gets the number of documents or pages output with the CurrentPrintTicket.
Returns
Int32 Int32
The number of documents or pages output with the CurrentPrintTicket.
Remarks
When the CurrentPrintTicketLevel property is FixedDocumentSequencePrintTicket, the Sequence property specifies
the number of documents output with the CurrentPrintTicket. For other CurrentPrintTicketLevel values, the Sequence
property specifies the number of pages output with the CurrentPrintTicket.
WritingPrintTicketRequiredEventArgs WritingPrintTicket
RequiredEventArgs
I n this Article
Initializes a new instance of the WritingPrintTicketRequiredEventArgs class.
[System.Security.SecurityCritical]
[System.Security.SecurityTreatAsSafe]
public WritingPrintTicketRequiredEventArgs (System.Windows.Xps.Serialization.PrintTicketLevel
printTicketLevel, int sequence);
new System.Windows.Documents.Serialization.WritingPrintTicketRequiredEventArgs :
System.Windows.Xps.Serialization.PrintTicketLevel * int ->
System.Windows.Documents.Serialization.WritingPrintTicketRequiredEventArgs
Parameters
printTicketLevel PrintTicketLevel PrintTicketLevel
An enumeration value that specifies scope of the CurrentPrintTicket as a page, document, or sequence of documents.
sequence Int32 Int32
Based on the scope of defined by printTicketLevel , the number of pages or the number of documents associated
with the CurrentPrintTicket.
Attributes SecurityCriticalAttribute SecurityTreatAsSafeAttribute
WritingPrintTicketRequiredEventHandler WritingPrint
TicketRequiredEventHandler Delegate
Represents the method that handles the WritingPrintTicketRequired event of an XpsDocumentWriter.
D eclaration
public delegate void WritingPrintTicketRequiredEventHandler(object sender,
WritingPrintTicketRequiredEventArgs e);
type WritingPrintTicketRequiredEventHandler = delegate of obj *
WritingPrintTicketRequiredEventArgs -> unit
I nheritance H ierarchy
Object Object
Delegate Delegate
Remarks
This event occurs when the XpsDocumentWriter needs the PrintTicket of a print job.
When you create a WritingPrintTicketRequiredEventHandler delegate, you identify the method that handles the event.
To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called
whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, see
Handling and Raising Events.
WritingProgressChangedEventArgs WritingProgress
ChangedEventArgs Class
Provides data for the WritingProgressChanged event.
D eclaration
public class WritingProgressChangedEventArgs : System.ComponentModel.ProgressChangedEventArgs
type WritingProgressChangedEventArgs = class
inherit ProgressChangedEventArgs
I nheritance H ierarchy
Object Object
EventArgs EventArgs
ProgressChangedEventArgs ProgressChangedEventArgs
Constructors
WritingProgressChangedEventArgs(WritingProgressChangeLevel, Int32, Int32, Object)
WritingProgressChangedEventArgs(WritingProgressChangeLevel, Int32, Int32, Object)
Properties
Number
Number
WritingLevel
WritingLevel
Returns
Int32 Int32
The number of documents or pages that have been written at the time of the event.
Remarks
When the WritingLevel property is FixedDocumentSequenceWritingProgress, Number specifies the number of
documents that have been written. For all other WritingLevel cases, Number is the number of pages that have been
written.
WritingProgressChangedEventArgs.WritingLevel Writing
ProgressChangedEventArgs.WritingLevel
I n this Article
Gets a value that indicates the scope of the writing progress.
Returns
WritingProgressChangeLevel WritingProgressChangeLevel
An enumeration that indicates the scope of writing a multiple document sequence, a single document, or single page.
Remarks
When the WritingLevel property is FixedDocumentSequenceWritingProgress, the Number property specifies the
number of documents that have been written. For all other WritingLevel cases, the Number property is the number of
pages that have been written.
WritingProgressChangedEventArgs WritingProgress
ChangedEventArgs
I n this Article
Initializes a new instance of the WritingProgressChangedEventArgs class.
public WritingProgressChangedEventArgs
(System.Windows.Documents.Serialization.WritingProgressChangeLevel writingLevel, int number, int
progressPercentage, object state);
new System.Windows.Documents.Serialization.WritingProgressChangedEventArgs :
System.Windows.Documents.Serialization.WritingProgressChangeLevel * int * int * obj ->
System.Windows.Documents.Serialization.WritingProgressChangedEventArgs
Parameters
writingLevel WritingProgressChangeLevel WritingProgressChangeLevel
An enumeration value that specifies the scope of the progress changed event such as for an entire multiple document
sequence, a single document, or a single page.
number Int32 Int32
Based on the scope defined by writingLevel , the number of documents or the number of pages that have been
written.
progressPercentage Int32 Int32
The percentage of data that has been written.
state Object Object
The user-supplied object that identifies the write operation.
Remarks
The user-supplied state parameter is the object passed to WriteAsync method that identifies the asynchronous write
operation.
WritingProgressChangedEventHandler WritingProgress
ChangedEventHandler Delegate
Represents a method that will handle the WritingProgressChanged event of an XpsDocumentWriter.
D eclaration
public delegate void WritingProgressChangedEventHandler(object sender,
WritingProgressChangedEventArgs e);
type WritingProgressChangedEventHandler = delegate of obj * WritingProgressChangedEventArgs ->
unit
I nheritance H ierarchy
Object Object
Delegate Delegate
Remarks
The WritingProgressChanged event occurs when the XpsDocumentWriter updates its progress during a writing
operation.
WritingProgressChangeLevel WritingProgressChange
Level Enum
Specifies the scope of a WritingProgressChanged event.
D eclaration
public enum WritingProgressChangeLevel
type WritingProgressChangeLevel =
I nheritance H ierarchy
Object Object
ValueType ValueType
Enum Enum
Remarks
The WritingProgressChangeLevel enumeration is used to specify WritingLevel property of the
WritingProgressChangedEventArgs class.
Fields
FixedDocumentSequenceWritingProgress The output progress of a multiple document
FixedDocumentSequenceWritingProgress sequence.