AnnotationDocumentPaginator Osztály
Definíció
Fontos
Egyes információk olyan, kiadás előtti termékekre vonatkoznak, amelyek a kiadásig még jelentősen módosulhatnak. A Microsoft nem vállal kifejezett vagy törvényi garanciát az itt megjelenő információért.
DocumentPaginator A dokumentum és a hozzá tartozó széljegyzetek nyomtatására szolgál.
public ref class AnnotationDocumentPaginator sealed : System::Windows::Documents::DocumentPaginator
public sealed class AnnotationDocumentPaginator : System.Windows.Documents.DocumentPaginator
type AnnotationDocumentPaginator = class
inherit DocumentPaginator
Public NotInheritable Class AnnotationDocumentPaginator
Inherits DocumentPaginator
- Öröklődés
Példák
Az alábbi példa az AnnotationDocumentPaginator osztály használatát mutatja be.
PrintDialog prntDialog = new PrintDialog();
if ((bool)prntDialog.ShowDialog())
{
// XpsDocumentWriter.Write() may change the current
// directory to "My Documents" or another user selected
// directory for storing the print document. Save the
// current directory and restore it after calling Write().
string docDir = Directory.GetCurrentDirectory();
// Create and XpsDocumentWriter for the selected printer.
XpsDocumentWriter xdw = PrintQueue.CreateXpsDocumentWriter(
prntDialog.PrintQueue);
// Print the document with annotations.
try
{
xdw.Write(_annotHelper.GetAnnotationDocumentPaginator(
_xpsDocument.GetFixedDocumentSequence()));
}
catch (PrintingCanceledException)
{
// If in the PrintDialog the user chooses a file-based
// output, such as the "MS Office Document Image Writer",
// the user confirms or specifies the actual output
// filename when the xdw.write operation executes.
// If the user clicks "Cancel" in the filename
// dialog a PrintingCanceledException is thrown
// which we catch here and ignore.
// MessageBox.Show("Print output cancelled");
}
// Restore the original document directory to "current".
Directory.SetCurrentDirectory(docDir);
}
Dim prntDialog As New PrintDialog()
If CBool(prntDialog.ShowDialog()) Then
' XpsDocumentWriter.Write() may change the current
' directory to "My Documents" or another user selected
' directory for storing the print document. Save the
' current directory and restore it after calling Write().
Dim docDir As String = Directory.GetCurrentDirectory()
' Create and XpsDocumentWriter for the selected printer.
Dim xdw As XpsDocumentWriter = PrintQueue.CreateXpsDocumentWriter(prntDialog.PrintQueue)
' Print the document with annotations.
Try
xdw.Write(_annotHelper.GetAnnotationDocumentPaginator(_xpsDocument.GetFixedDocumentSequence()))
Catch e1 As PrintingCanceledException
' If in the PrintDialog the user chooses a file-based
' output, such as the "MS Office Document Image Writer",
' the user confirms or specifies the actual output
' filename when the xdw.write operation executes.
' If the user clicks "Cancel" in the filename
' dialog a PrintingCanceledException is thrown
' which we catch here and ignore.
End Try
' Restore the original document directory to "current".
Directory.SetCurrentDirectory(docDir)
End If
// ------------------ GetAnnotationDocumentPaginator ------------------
/// <summary>
/// Returns a paginator for printing annotations.</summary>
/// <param name="fds">
/// The FixedDocumentSequence containing
/// the annotations to print.</param>
/// <returns>
/// An paginator for printing the document's annotations.</returns>
public AnnotationDocumentPaginator GetAnnotationDocumentPaginator(
FixedDocumentSequence fds)
{
return new AnnotationDocumentPaginator(
fds.DocumentPaginator, _annotService.Store);
}
' ------------------ GetAnnotationDocumentPaginator ------------------
''' <summary>
''' Returns a paginator for printing annotations.</summary>
''' <param name="fds">
''' The FixedDocumentSequence containing
''' the annotations to print.</param>
''' <returns>
''' An paginator for printing the document's annotations.</returns>
Public Function GetAnnotationDocumentPaginator(ByVal fds As FixedDocumentSequence) As AnnotationDocumentPaginator
Return New AnnotationDocumentPaginator(fds.DocumentPaginator, _annotService.Store)
End Function
Megjegyzések
Az AnnotationDocumentPaginator osztály a megadottt a DocumentPaginator konstruktorba burkoljaAnnotationDocumentPaginator, hogy a felhasználói széljegyzeteket a lapokra nyomatként felvehesse.
Konstruktorok
| Name | Description |
|---|---|
| AnnotationDocumentPaginator(DocumentPaginator, AnnotationStore, FlowDirection) |
Inicializálja az AnnotationDocumentPaginator osztály új példányát egy megadott DocumentPaginator, AnnotationStoreés egy szöveg FlowDirectionalapján. |
| AnnotationDocumentPaginator(DocumentPaginator, AnnotationStore) |
Inicializálja az AnnotationDocumentPaginator osztály új példányát egy megadott és DocumentPaginatoregy .AnnotationStore |
| AnnotationDocumentPaginator(DocumentPaginator, Stream, FlowDirection) |
Inicializálja az AnnotationDocumentPaginator osztály új példányát egy megadott DocumentPaginator, széljegyzettár Streamés szöveg FlowDirectionalapján. |
| AnnotationDocumentPaginator(DocumentPaginator, Stream) |
Inicializálja az AnnotationDocumentPaginator osztály új példányát egy megadott DocumentPaginator és széljegyzettár Streamalapján. |
Tulajdonságok
| Name | Description |
|---|---|
| IsPageCountValid |
Olyan értéket kap, amely jelzi, hogy az oldalak teljes száma-e PageCount . |
| PageCount |
Olyan értéket kap, amely a jelenleg formázott lapok számát jelzi. |
| PageSize |
Lekéri vagy beállítja az egyes oldalak javasolt szélességét és magasságát. |
| Source |
Lekéri a lapszámozott forrásdokumentumot. |
Metódusok
| Name | Description |
|---|---|
| CancelAsync(Object) |
Megszakítja az adott |
| ComputePageCount() |
A tartalom lapszámozását kényszeríti ki, az új összeggel frissül PageCount , és a következőre állítja be a következőt IsPageCountValid |
| ComputePageCountAsync() |
Aszinkron módon kényszeríti a tartalom lapozását, frissíti PageCount az új végösszeget, és a következőre állítja be IsPageCountValid : |
| ComputePageCountAsync(Object) |
Elindítja a tartalom aszinkron lapozását, frissíti PageCount az új végösszeget, és IsPageCountValid beállítja, hogy |
| Equals(Object) |
Meghatározza, hogy a megadott objektum egyenlő-e az aktuális objektummal. (Öröklődés forrása Object) |
| GetHashCode() |
Ez az alapértelmezett kivonatoló függvény. (Öröklődés forrása Object) |
| GetPage(Int32) |
DocumentPage Egy adott oldalszámhoz társított felhasználói széljegyzeteket ad vissza. |
| GetPageAsync(Int32, Object) |
Aszinkron módon egy adott oldalszámhoz társított felhasználói széljegyzeteket ad vissza DocumentPage . |
| GetPageAsync(Int32) |
Aszinkron módon adja vissza (az GetPageCompleted eseményen keresztül) a DocumentPage megadott oldalszámot. (Öröklődés forrása DocumentPaginator) |
| GetType() |
Lekéri az Type aktuális példányt. (Öröklődés forrása Object) |
| MemberwiseClone() |
Az aktuális Objectpéldány sekély másolatát hozza létre. (Öröklődés forrása Object) |
| OnComputePageCountCompleted(AsyncCompletedEventArgs) |
Az eseményt emeli ComputePageCountCompleted ki. (Öröklődés forrása DocumentPaginator) |
| OnGetPageCompleted(GetPageCompletedEventArgs) |
Az eseményt emeli GetPageCompleted ki. (Öröklődés forrása DocumentPaginator) |
| OnPagesChanged(PagesChangedEventArgs) |
Az eseményt emeli PagesChanged ki. (Öröklődés forrása DocumentPaginator) |
| ToString() |
Az aktuális objektumot jelképező sztringet ad vissza. (Öröklődés forrása Object) |
esemény
| Name | Description |
|---|---|
| ComputePageCountCompleted |
Akkor fordul elő, ha egy ComputePageCountAsync művelet befejeződött. (Öröklődés forrása DocumentPaginator) |
| GetPageCompleted |
Akkor fordul elő, ha GetPageAsync befejeződött. (Öröklődés forrása DocumentPaginator) |
| PagesChanged |
A dokumentum tartalmának módosításakor fordul elő. (Öröklődés forrása DocumentPaginator) |