AnnotationService.Enable(AnnotationStore) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
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)
_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 지정됩니다.