This article was translated by machine. To view in the article in English, select the English check box. You can also display the English text in a popup window by moving the mouse pointer over the text.
الترجمة
الأصلي
This documentation is archived and is not being maintained.

SerializerWriter.Write أسلوب

Visual Studio 2010

When overridden in a derived class, synchronously writes content to the serialization Stream.

  (الاسم) الوصف
أسلوب عام Write(DocumentPaginator) When overridden in a derived class, synchronously writes the content of a given DocumentPaginator to the serialization Stream.
أسلوب عام Write(FixedDocument) When overridden in a derived class, synchronously writes a given FixedDocument to the serialization Stream.
أسلوب عام Write(FixedDocumentSequence) When overridden in a derived class, synchronously writes a given FixedDocumentSequence to the serialization Stream.
أسلوب عام Write(FixedPage) When overridden in a derived class, synchronously writes a given FixedPage to the serialization Stream.
أسلوب عام Write(Visual) When overridden in a derived class, synchronously writes a given Visual element 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, PrintTicket) When overridden in a derived class, synchronously writes a given FixedDocument together with an associated PrintTicket 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, PrintTicket) When overridden in a derived class, synchronously writes a given FixedPage together with an associated PrintTicket to the serialization Stream.
أسلوب عام Write(Visual, PrintTicket) When overridden in a derived class, synchronously writes a given Visual element together with an associated PrintTicket to the serialization Stream.
أعلى

إخراج Streamمن عملية الكتابة عادة ما يتم تحديد تشغيل كمعلمة إلى الدالة الإنشائية المشتقة فئة الذي يقوم بتنفيذ SerializerWriter.

يوضح المثال التالي الاستخدام Writeأسلوب إلى إجراء تسلسل مستند تدفق في ملف إخراج.


// 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;
}


إظهار: