AnnotationService 類別

定義

提供 Microsoft Annotations Framework 的核心服務,以管理及顯示使用者註釋。

public ref class AnnotationService sealed : System::Windows::Threading::DispatcherObject
public sealed class AnnotationService : System.Windows.Threading.DispatcherObject
type AnnotationService = class
    inherit DispatcherObject
Public NotInheritable Class AnnotationService
Inherits DispatcherObject
繼承
AnnotationService

範例

下列範例示範如何建立和啟動 AnnotationService

// ------------------------ StartAnnotations --------------------------
/// <summary>
///   Enables annotations and displays all that are viewable.</summary>
private void StartAnnotations()
{
    // If there is no AnnotationService yet, create one.
    if (_annotService == null)
        // docViewer is a document viewing control named in Window1.xaml.
        _annotService = new AnnotationService(docViewer);

    // If the AnnotationService is currently enabled, disable it.
    if (_annotService.IsEnabled == true)
        _annotService.Disable();

    // Open a stream to the file for storing annotations.
    _annotStream = new FileStream(
        _annotStorePath, FileMode.OpenOrCreate, FileAccess.ReadWrite);

    // Create an AnnotationStore using the file stream.
    _annotStore = new XmlStreamStore(_annotStream);

    // Enable the AnnotationService using the new store.
    _annotService.Enable(_annotStore);
}// end:StartAnnotations()
' ------------------------ StartAnnotations --------------------------
''' <summary>
'''   Enables annotations and displays all that are viewable.</summary>
Private Sub StartAnnotations()
    ' If there is no AnnotationService yet, create one.
    If _annotService Is Nothing Then
        ' docViewer is a document viewing control named in Window1.xaml.
        _annotService = New AnnotationService(docViewer)
    End If

    ' If the AnnotationService is currently enabled, disable it.
    If _annotService.IsEnabled = True Then
        _annotService.Disable()
    End If

    ' Open a stream to the file for storing annotations.
    _annotStream = New FileStream(_annotStorePath, FileMode.OpenOrCreate, FileAccess.ReadWrite)

    ' Create an AnnotationStore using the file stream.
    _annotStore = New XmlStreamStore(_annotStream)

    ' Enable the AnnotationService using the new store.
    _annotService.Enable(_annotStore)
End Sub

建構函式

AnnotationService(DocumentViewerBase)

初始化 AnnotationService 類別的新執行個體,以搭配指定的 DocumentViewerFlowDocumentPageViewer 控制項使用。

AnnotationService(FlowDocumentReader)

初始化 AnnotationService 類別的新執行個體,以搭配指定的 FlowDocumentReader 控制項使用。

AnnotationService(FlowDocumentScrollViewer)

初始化 AnnotationService 類別的新執行個體,以搭配指定的 FlowDocumentScrollViewer 控制項使用。

欄位

ClearHighlightsCommand

表示命令,這個命令會清除目前選取範圍中的反白顯示附註。

CreateHighlightCommand

表示命令,這個命令會在目前選取範圍上建立反白顯示附註。

CreateInkStickyNoteCommand

表示命令,這個命令會在目前選取範圍上建立筆墨/筆跡便箋附註。

CreateTextStickyNoteCommand

表示命令,這個命令會在目前選取範圍上建立文字便箋附註。

DeleteAnnotationsCommand

表示命令,這個命令會刪除目前選取範圍中所有的筆墨/筆跡便箋、文字便箋和反白顯示附註。

DeleteStickyNotesCommand

表示命令,這個命令會刪除目前選取範圍中所有的筆墨/筆跡便箋和文字便箋附註。

屬性

Dispatcher

取得與這個 Dispatcher 關聯的 DispatcherObject

(繼承來源 DispatcherObject)
IsEnabled

取得值,這個值表示是否啟用 AnnotationService

Store

取得這個 AnnotationStore 使用的 AnnotationService

方法

CheckAccess()

判斷呼叫的執行是否可以存取這個 DispatcherObject

(繼承來源 DispatcherObject)
Disable()

停用附註處理並隱藏所有可見的附註。

Enable(AnnotationStore)

AnnotationService 可以搭配特定的 AnnotationStore 使用並顯示所有可見的附註。

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetService(DocumentViewerBase)

傳回與指定之文件檢視控制項關聯的 AnnotationService 實例。

GetService(FlowDocumentReader)

傳回與指定 AnnotationService 關聯的 FlowDocumentReader

GetService(FlowDocumentScrollViewer)

傳回與指定 AnnotationService 關聯的 FlowDocumentScrollViewer

GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)
VerifyAccess()

請強制執行可以存取這個 DispatcherObject 的呼叫執行緒。

(繼承來源 DispatcherObject)

適用於