DiscoveryDocument.CanRead(XmlReader) Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Devuelve un valor que indica si el objeto pasado XmlReader se puede deserializar en un DiscoveryDocument.
public:
static bool CanRead(System::Xml::XmlReader ^ xmlReader);
public static bool CanRead(System.Xml.XmlReader xmlReader);
static member CanRead : System.Xml.XmlReader -> bool
Public Shared Function CanRead (xmlReader As XmlReader) As Boolean
Parámetros
- xmlReader
- XmlReader
XmlReader que se prueba si se puede deserializar en .DiscoveryDocument
Devoluciones
true es si XmlReader se puede deserializar en ; DiscoveryDocumentde lo contrario, falsees .
Ejemplos
En el ejemplo de código siguiente se lee el contenido de un documento de detección, si el CanRead(XmlReader) método es true.
// Check whether the given XmlTextReader is readable.
if ( DiscoveryDocument::CanRead( myXmlTextReader ) )
// Read the given XmlTextReader.
myDiscoveryDocument = DiscoveryDocument::Read( myXmlTextReader );
else
Console::WriteLine( "The supplied file is not readable" );
// Check whether the given XmlTextReader is readable.
if ( DiscoveryDocument.CanRead( myXmlTextReader ))
{
// Read the given XmlTextReader.
myDiscoveryDocument = DiscoveryDocument.Read( myXmlTextReader );
}
else
{
Console.WriteLine( "The supplied file is not readable" );
}
' Check whether the given XmlTextReader is readable.
If DiscoveryDocument.CanRead(myXmlTextReader) = True Then
' Read the given XmlTextReader.
myDiscoveryDocument = DiscoveryDocument.Read(myXmlTextReader)
Else
Console.WriteLine("The supplied file is not readable")
End If