CreateTextStickyNoteForSelection Method

AnnotationHelper::CreateTextStickyNoteForSelection Method

Creates a text sticky note annotation on the current selection of the viewer control associated with the specified AnnotationService.

Namespace:  System.Windows.Annotations
Assembly:  PresentationFramework (in PresentationFramework.dll)

public:
static Annotation^ CreateTextStickyNoteForSelection(
	AnnotationService^ service, 
	String^ author
)
You cannot use methods in XAML.

Parameters

service
Type: System.Windows.Annotations::AnnotationService

The annotation service to use to create the text sticky note annotation.

author
Type: System::String

The author of the annotation.

Return Value

Type: System.Windows.Annotations::Annotation
The text sticky note annotation; or nullptr, if there is no selected content to annotate.

ExceptionCondition
ArgumentNullException

service is nullptr.

ArgumentException

service is not enabled.

InvalidOperationException

The viewer control contains no content selection.

The text sticky note annotation is anchored to the content defined by the current selection of the DocumentViewerBase, DocumentViewer, FlowDocumentPageViewer, FlowDocumentScrollViewer, or FlowDocumentReader control specified to the AnnotationService constructor.

If there is no user-selected content (the selection length is zero length), no annotation is created and an InvalidOperationException is thrown.

author can be specified as nullptr in which case no author is defined.

The given annotation service must be enabled by means of a call to AnnotationService::Enable prior to calling CreateTextStickyNoteForSelection.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0

Community Additions

ADD
Show:
© 2016 Microsoft