This documentation is archived and is not being maintained.
AnnotationService Class
Visual Studio 2008
Provides core services of the Microsoft Annotations Framework to manage and display user annotations.
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 Sample.
// ------------------------ 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 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: