Bagikan melalui


AnnotationStore.StoreContentChanged Kejadian

Definisi

Terjadi ketika ditambahkan Annotation ke atau dihapus dari penyimpanan.

public:
 event System::Windows::Annotations::Storage::StoreContentChangedEventHandler ^ StoreContentChanged;
public event System.Windows.Annotations.Storage.StoreContentChangedEventHandler StoreContentChanged;
member this.StoreContentChanged : System.Windows.Annotations.Storage.StoreContentChangedEventHandler 
Public Custom Event StoreContentChanged As StoreContentChangedEventHandler 
Public Event StoreContentChanged As StoreContentChangedEventHandler 

Jenis Acara

Contoh

Contoh berikut menunjukkan cara menambahkan delegasi peristiwa untuk peristiwa tersebut StoreContentChanged .

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

Contoh berikut menunjukkan operasi StoreContentChanged delegasi peristiwa.

// ------------------ _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);
        else
            AddBookmarkOrComment(CommentsList, ann);
    }
    else
    {
        AddBookmarkOrComment(CommentsList, ann);
    }
}

Berlaku untuk

Lihat juga