AnnotationService Kelas

Definisi

Menyediakan layanan inti Microsoft Annotations Framework untuk mengelola dan menampilkan anotasi pengguna.

public ref class AnnotationService sealed : System::Windows::Threading::DispatcherObject
public sealed class AnnotationService : System.Windows.Threading.DispatcherObject
type AnnotationService = class
    inherit DispatcherObject
Public NotInheritable Class AnnotationService
Inherits DispatcherObject
Warisan
AnnotationService

Contoh

Contoh berikut menunjukkan cara membuat dan memulai AnnotationService.

// ------------------------ StartAnnotations --------------------------
/// <summary>
///   Enables annotations and displays all that are viewable.</summary>
private void StartAnnotations()
{
    // If there is no AnnotationService yet, create one.
    if (_annotService == null)
        // docViewer is a document viewing control named in Window1.xaml.
        _annotService = new AnnotationService(docViewer);

    // If the AnnotationService is currently enabled, disable it.
    if (_annotService.IsEnabled)
        _annotService.Disable();

    // Open a stream to the file for storing annotations.
    _annotStream = new FileStream(
        _annotStorePath, FileMode.OpenOrCreate, FileAccess.ReadWrite);

    // Create an AnnotationStore using the file stream.
    _annotStore = new XmlStreamStore(_annotStream);

    // Enable the AnnotationService using the new store.
    _annotService.Enable(_annotStore);
}// end:StartAnnotations()
' ------------------------ StartAnnotations --------------------------
''' <summary>
'''   Enables annotations and displays all that are viewable.</summary>
Private Sub StartAnnotations()
    ' If there is no AnnotationService yet, create one.
    If _annotService Is Nothing Then
        ' docViewer is a document viewing control named in Window1.xaml.
        _annotService = New AnnotationService(docViewer)
    End If

    ' If the AnnotationService is currently enabled, disable it.
    If _annotService.IsEnabled = True Then
        _annotService.Disable()
    End If

    ' Open a stream to the file for storing annotations.
    _annotStream = New FileStream(_annotStorePath, FileMode.OpenOrCreate, FileAccess.ReadWrite)

    ' Create an AnnotationStore using the file stream.
    _annotStore = New XmlStreamStore(_annotStream)

    ' Enable the AnnotationService using the new store.
    _annotService.Enable(_annotStore)
End Sub

Konstruktor

Nama Deskripsi
AnnotationService(DocumentViewerBase)

Menginisialisasi instans AnnotationService baru kelas untuk digunakan dengan kontrol atau DocumentViewer tertentuFlowDocumentPageViewer.

AnnotationService(FlowDocumentReader)

Menginisialisasi instans AnnotationService baru kelas untuk digunakan dengan kontrol tertentu FlowDocumentReader .

AnnotationService(FlowDocumentScrollViewer)

Menginisialisasi instans AnnotationService baru kelas untuk digunakan dengan kontrol tertentu FlowDocumentScrollViewer .

Bidang

Nama Deskripsi
ClearHighlightsCommand

Mewakili perintah untuk menghapus anotasi sorotan dari pilihan saat ini.

CreateHighlightCommand

Mewakili perintah untuk membuat anotasi sorotan pada pilihan saat ini.

CreateInkStickyNoteCommand

Mewakili perintah untuk membuat anotasi catatan tinta pada pilihan saat ini.

CreateTextStickyNoteCommand

Mewakili perintah untuk membuat anotasi catatan teks pada pilihan saat ini.

DeleteAnnotationsCommand

Mewakili perintah untuk menghapus semua catatan tinta, catatan teks, dan menyoroti anotasi dalam pilihan saat ini.

DeleteStickyNotesCommand

Mewakili perintah untuk menghapus semua anotasi catatan tinta dan catatan teks dalam pilihan saat ini.

Properti

Nama Deskripsi
Dispatcher

Dispatcher Mendapatkan ini DispatcherObject dikaitkan dengan.

(Diperoleh dari DispatcherObject)
IsEnabled

Mendapatkan nilai yang menunjukkan apakah AnnotationService diaktifkan.

Store

Mendapatkan yang AnnotationStore digunakan oleh ini AnnotationService.

Metode

Nama Deskripsi
CheckAccess()

Menentukan apakah utas panggilan memiliki akses ke ini DispatcherObject.

(Diperoleh dari DispatcherObject)
Disable()

Menonaktifkan pemrosesan anotasi dan menyembunyikan semua anotasi yang terlihat.

Enable(AnnotationStore)

AnnotationService Mengaktifkan untuk digunakan dengan anotasi tertentu AnnotationStore dan menampilkan semua anotasi yang terlihat.

Equals(Object)

Menentukan apakah objek yang ditentukan sama dengan objek saat ini.

(Diperoleh dari Object)
GetHashCode()

Berfungsi sebagai fungsi hash default.

(Diperoleh dari Object)
GetService(DocumentViewerBase)

Mengembalikan instans yang AnnotationService terkait dengan kontrol tampilan dokumen tertentu.

GetService(FlowDocumentReader)

Mengembalikan yang AnnotationService terkait dengan FlowDocumentReader.

GetService(FlowDocumentScrollViewer)

Mengembalikan yang AnnotationService terkait dengan FlowDocumentScrollViewer.

GetType()

Mendapatkan Type instans saat ini.

(Diperoleh dari Object)
MemberwiseClone()

Membuat salinan dangkal dari Objectsaat ini.

(Diperoleh dari Object)
ToString()

Mengembalikan string yang mewakili objek saat ini.

(Diperoleh dari Object)
VerifyAccess()

Memberlakukan bahwa utas panggilan memiliki akses ke ini DispatcherObject.

(Diperoleh dari DispatcherObject)

Berlaku untuk