AnnotationService Clase

Definición

Proporciona servicios básicos de Microsoft Annotations Framework para administrar y mostrar anotaciones de usuario.

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

Ejemplos

En el ejemplo siguiente se muestra cómo crear e iniciar un 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

Constructores

Nombre Description
AnnotationService(DocumentViewerBase)

Inicializa una nueva instancia de la AnnotationService clase para su uso con un control o FlowDocumentPageViewer especificadoDocumentViewer.

AnnotationService(FlowDocumentReader)

Inicializa una nueva instancia de la AnnotationService clase para su uso con un control especificado FlowDocumentReader .

AnnotationService(FlowDocumentScrollViewer)

Inicializa una nueva instancia de la AnnotationService clase para su uso con un control especificado FlowDocumentScrollViewer .

Campos

Nombre Description
ClearHighlightsCommand

Representa el comando para borrar las anotaciones de resaltado de la selección actual.

CreateHighlightCommand

Representa el comando para crear una anotación de resaltado en la selección actual.

CreateInkStickyNoteCommand

Representa el comando para crear una anotación de nota manuscrita en la selección actual.

CreateTextStickyNoteCommand

Representa el comando para crear una anotación de nota de texto en la selección actual.

DeleteAnnotationsCommand

Representa el comando para eliminar todas las anotaciones ink-note, text-note y highlight en la selección actual.

DeleteStickyNotesCommand

Representa el comando para eliminar todas las anotaciones de nota manuscrita y nota de texto en la selección actual.

Propiedades

Nombre Description
Dispatcher

Obtiene el objeto al que DispatcherDispatcherObject está asociado.

(Heredado de DispatcherObject)
IsEnabled

Obtiene un valor que indica si AnnotationService está habilitado.

Store

Obtiene el objeto AnnotationStore utilizado por este AnnotationServiceobjeto .

Métodos

Nombre Description
CheckAccess()

Determina si el subproceso que llama tiene acceso a este DispatcherObject.

(Heredado de DispatcherObject)
Disable()

Deshabilita el procesamiento de anotaciones y oculta todas las anotaciones visibles.

Enable(AnnotationStore)

AnnotationService Habilita para su uso con un determinado AnnotationStore y muestra todas las anotaciones visibles.

Equals(Object)

Determina si el objeto especificado es igual al objeto actual.

(Heredado de Object)
GetHashCode()

Actúa como la función hash predeterminada.

(Heredado de Object)
GetService(DocumentViewerBase)

Devuelve la AnnotationService instancia asociada a un control de visualización de documentos especificado.

GetService(FlowDocumentReader)

Devuelve el AnnotationService objeto asociado a un especificado FlowDocumentReader.

GetService(FlowDocumentScrollViewer)

Devuelve el AnnotationService objeto asociado a un especificado FlowDocumentScrollViewer.

GetType()

Obtiene el Type de la instancia actual.

(Heredado de Object)
MemberwiseClone()

Crea una copia superficial del Objectactual.

(Heredado de Object)
ToString()

Devuelve una cadena que representa el objeto actual.

(Heredado de Object)
VerifyAccess()

Exige que el subproceso de llamada tenga acceso a este DispatcherObject.

(Heredado de DispatcherObject)

Se aplica a