AnnotationService.Enable(AnnotationStore) 메서드

정의

AnnotationService를 지정된 AnnotationStore에 사용할 수 있도록 하고 표시 가능한 모든 주석을 표시합니다.

public:
 void Enable(System::Windows::Annotations::Storage::AnnotationStore ^ annotationStore);
public void Enable (System.Windows.Annotations.Storage.AnnotationStore annotationStore);
member this.Enable : System.Windows.Annotations.Storage.AnnotationStore -> unit
Public Sub Enable (annotationStore As AnnotationStore)

매개 변수

annotationStore
AnnotationStore

주석을 읽고, 쓰고, 표시하는 데 사용할 주석 저장소입니다.

예외

annotationStore이(가) null인 경우

예제

다음 예제에서는 사용 하는 방법을 보여 줍니다 합니다 Enable 시작 하면 메서드는 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

설명

Enable 모든 라고 뷰어 제어 창에 주석이 표시 됩니다. (주석 서비스와 연결 된 뷰어 컨트롤을 매개 변수에 지정 된 AnnotationService 생성자입니다.)

적용 대상

추가 정보