XmlTypeAttribute.IncludeInSchema プロパティ
XML スキーマ ドキュメントに型を含めるかどうかを示す値を取得または設定します。
Public Property IncludeInSchema As Boolean
[C#]
public bool IncludeInSchema {get; set;}
[C++]
public: __property bool get_IncludeInSchema();public: __property void set_IncludeInSchema(bool);
[JScript]
public function get IncludeInSchema() : Boolean;public function set IncludeInSchema(Boolean);
プロパティ値
XML スキーマ ドキュメントに型を含める場合は true 。それ以外の場合は false 。
解説
XmlTypeAttribute をクラスに適用し、XML 型の名前空間、XML 型名、および XML スキーマ ドキュメントにその型を含めるかどうかを指定します。 XmlTypeAttribute クラスのプロパティの設定結果を確認するには、アプリケーションを実行可能ファイルまたは DLL としてコンパイルし、その結果生成されたファイルを XSD (XML Schema Definition) ツール (XSD.exe) に渡します。ツールで、型定義を含むスキーマが書き込まれます。
使用例
[Visual Basic, C#, C++] XmlTypeAttribute を ExtraneousInfo クラスに適用し、 IncludeInSchema プロパティを false に設定する例を次に示します。
<XmlType(IncludeInSchema := False)> _
Public Class ExtraneousInfo
' Insert the members of the class.
End Class
[C#]
[XmlType(IncludeInSchema = false)]
public class ExtraneousInfo
{
// Insert the members of the class.
}
[C++]
[XmlType(IncludeInSchema = false)]
public __gc class ExtraneousInfo
{
// Insert the members of the class.
};
[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET
参照
XmlTypeAttribute クラス | XmlTypeAttribute メンバ | System.Xml.Serialization 名前空間