SerializerWriter.CreateVisualsCollator 方法

定义

当在派生类中重写时,返回 SerializerWriterCollator,表示将调整后的 Visual 元素写入序列化 Stream

重载

CreateVisualsCollator()

在派生类中重写时,返回写入调整后的 Visual 元素的 SerializerWriterCollator

CreateVisualsCollator(PrintTicket, PrintTicket)

当在派生类中重写时,返回写入已调整 Visual 元素的 SerializerWriterCollator,同时返回打印票证。

示例

以下示例演示如何使用 CreateVisualsCollator 方法。

private void SaveVisuals(XpsDocumentWriter xpsdw, List<Visual> vc)
{
    // Setup for writing multiple visuals
    VisualsToXpsDocument vToXpsD = (VisualsToXpsDocument)xpsdw.CreateVisualsCollator();

    // Iterate through all visuals in the collection
    foreach (Visual v in vc)
    {
        vToXpsD.Write(v);   //Write each visual to single page
    }

    // End writing multiple visuals
    vToXpsD.EndBatchWrite();
}
Private Sub SaveVisuals(ByVal xpsdw As XpsDocumentWriter, ByVal vc As List(Of Visual))
    ' Setup for writing multiple visuals
    Dim vToXpsD As VisualsToXpsDocument = CType(xpsdw.CreateVisualsCollator(), VisualsToXpsDocument)

    ' Iterate through all visuals in the collection
    For Each v As Visual In vc
        vToXpsD.Write(v) 'Write each visual to single page
    Next v

    ' End writing multiple visuals
    vToXpsD.EndBatchWrite()
End Sub

CreateVisualsCollator()

在派生类中重写时,返回写入调整后的 Visual 元素的 SerializerWriterCollator

public:
 abstract System::Windows::Documents::Serialization::SerializerWriterCollator ^ CreateVisualsCollator();
public abstract System.Windows.Documents.Serialization.SerializerWriterCollator CreateVisualsCollator ();
abstract member CreateVisualsCollator : unit -> System.Windows.Documents.Serialization.SerializerWriterCollator
Public MustOverride Function CreateVisualsCollator () As SerializerWriterCollator

返回

一个 SerializerWriterCollator,它将整理后的 Visual 元素写入文档输出序列化 Stream

示例

以下示例演示如何使用 CreateVisualsCollator 方法。

private void SaveVisuals(XpsDocumentWriter xpsdw, List<Visual> vc)
{
    // Setup for writing multiple visuals
    VisualsToXpsDocument vToXpsD = (VisualsToXpsDocument)xpsdw.CreateVisualsCollator();

    // Iterate through all visuals in the collection
    foreach (Visual v in vc)
    {
        vToXpsD.Write(v);   //Write each visual to single page
    }

    // End writing multiple visuals
    vToXpsD.EndBatchWrite();
}
Private Sub SaveVisuals(ByVal xpsdw As XpsDocumentWriter, ByVal vc As List(Of Visual))
    ' Setup for writing multiple visuals
    Dim vToXpsD As VisualsToXpsDocument = CType(xpsdw.CreateVisualsCollator(), VisualsToXpsDocument)

    ' Iterate through all visuals in the collection
    For Each v As Visual In vc
        vToXpsD.Write(v) 'Write each visual to single page
    Next v

    ' End writing multiple visuals
    vToXpsD.EndBatchWrite()
End Sub

实施者说明

CreateVisualsCollator()应返回写入SerializerWriterCollator到与创建序列化相同的序列化StreamSerializerWriter的 。

适用于

CreateVisualsCollator(PrintTicket, PrintTicket)

当在派生类中重写时,返回写入已调整 Visual 元素的 SerializerWriterCollator,同时返回打印票证。

public:
 abstract System::Windows::Documents::Serialization::SerializerWriterCollator ^ CreateVisualsCollator(System::Printing::PrintTicket ^ documentSequencePT, System::Printing::PrintTicket ^ documentPT);
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
Public MustOverride Function CreateVisualsCollator (documentSequencePT As PrintTicket, documentPT As PrintTicket) As SerializerWriterCollator

参数

documentSequencePT
PrintTicket

FixedDocumentSequence 内容的默认打印首选项。

documentPT
PrintTicket

FixedDocument 内容的默认打印首选项。

返回

一个 SerializerWriterCollator,它将整理后的 Visual 元素写入文档输出序列化 Stream

示例

以下示例演示如何使用 CreateVisualsCollator 方法。

private void SaveVisuals(XpsDocumentWriter xpsdw, List<Visual> vc)
{
    // Setup for writing multiple visuals
    VisualsToXpsDocument vToXpsD = (VisualsToXpsDocument)xpsdw.CreateVisualsCollator();

    // Iterate through all visuals in the collection
    foreach (Visual v in vc)
    {
        vToXpsD.Write(v);   //Write each visual to single page
    }

    // End writing multiple visuals
    vToXpsD.EndBatchWrite();
}
Private Sub SaveVisuals(ByVal xpsdw As XpsDocumentWriter, ByVal vc As List(Of Visual))
    ' Setup for writing multiple visuals
    Dim vToXpsD As VisualsToXpsDocument = CType(xpsdw.CreateVisualsCollator(), VisualsToXpsDocument)

    ' Iterate through all visuals in the collection
    For Each v As Visual In vc
        vToXpsD.Write(v) 'Write each visual to single page
    Next v

    ' End writing multiple visuals
    vToXpsD.EndBatchWrite()
End Sub

注解

documentSequencePT如果没有首选打印设置,则 为 nulldocumentPT

此方法不会验证或修改特定 PrintQueue的给定打印票证。 如果需要,请使用 PrintQueue.MergeAndValidatePrintTicket 方法创建特定于 PrintQueuePrintTicket(对给定打印机有效)。

实施者说明

CreateVisualsCollator(PrintTicket, PrintTicket)应返回一个 ,SerializerWriterCollator它写入到与创建它的 相同的序列化SerializerWriterStream

适用于