AnnotationService クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
ユーザー注釈を管理および表示するための 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を作成して開始する方法を示しています。
// ------------------------ 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)
_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) |
指定したDocumentViewerまたはFlowDocumentPageViewer コントロールで使用するために、AnnotationService クラスの新しいインスタンスを初期化します。 |
| AnnotationService(FlowDocumentReader) |
指定したFlowDocumentReader コントロールで使用するために、AnnotationService クラスの新しいインスタンスを初期化します。 |
| AnnotationService(FlowDocumentScrollViewer) |
指定したFlowDocumentScrollViewer コントロールで使用するために、AnnotationService クラスの新しいインスタンスを初期化します。 |
フィールド
| 名前 | 説明 |
|---|---|
| ClearHighlightsCommand |
現在の選択範囲から強調表示注釈をクリアするコマンドを表します。 |
| CreateHighlightCommand |
現在の選択範囲に強調表示注釈を作成するコマンドを表します。 |
| CreateInkStickyNoteCommand |
現在の選択範囲にインクノート注釈を作成するコマンドを表します。 |
| CreateTextStickyNoteCommand |
現在の選択範囲にテキストノート注釈を作成するコマンドを表します。 |
| DeleteAnnotationsCommand |
現在の選択範囲のすべてのインクノート、テキストノート、および強調表示注釈を削除するコマンドを表します。 |
| DeleteStickyNotesCommand |
現在の選択範囲のすべてのインクノート注釈とテキストノート注釈を削除するコマンドを表します。 |
プロパティ
| 名前 | 説明 |
|---|---|
| Dispatcher |
このDispatcherが関連付けられているDispatcherObjectを取得します。 (継承元 DispatcherObject) |
| IsEnabled |
AnnotationServiceが有効かどうかを示す値を取得します。 |
| Store |
このAnnotationStoreで使用されるAnnotationServiceを取得します。 |
メソッド
| 名前 | 説明 |
|---|---|
| CheckAccess() |
呼び出し元のスレッドがこの DispatcherObjectにアクセスできるかどうかを判断します。 (継承元 DispatcherObject) |
| Disable() |
注釈の処理を無効にし、表示されているすべての注釈を非表示にします。 |
| Enable(AnnotationStore) |
特定のAnnotationStoreで使用するAnnotationServiceを有効にし、表示されているすべての注釈を表示します。 |
| Equals(Object) |
指定したオブジェクトが現在のオブジェクトと等しいかどうかを判断します。 (継承元 Object) |
| GetHashCode() |
既定のハッシュ関数として機能します。 (継承元 Object) |
| GetService(DocumentViewerBase) |
指定したドキュメント表示コントロールに関連付けられている AnnotationService インスタンスを返します。 |
| GetService(FlowDocumentReader) |
指定したFlowDocumentReaderに関連付けられているAnnotationServiceを返します。 |
| GetService(FlowDocumentScrollViewer) |
指定したFlowDocumentScrollViewerに関連付けられているAnnotationServiceを返します。 |
| GetType() |
現在のインスタンスの Type を取得します。 (継承元 Object) |
| MemberwiseClone() |
現在の Objectの簡易コピーを作成します。 (継承元 Object) |
| ToString() |
現在のオブジェクトを表す文字列を返します。 (継承元 Object) |
| VerifyAccess() |
呼び出し元のスレッドがこの DispatcherObjectにアクセスできるように強制します。 (継承元 DispatcherObject) |