XmlStreamStore.DeleteAnnotation(Guid) Methode

Definitie

Hiermee verwijdert u de aantekening met de opgegeven Id aantekening uit het archief.

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

Parameters

annotationId
Guid

De GUID-eigenschap (Globally Unique Identifier) Id van de aantekening die moet worden verwijderd.

Retouren

De aantekening die is verwijderd; anders, null als er geen aantekening met de opgegeven annotationId waarde in het archief is gevonden.

Uitzonderingen

Dispose is opgeroepen in de winkel.

Er is geen I/O Stream ingesteld voor de winkel.

Voorbeelden

In het volgende voorbeeld ziet u het gebruik van de DeleteAnnotation en Flush methoden.

// ------------------------- 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();
}

Van toepassing op

Zie ook