SerializerWriter Class
Defines the abstract methods and events that are required to implement a plug-in document output serializer.
Assembly: PresentationFramework (in PresentationFramework.dll)
System.Windows.Documents.Serialization::SerializerWriter
System.Windows.Xps::XpsDocumentWriter
| Name | Description | |
|---|---|---|
![]() | SerializerWriter() | Initializes a new instance of the SerializerWriter class. |
| Name | Description | |
|---|---|---|
![]() | CancelAsync() | When overridden in a derived class, cancels an asynchronous write operation. |
![]() | CreateVisualsCollator() | When overridden in a derived class, returns a SerializerWriterCollator that writes collated Visual elements. |
![]() | CreateVisualsCollator(PrintTicket^, PrintTicket^) | When overridden in a derived class, returns a SerializerWriterCollator that writes collated Visual elements together with the given print tickets. |
![]() | Equals(Object^) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | Finalize() | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.) |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetType() | |
![]() | MemberwiseClone() | |
![]() | ToString() | Returns a string that represents the current object.(Inherited from Object.) |
![]() | Write(DocumentPaginator^) | When overridden in a derived class, synchronously writes the content of a given DocumentPaginator to the serialization Stream. |
![]() | Write(DocumentPaginator^, PrintTicket^) | When overridden in a derived class, synchronously writes paginated content together with an associated PrintTicket to the serialization Stream. |
![]() | Write(FixedDocument^) | When overridden in a derived class, synchronously writes a given FixedDocument to the serialization Stream. |
![]() | Write(FixedDocument^, PrintTicket^) | When overridden in a derived class, synchronously writes a given FixedDocument together with an associated PrintTicket to the serialization Stream. |
![]() | Write(FixedDocumentSequence^) | When overridden in a derived class, synchronously writes a given FixedDocumentSequence to the serialization Stream. |
![]() | 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^, PrintTicket^) | When overridden in a derived class, synchronously writes a given FixedPage together with an associated PrintTicket to the serialization Stream. |
![]() | Write(Visual^) | |
![]() | Write(Visual^, PrintTicket^) | When overridden in a derived class, synchronously writes a given Visual element together with an associated PrintTicket to the serialization Stream. |
![]() | WriteAsync(DocumentPaginator^) | When overridden in a derived class, asynchronously writes the content of a given DocumentPaginator to the serialization Stream. |
![]() | WriteAsync(DocumentPaginator^, Object^) | When overridden in a derived class, asynchronously writes the content of a given DocumentPaginator to the serialization Stream. |
![]() | WriteAsync(DocumentPaginator^, PrintTicket^) | When overridden in a derived class, asynchronously writes the content of a given DocumentPaginator to the serialization Stream. |
![]() | WriteAsync(DocumentPaginator^, PrintTicket^, Object^) | When overridden in a derived class, asynchronously writes paginated content together with an associated PrintTicket to the serialization Stream. |
![]() | WriteAsync(FixedDocument^) | When overridden in a derived class, asynchronously writes a given FixedDocument to the serialization Stream. |
![]() | WriteAsync(FixedDocument^, Object^) | When overridden in a derived class, asynchronously writes a given FixedDocument to the serialization Stream. |
![]() | 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^, PrintTicket^, Object^) | When overridden in a derived class, asynchronously writes a given FixedDocument together with an associated PrintTicket to the serialization Stream. |
![]() | WriteAsync(FixedDocumentSequence^) | When overridden in a derived class, asynchronously writes a given FixedDocumentSequence to the serialization Stream. |
![]() | WriteAsync(FixedDocumentSequence^, Object^) | When overridden in a derived class, asynchronously writes a given FixedDocumentSequence to the serialization Stream. |
![]() | WriteAsync(FixedDocumentSequence^, PrintTicket^) | When overridden in a derived class, asynchronously writes a given FixedDocumentSequence together with an associated PrintTicket to the serialization Stream. |
![]() | WriteAsync(FixedDocumentSequence^, PrintTicket^, Object^) | When overridden in a derived class, asynchronously writes a given FixedDocumentSequence together with an associated PrintTicket to the serialization Stream. |
![]() | WriteAsync(FixedPage^) | |
![]() | WriteAsync(FixedPage^, Object^) | |
![]() | WriteAsync(FixedPage^, PrintTicket^) | When overridden in a derived class, asynchronously writes a given FixedPage together with an associated PrintTicket to the serialization Stream. |
![]() | WriteAsync(FixedPage^, PrintTicket^, Object^) | When overridden in a derived class, asynchronously writes a given FixedPage together with an associated PrintTicket to the serialization Stream. |
![]() | WriteAsync(Visual^) | |
![]() | WriteAsync(Visual^, Object^) | |
![]() | 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^, PrintTicket^, Object^) | When overridden in a derived class, asynchronously writes a given Visual element together with an associated PrintTicket and identifier to the serialization Stream. |
| Name | Description | |
|---|---|---|
![]() | WritingCancelled | When overridden in a derived class, occurs when a CancelAsync operation is performed. |
![]() | WritingCompleted | When overridden in a derived class, occurs when a write operation finishes. |
![]() | WritingPrintTicketRequired | When overridden in a derived class, occurs just before a PrintTicket is added to a stream by a Write or WriteAsync method. |
![]() | WritingProgressChanged | When overridden in a derived class, occurs when the SerializerWriter updates its progress. |
The following example illustrates the use of SerializerWriter.
// Create a SerializerProvider for accessing plug-in serializers. SerializerProvider serializerProvider = new SerializerProvider(); // Locate the serializer that matches the fileName extension. SerializerDescriptor selectedPlugIn = null; foreach ( SerializerDescriptor serializerDescriptor in serializerProvider.InstalledSerializers ) { if ( serializerDescriptor.IsLoadable && fileName.EndsWith(serializerDescriptor.DefaultFileExtension) ) { // The plug-in serializer and fileName extensions match. selectedPlugIn = serializerDescriptor; break; // foreach } } // If a match for a plug-in serializer was found, // use it to output and store the document. if (selectedPlugIn != null) { Stream package = File.Create(fileName); SerializerWriter serializerWriter = serializerProvider.CreateSerializerWriter(selectedPlugIn, package); IDocumentPaginatorSource idoc = flowDocument as IDocumentPaginatorSource; serializerWriter.Write(idoc.DocumentPaginator, null); package.Close(); return true; }
// ------------------------ 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 = ""; // For each loadable serializer, add its display // name and extension to the filter string. foreach (SerializerDescriptor serializerDescriptor in serializerProvider.InstalledSerializers) { if (serializerDescriptor.IsLoadable) { // After the first, separate entries with a "|". if (filter.Length > 0) filter += "|"; // Add an entry with the plug-in name and extension. filter += serializerDescriptor.DisplayName + " (*" + serializerDescriptor.DefaultFileExtension + ")|*" + serializerDescriptor.DefaultFileExtension; } } // Return the filter string of installed plug-in serializers. return filter; } }
Available since 3.0
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


