Langue

AnnotationHelper.CreateTextStickyNoteForSelection Méthode

Définition

Crée une annotation de note collante de texte sur la sélection actuelle du contrôle visionneuse associé à l’objet spécifié AnnotationService.

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

Paramètres

service
AnnotationService

Service d’annotation à utiliser pour créer l’annotation de note collante de texte.

author
String

Auteur de l’annotation.

Retours

Annotation de note collante de texte ; ou null, s’il n’y a pas de contenu sélectionné à annoter.

Exceptions

service a la valeur null.

service n’est pas activé.

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

Remarques

L’annotation de note collante de texte est ancrée dans le contenu défini par la sélection actuelle du DocumentViewerBaseconstructeur , , DocumentViewerFlowDocumentPageViewerFlowDocumentScrollViewerou FlowDocumentReader contrôle spécifié au AnnotationService constructeur.

S’il n’existe aucun contenu sélectionné par l’utilisateur (la longueur de sélection est égale à zéro), aucune annotation n’est créée et une InvalidOperationException exception 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 avant AnnotationService.Enable l’appel CreateTextStickyNoteForSelection.

S’applique à

Voir aussi