XmlReaderSettings.IgnoreComments Proprietà
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Ottiene o imposta un valore che indica se ignorare i commenti.
public:
property bool IgnoreComments { bool get(); void set(bool value); };
public bool IgnoreComments { get; set; }
member this.IgnoreComments : bool with get, set
Public Property IgnoreComments As Boolean
Valore della proprietà
true per ignorare i commenti; in caso contrario false, . Il valore predefinito è false.
Esempio
Di seguito viene creato un oggetto impostazioni che può essere utilizzato per costruire un lettore che rimuove istruzioni di elaborazione, commenti e spazi vuoti non significativi.
// Set the reader settings.
XmlReaderSettings settings = new XmlReaderSettings();
settings.IgnoreComments = true;
settings.IgnoreProcessingInstructions = true;
settings.IgnoreWhitespace = true;
' Set the reader settings.
Dim settings as XmlReaderSettings = new XmlReaderSettings()
settings.IgnoreComments = true
settings.IgnoreProcessingInstructions = true
settings.IgnoreWhitespace = true
Commenti
L'impostazione di questa proprietà su true può comportare la restituzione di più nodi di testo contigui dal lettore. Ciò non influisce sulla convalida.