XmlTypeAttribute.IncludeInSchema 屬性

定義

取得或設定值,指出是否將型別包含在 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

屬性值

Boolean

若要將型別包含於 XML 結構描述文件中,則為 true,否則為 false

範例

下列範例會將 XmlTypeAttribute 套用至 ExtraneousInfo 類別,並將 IncludeInSchema 屬性設定為 false


[XmlType(IncludeInSchema=false)]
public ref class ExtraneousInfo{};
[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) 。 此工具會寫入架構,包括型別定義。

適用於