AnnotationHelper.CreateInkStickyNoteForSelection 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
在與指定 AnnotationService的檢視器控制項目前選擇上建立墨水便貼註解。
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
參數
- service
- AnnotationService
用於建立墨水便利貼註解的註解服務。
- author
- String
註解作者。
傳回
墨水便條註解;或 null,若沒有選取內容可註解。
例外狀況
service 是 null。
service 未啟用。
觀看者控制不包含內容選擇。
備註
墨水便貼註解錨定於由建構子目前選擇 DocumentViewerBase的 、 DocumentViewer、 FlowDocumentPageViewer、 FlowDocumentScrollViewer或 FlowDocumentReader 控制項所定義 AnnotationService 的內容。
若沒有使用者選擇的內容(選取長度為零),則不會產生註解並拋出 a InvalidOperationException 。
author 可以指定為, null 此時不定義作者。
該註解service必須在呼叫 AnnotationService.Enable之前透過呼叫 來CreateInkStickyNoteForSelection啟用。