XmlTypeAttribute.IncludeInSchema 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定一個值,指示是否要在 XML 架構文件中包含該型別。
public:
property bool IncludeInSchema { bool get(); void set(bool value); };
public bool IncludeInSchema { get; set; }
member this.IncludeInSchema : bool with get, set
Public Property IncludeInSchema As Boolean
屬性值
true在 XML 結構文件中包含 該型別;否則,。 false
範例
以下範例將 應用 XmlTypeAttribute 於 ExtraneousInfo 類別,並將屬性設 IncludeInSchema 為 false。
[XmlType(IncludeInSchema = false)]
public class ExtraneousInfo
{
// Insert the members of the class.
}
<XmlType(IncludeInSchema := False)> _
Public Class ExtraneousInfo
' Insert the members of the class.
End Class
備註
將 套用 XmlTypeAttribute 到 類別,以指定 XML 型別的命名空間、XML 型別名稱,以及是否包含該型別於 XML 結構文件中。 要查看設定類別屬性 XmlTypeAttribute 的結果,請將應用程式編譯為可執行檔或 DLL,並將產生的檔案傳給 XML 結構定義工具(XSD.exe)。 工具會撰寫結構,包括型別定義。