AnnotationService Class

Definition

Fornece os serviços principais do Microsoft Annotations Framework para gerenciar e exibir anotações do usuário.Provides core services of the Microsoft Annotations Framework to manage and display user annotations.

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
Inheritance
AnnotationService

Examples

O exemplo a seguir mostra como criar e iniciar um AnnotationService.The following example shows how to create and start an 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 == true)
        _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

Constructors

AnnotationService(DocumentViewerBase)

Inicializa uma nova instância da classe AnnotationService para uso com um controle DocumentViewer ou FlowDocumentPageViewer especificado.Initializes a new instance of the AnnotationService class for use with a specified DocumentViewer or FlowDocumentPageViewer control.

AnnotationService(FlowDocumentReader)

Inicializa uma nova instância da classe AnnotationService para uso com um controle FlowDocumentReader especificado.Initializes a new instance of the AnnotationService class for use with a specified FlowDocumentReader control.

AnnotationService(FlowDocumentScrollViewer)

Inicializa uma nova instância da classe AnnotationService para uso com um controle FlowDocumentScrollViewer especificado.Initializes a new instance of the AnnotationService class for use with a specified FlowDocumentScrollViewer control.

Fields

ClearHighlightsCommand

Representa o comando para limpar anotações de destaque da seleção atual.Represents the command to clear highlight annotations from the current selection.

CreateHighlightCommand

Representa o comando para criar uma anotação de destaque na seleção atual.Represents the command to create a highlight annotation on the current selection.

CreateInkStickyNoteCommand

Representa o comando para criar uma anotação de nota à tinta na seleção atual.Represents the command to create an ink-note annotation on the current selection.

CreateTextStickyNoteCommand

Representa o comando para criar uma anotação de nota de texto na seleção atual.Represents the command to create a text-note annotation on the current selection.

DeleteAnnotationsCommand

Representa o comando para excluir todas as anotações de nota à tinta, nota de texto e realce na seleção atual.Represents the command to delete all ink-note, text-note, and highlight annotations in the current selection.

DeleteStickyNotesCommand

Representa o comando para excluir todas as anotações de nota à tinta e nota de texto na seleção atual.Represents the command to delete all ink-note and text-note annotations in the current selection.

Properties

Dispatcher

Obtém o Dispatcher ao qual este DispatcherObject está associado.Gets the Dispatcher this DispatcherObject is associated with.

(Inherited from DispatcherObject)
IsEnabled

Obtém um valor que indica se o AnnotationService está habilitado.Gets a value that indicates whether the AnnotationService is enabled.

Store

Obtém o AnnotationStore usado por este AnnotationService.Gets the AnnotationStore used by this AnnotationService.

Methods

CheckAccess()

Determina se o thread de chamada tem acesso a este DispatcherObject.Determines whether the calling thread has access to this DispatcherObject.

(Inherited from DispatcherObject)
Disable()

Desabilita o processamento de anotações e oculta todas as anotações visíveis.Disables annotations processing and hides all visible annotations.

Enable(AnnotationStore)

Habilita o AnnotationService para uso com um determinado AnnotationStore e exibe todas as anotações visíveis.Enables the AnnotationService for use with a given AnnotationStore and displays all visible annotations.

Equals(Object)

Determina se o objeto especificado é igual ao objeto atual.Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serve como a função de hash padrão.Serves as the default hash function.

(Inherited from Object)
GetService(DocumentViewerBase)

Retorna a instância do AnnotationService associada a um controle de exibição de documento especificado.Returns the AnnotationService instance associated with a specified document viewing control.

GetService(FlowDocumentReader)

Retorna o AnnotationService associado a um FlowDocumentReader especificado.Returns the AnnotationService associated with a specified FlowDocumentReader.

GetService(FlowDocumentScrollViewer)

Retorna o AnnotationService associado a um FlowDocumentScrollViewer especificado.Returns the AnnotationService associated with a specified FlowDocumentScrollViewer.

GetType()

Obtém o Type da instância atual.Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Cria uma cópia superficial do Object atual.Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Retorna uma cadeia de caracteres que representa o objeto atual.Returns a string that represents the current object.

(Inherited from Object)
VerifyAccess()

Impõe que o thread de chamada tenha acesso a este DispatcherObject.Enforces that the calling thread has access to this DispatcherObject.

(Inherited from DispatcherObject)

Applies to