AnnotationService Classe

Definição

Fornece os principais serviços do Microsoft Annotations Framework para gerenciar e exibir anotações de usuário.

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 a seguir 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

Nome Description
AnnotationService(DocumentViewerBase)

Inicializa uma nova instância da AnnotationService classe para uso com um controle ou FlowDocumentPageViewer especificadoDocumentViewer.

AnnotationService(FlowDocumentReader)

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

AnnotationService(FlowDocumentScrollViewer)

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

Campos

Nome Description
ClearHighlightsCommand

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

CreateHighlightCommand

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

CreateInkStickyNoteCommand

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

CreateTextStickyNoteCommand

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

DeleteAnnotationsCommand

Representa o comando para excluir todas as anotações de tinta, anotação de texto e anotações de realce na seleção atual.

DeleteStickyNotesCommand

Representa o comando para excluir todas as anotações de tinta e anotação de texto na seleção atual.

Propriedades

Nome Description
Dispatcher

Obtém o Dispatcher que DispatcherObject está associado.

(Herdado de DispatcherObject)
IsEnabled

Obtém um valor que indica se o AnnotationService está habilitado.

Store

Obtém o AnnotationStore usado por este AnnotationService.

Métodos

Nome Description
CheckAccess()

Determina se o thread de chamada tem acesso a isso DispatcherObject.

(Herdado de DispatcherObject)
Disable()

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

Enable(AnnotationStore)

Habilita o AnnotationService uso com determinadas AnnotationStore anotações e exibe todas as anotações visíveis.

Equals(Object)

Determina se o objeto especificado é igual ao objeto atual.

(Herdado de Object)
GetHashCode()

Serve como a função hash predefinida.

(Herdado de Object)
GetService(DocumentViewerBase)

Retorna a AnnotationService instância associada a um controle de exibição de documento especificado.

GetService(FlowDocumentReader)

Retorna o AnnotationService associado a um especificado FlowDocumentReader.

GetService(FlowDocumentScrollViewer)

Retorna o AnnotationService associado a um especificado FlowDocumentScrollViewer.

GetType()

Obtém o Type da instância atual.

(Herdado de Object)
MemberwiseClone()

Cria uma cópia superficial do Objectatual.

(Herdado de Object)
ToString()

Retorna uma cadeia de caracteres que representa o objeto atual.

(Herdado de Object)
VerifyAccess()

Impõe que o thread de chamada tenha acesso a isso DispatcherObject.

(Herdado de DispatcherObject)

Aplica-se a