Share via


AnnotationHelper.CreateInkStickyNoteForSelection Méthode

Définition

Crée une annotation de pense-bête manuscrit sur la sélection actuelle du contrôle de visionneuse associé au AnnotationService spécifié.

public:
 static System::Windows::Annotations::Annotation ^ CreateInkStickyNoteForSelection(System::Windows::Annotations::AnnotationService ^ service, System::String ^ author);
public static System.Windows.Annotations.Annotation CreateInkStickyNoteForSelection (System.Windows.Annotations.AnnotationService service, string author);
static member CreateInkStickyNoteForSelection : System.Windows.Annotations.AnnotationService * string -> System.Windows.Annotations.Annotation
Public Shared Function CreateInkStickyNoteForSelection (service As AnnotationService, author As String) As Annotation

Paramètres

service
AnnotationService

Service d'annotations à utiliser pour créer l'annotation de pense-bête manuscrit.

author
String

Auteur de l'annotation.

Retours

Annotation de pense-bête manuscrit ; ou null, si aucun contenu n'est sélectionné pour être annoté.

Exceptions

service a la valeur null.

service n'est pas activé.

Le contrôle de visionneuse ne contient aucune sélection de contenu.

Remarques

L’annotation de note collante manuscrite est ancrée au contenu défini par la sélection actuelle du DocumentViewerBasecontrôle , DocumentViewer, FlowDocumentPageViewer, FlowDocumentScrollViewerou FlowDocumentReader spécifié au AnnotationService constructeur.

S’il n’y a pas de contenu sélectionné par l’utilisateur (la longueur de sélection est de longueur nulle), aucune annotation n’est créée et une InvalidOperationException est levée.

author peut être spécifié comme null dans le cas où aucun auteur n’est défini.

L’annotation service donnée doit être activée au moyen d’un appel à AnnotationService.Enable avant d’appeler CreateInkStickyNoteForSelection.

S’applique à

Voir aussi