AnnotationStore.StoreContentChanged 事件
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
發生於在存放區中加入或刪除 Annotation 時。
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
事件類型
範例
下列範例示範如何為 StoreContentChanged 事件新增事件委派。
// Enable Annotations
_annotationBuffer = new MemoryStream();
_annStore = new XmlStreamStore(_annotationBuffer);
_annServ = new AnnotationService(FDPV);
_annStore.StoreContentChanged +=
new StoreContentChangedEventHandler(_annStore_StoreContentChanged);
_annServ.Enable(_annStore);
下列範例顯示事件委派的 StoreContentChanged 作業。
// ------------------ _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);
}
}