AnnotationStore.AddAnnotation(Annotation) 方法

定義

將新的 Annotation 加入存放區中。

public:
 abstract void AddAnnotation(System::Windows::Annotations::Annotation ^ newAnnotation);
public abstract void AddAnnotation (System.Windows.Annotations.Annotation newAnnotation);
abstract member AddAnnotation : System.Windows.Annotations.Annotation -> unit
Public MustOverride Sub AddAnnotation (newAnnotation As Annotation)

參數

newAnnotation
Annotation

要加入至存放區的註解。

例外狀況

newAnnotationnull

存放區中已經存在具有相同 Id 屬性值的 Annotation

已在存放區中呼叫 Dispose

備註

將新的 Annotation 新增至存放區時,其全域唯一識別碼 (GUID) Id 屬性會設定為新的值。 呼叫 時 AddAnnotation ,會檢查其 Id 屬性,以查看 是否已 Annotation 將 新增至存放區。 Annotation如果 已新增並存在於存放區中 (,) Id ArgumentException 擲回錯誤。

適用於

另請參閱