AnnotationService.IsEnabled 속성

정의

AnnotationService를 사용하는지 여부를 나타내는 값을 가져옵니다.

public:
 property bool IsEnabled { bool get(); };
public bool IsEnabled { get; }
member this.IsEnabled : bool
Public ReadOnly Property IsEnabled As Boolean

속성 값

Boolean

AnnotationService가 활성화되어 있으면 true이고, 그렇지 않으면 false입니다.

예제

다음 예제에서는 사용 하는 방법을 보여 줍니다 합니다 IsEnabled 속성 만들기 및 시작 하는 경우는 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

적용 대상

추가 정보