共用方式為


SerializerWriter.CreateVisualsCollator 方法

定義

在衍生類別中覆寫時,傳回將自動分頁之 Visual 元素寫入至序列化 StreamSerializerWriterCollator

多載

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

傳回

將自動分頁之 Visual 元素寫入至文件輸出序列化 StreamSerializerWriterCollator

範例

下列範例顯示 方法的使用 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 內容的預設列印喜好設定。

傳回

將自動分頁之 Visual 元素寫入至文件輸出序列化 StreamSerializerWriterCollator

範例

下列範例顯示 方法的使用 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 或者 documentPT ,如果沒有慣用的列印設定,則為 null

這個方法不會驗證或修改特定 PrintQueue 的指定列印票證。 如有需要,請使用 PrintQueue.MergeAndValidatePrintTicket 方法建立對指定的印表機有效的 PrintQueue 專用 PrintTicket

給實施者的注意事項

CreateVisualsCollator(PrintTicket, PrintTicket) 應該傳回 SerializerWriterCollator ,寫入至與建立它相同的 序列化 StreamSerializerWriter

適用於