XmlStreamStore.DeleteAnnotation(Guid) 메서드

정의

저장소에서 지정된 Id 주석을 삭제합니다.

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

매개 변수

annotationId
Guid

삭제할 주석의 GUID(Globally Unique Identifier) Id 속성입니다.

반품

삭제된 주석입니다. 지정한 주석 null 이 저장소에 없으면 그렇지 annotationId 않습니다.

예외

Dispose 가 스토어에서 호출되었습니다.

저장소에 대한 I/O Stream 가 설정되지 않았습니다.

예제

다음 예제에서는 및 메서드의 DeleteAnnotation 사용을 보여 줍니다 Flush .

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

적용 대상

추가 정보