AnnotationStore.StoreContentChanged Event

Occurs when an Annotation is added to or deleted from the store.

Namespace: System.Windows.Annotations.Storage
Assembly: PresentationFramework (in presentationframework.dll)

public event StoreContentChangedEventHandler StoreContentChanged
/** @event */
public void add_StoreContentChanged (StoreContentChangedEventHandler value)

/** @event */
public void remove_StoreContentChanged (StoreContentChangedEventHandler value)

In JScript, you can handle the events defined by a class, but you cannot define your own.
<object StoreContentChanged="StoreContentChangedEventHandler" .../>

The following example shows how to add an event delegate for the StoreContentChanged event. For the full sample, see the Document Serialization Sample.

// Enable Annotations
_annotationBuffer = new MemoryStream();
_annStore = new XmlStreamStore(_annotationBuffer);
_annServ  = new AnnotationService(FDPV);
_annStore.StoreContentChanged +=
    new StoreContentChangedEventHandler(_annStore_StoreContentChanged);

The following example shows operation of the StoreContentChanged event delegate. For the full sample, see the Document Serialization Sample.

// ------------------ _annStore_StoreContentChanged -------------------
void _annStore_StoreContentChanged(object sender, StoreContentChangedEventArgs e)
    if (e.Action == StoreContentAction.Deleted) return;
    Annotation ann = e.Annotation;
    if (ann.Cargos.Count > 0)
        AnnotationResource annResource = ann.Cargos[0] as AnnotationResource;
        if (annResource.Name == "Highlight")
            AddBookmarkOrComment(BookmarkList, ann);
            AddBookmarkOrComment(CommentsList, ann);
        AddBookmarkOrComment(CommentsList, ann);

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.

.NET Framework

Supported in: 3.0