本文整理汇总了C#中System.Xml.Schema.XsdBuilder.AddAttribute方法的典型用法代码示例。如果您正苦于以下问题:C# XsdBuilder.AddAttribute方法的具体用法?C# XsdBuilder.AddAttribute怎么用?C# XsdBuilder.AddAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.Schema.XsdBuilder
的用法示例。
在下文中一共展示了XsdBuilder.AddAttribute方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitAttribute
/*
<attribute
form = qualified | unqualified
id = ID
name = NCName
ref = QName
type = QName
use = prohibited | optional | required | default | fixed : optional
value = string
{any attributes with non-schema namespace . . .}>
Content: (annotation? , (simpleType?))
</attribute>
*/
private static void InitAttribute(XsdBuilder builder, string value) {
builder.xso = builder.attribute = new XmlSchemaAttribute();
if (builder.ParentElement == SchemaNames.Token.XsdSchema)
builder.schema.Items.Add(builder.attribute);
else
builder.AddAttribute(builder.attribute);
builder.canIncludeImport = false; // disable import and include elements in schema
}
示例2: InitAttributeGroupRef
/*
<attributeGroup
id = ID
ref = QName
{any attributes with non-schema namespace . . .}>
Content: (annotation?)
</attributeGroup>
*/
private static void InitAttributeGroupRef(XsdBuilder builder, string value) {
builder.xso = builder.attributeGroupRef = new XmlSchemaAttributeGroupRef();
builder.AddAttribute(builder.attributeGroupRef);
}
示例3: InitAttribute
private static void InitAttribute(XsdBuilder builder, string value)
{
builder.xso = builder.attribute = new XmlSchemaAttribute();
if (builder.ParentElement == SchemaNames.Token.XsdSchema)
{
builder.schema.Items.Add(builder.attribute);
}
else
{
builder.AddAttribute(builder.attribute);
}
builder.canIncludeImport = false;
}