Aracılığıyla paylaş


XmlStreamStore.DeleteAnnotation(Guid) Yöntem

Tanım

Belirtilen ek açıklamayı Id depodan siler.

public:
 override System::Windows::Annotations::Annotation ^ DeleteAnnotation(Guid annotationId);
public override System.Windows.Annotations.Annotation DeleteAnnotation (Guid annotationId);
override this.DeleteAnnotation : Guid -> System.Windows.Annotations.Annotation
Public Overrides Function DeleteAnnotation (annotationId As Guid) As Annotation

Parametreler

annotationId
Guid

Silinecek ek açıklamanın genel benzersiz tanımlayıcısı (GUID) Id özelliği.

Döndürülenler

Annotation

Silinen ek açıklama; aksi takdirde, null belirtilen annotationId ile bir ek açıklama depoda bulunamadıysa.

Özel durumlar

Dispose mağazadan arandı.

Mağaza için G/Ç Stream ayarlanmadı.

Örnekler

Aşağıdaki örnekte ve Flush yöntemlerinin DeleteAnnotation kullanımı gösterilmektedir.

// ------------------------- DeleteMark_Click -------------------------
void DeleteMark_Click(object sender, RoutedEventArgs e)
{
    Annotation ann = ((MenuItem)sender).Tag as Annotation;
    _annStore.DeleteAnnotation(ann.Id);
    _annStore.Flush();

    MenuItem thisMenu = sender as MenuItem;
    ContextMenu parentMenu = thisMenu.Parent as ContextMenu;
    FrameworkElement dObj =
        parentMenu.PlacementTarget as FrameworkElement;
    while (!(dObj is StackPanel))
    {
        dObj = dObj.Parent as FrameworkElement;
    }

    ListBox collection = dObj.Parent as ListBox;
    collection.Items.Remove(dObj);
    Util.FlushDispatcher();
}

Şunlara uygulanır

Ayrıca bkz.