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.
示例
以下示例将XmlTypeAttributeExtraneousInfo属性设置为 IncludeInSchemafalse..
[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)。 该工具写入架构,包括类型定义。