次の方法で共有


AnnotationHelper.CreateTextStickyNoteForSelection メソッド

定義

指定した 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

パラメーター

service
AnnotationService

テキスト付箋の注釈を作成するために使用する注釈サービス。

author
String

注釈の作成者。

戻り値

Annotation

テキスト付箋の注釈。注釈を付けるために選択したコンテンツがない場合は null です。

例外

servicenullです。

service が有効ではありません。

ビューアー コントロールにコンテンツの選択が含まれていません。

注釈

テキスト付箋注釈は、コンストラクターに指定されている 、、FlowDocumentPageViewerまたはコントロールの現在のDocumentViewerBase選択によって定義されているコンテンツにAnnotationService固定されます。FlowDocumentReader FlowDocumentScrollViewerDocumentViewer

ユーザーが選択したコンテンツがない場合 (選択の長さが 0 の場合)、注釈は作成され、an InvalidOperationException がスローされます。

author は、作成者が定義されていない場合と同様 null に指定できます。

指定された注釈 service は、呼び出し前の呼び出し AnnotationService.Enable によって有効にする CreateTextStickyNoteForSelection必要があります。

適用対象

こちらもご覧ください