AnnotationService Class
.NET Framework 3.0
Provides core services of the Microsoft Annotations Framework to manage and display user annotations.
Namespace: System.Windows.Annotations
Assembly: PresentationFramework (in presentationframework.dll)
Assembly: PresentationFramework (in presentationframework.dll)
The following example shows how to create and start an AnnotationService. For the full sample, see DocumentViewer with Annotations XML-Store.
// ------------------------ 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()
System.Object
System.Windows.Threading.DispatcherObject
System.Windows.Annotations.AnnotationService
System.Windows.Threading.DispatcherObject
System.Windows.Annotations.AnnotationService
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Community Additions
ADD
Show: