XObject.RemoveAnnotations(Of T) Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Removes the annotations of the specified type from this XObject.
Assembly: System.Xml.Linq (in System.Xml.Linq.dll)
The following class is used in the example below:
The following example creates an element with four annotations on it. It then uses this method to remove two of them.
Dim output As New StringBuilder Dim root As XElement = <Root>content</Root> root.AddAnnotation(New MyAnnotation("T1")) root.AddAnnotation(New MyAnnotation("T2")) root.AddAnnotation("abc") root.AddAnnotation("def") output.Append("Count before removing: {0}", root.Annotations(Of Object)().Count()) output.Append(Environment.NewLine) root.RemoveAnnotations(Of MyAnnotation)() output.Append("Count after removing: {0}", root.Annotations(Of Object)().Count()) output.Append(Environment.NewLine) OutputTextBlock.Text = output.ToString()
Show: