Atom10ItemFormatter.CanRead(XmlReader) Metoda
Definicja
Ważne
Niektóre informacje odnoszą się do produktu w wersji wstępnej, który może zostać znacząco zmodyfikowany przed wydaniem. Firma Microsoft nie udziela żadnych gwarancji, jawnych lub domniemanych, w odniesieniu do informacji podanych w tym miejscu.
Sprawdza, czy określony XmlReader element zawiera prawidłowy element syndykacji Atom 1.0.
public:
override bool CanRead(System::Xml::XmlReader ^ reader);
public override bool CanRead(System.Xml.XmlReader reader);
override this.CanRead : System.Xml.XmlReader -> bool
Public Overrides Function CanRead (reader As XmlReader) As Boolean
Parametry
Zwraca
Wartość określająca, czy XmlReader zawiera prawidłowy element syndykacji Atom 1.0.
Przykłady
Poniższy kod pokazuje, jak używać CanRead(XmlReader) metody .
Atom10ItemFormatter itemFormatter = new Atom10ItemFormatter();
XmlReader atomReader = XmlReader.Create("http://Contoso/Feeds/MyFeed/Item");
if (itemFormatter.CanRead(atomReader))
{
itemFormatter.ReadFrom(atomReader);
atomReader.Close();
}
Dim itemFormatter As New Atom10ItemFormatter()
Dim atomReader As XmlReader = XmlReader.Create("http://Contoso/Feeds/MyFeed/Item")
If itemFormatter.CanRead(atomReader) Then
itemFormatter.ReadFrom(atomReader)
atomReader.Close()
End If