AnnotationService Classe

Definição

Fornece serviços essenciais do Microsoft Annotations Framework para gerir e exibir anotações dos utilizadores.

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
Herança
AnnotationService

Exemplos

O exemplo seguinte mostra como criar e iniciar um 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

Construtores

Name Description
AnnotationService(DocumentViewerBase)

Inicializa uma nova instância da AnnotationService classe para uso com um determinado DocumentViewer ou FlowDocumentPageViewer controlo.

AnnotationService(FlowDocumentReader)

Inicializa uma nova instância da AnnotationService classe para uso com um controlo especificado FlowDocumentReader .

AnnotationService(FlowDocumentScrollViewer)

Inicializa uma nova instância da AnnotationService classe para uso com um controlo especificado FlowDocumentScrollViewer .

Campos

Name Description
ClearHighlightsCommand

Representa o comando para limpar as anotações de destaque da seleção atual.

CreateHighlightCommand

Representa o comando para criar uma anotação de destaque na seleção atual.

CreateInkStickyNoteCommand

Representa o comando para criar uma anotação de tinta na seleção atual.

CreateTextStickyNoteCommand

Representa o comando para criar uma anotação de nota de texto na seleção atual.

DeleteAnnotationsCommand

Representa o comando para eliminar todas as anotações ink-note, text-note e destaque na seleção atual.

DeleteStickyNotesCommand

Representa o comando para eliminar todas as anotações ink-note e text-note na seleção atual.

Propriedades

Name Description
Dispatcher

Percebe o Dispatcher que isto DispatcherObject está associado.

(Herdado de DispatcherObject)
IsEnabled

Recebe um valor que indica se o AnnotationService está ativado.

Store

Obtém o AnnotationStore uso por isto AnnotationService.

Métodos

Name Description
CheckAccess()

Determina se o thread que chama tem acesso a este DispatcherObject.

(Herdado de DispatcherObject)
Disable()

Desativa o processamento de anotações e oculta todas as anotações visíveis.

Enable(AnnotationStore)

Permite o AnnotationService uso com um dado AnnotationStore e mostra todas as anotações visíveis.

Equals(Object)

Determina se o objeto especificado é igual ao objeto atual.

(Herdado de Object)
GetHashCode()

Serve como função de hash predefinida.

(Herdado de Object)
GetService(DocumentViewerBase)

Devolve a AnnotationService instância associada a um controlo de visualização de documentos especificado.

GetService(FlowDocumentReader)

Devolve o AnnotationService associado a um determinado FlowDocumentReader.

GetService(FlowDocumentScrollViewer)

Devolve o AnnotationService associado a um determinado FlowDocumentScrollViewer.

GetType()

Obtém o Type da instância atual.

(Herdado de Object)
MemberwiseClone()

Cria uma cópia superficial do atual Object.

(Herdado de Object)
ToString()

Devolve uma cadeia que representa o objeto atual.

(Herdado de Object)
VerifyAccess()

Faz cumprir que o thread que chama tem acesso a este DispatcherObject.

(Herdado de DispatcherObject)

Aplica-se a