本文整理汇总了C#中System.Xml.Schema.XmlSchemaSimpleType.SetFinalResolved方法的典型用法代码示例。如果您正苦于以下问题:C# XmlSchemaSimpleType.SetFinalResolved方法的具体用法?C# XmlSchemaSimpleType.SetFinalResolved怎么用?C# XmlSchemaSimpleType.SetFinalResolved使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.Schema.XmlSchemaSimpleType
的用法示例。
在下文中一共展示了XmlSchemaSimpleType.SetFinalResolved方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PreprocessSimpleType
private void PreprocessSimpleType(XmlSchemaSimpleType simpleType, bool local) {
if (local) {
if (simpleType.Name != null) {
SendValidationEvent(Res.Sch_ForbiddenAttribute, "name", simpleType);
}
}
else {
if (simpleType.Name != null) {
ValidateNameAttribute(simpleType);
simpleType.SetQualifiedName(new XmlQualifiedName(simpleType.Name, this.targetNamespace));
}
else {
SendValidationEvent(Res.Sch_MissRequiredAttribute, "name", simpleType);
}
if (simpleType.Final == XmlSchemaDerivationMethod.All) {
simpleType.SetFinalResolved(XmlSchemaDerivationMethod.All);
}
else if (simpleType.Final == XmlSchemaDerivationMethod.None) {
if (this.finalDefault == XmlSchemaDerivationMethod.All) {
simpleType.SetFinalResolved(XmlSchemaDerivationMethod.All);
}
else {
simpleType.SetFinalResolved(this.finalDefault & simpleTypeFinalAllowed);
}
}
else {
if ((simpleType.Final & ~simpleTypeFinalAllowed) != 0) {
SendValidationEvent(Res.Sch_InvalidSimpleTypeFinalValue, simpleType);
}
simpleType.SetFinalResolved(simpleType.Final & simpleTypeFinalAllowed);
}
}
if (simpleType.Content == null) {
SendValidationEvent(Res.Sch_NoSimpleTypeContent, simpleType);
}
else if (simpleType.Content is XmlSchemaSimpleTypeRestriction) {
XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction)simpleType.Content;
//SetParent
SetParent(restriction, simpleType);
for (int i = 0; i < restriction.Facets.Count; ++i) {
SetParent(restriction.Facets[i], restriction);
}
if (restriction.BaseType != null) {
if (!restriction.BaseTypeName.IsEmpty) {
SendValidationEvent(Res.Sch_SimpleTypeRestRefBase, restriction);
}
PreprocessSimpleType(restriction.BaseType, true);
}
else {
if (restriction.BaseTypeName.IsEmpty) {
SendValidationEvent(Res.Sch_SimpleTypeRestRefBaseNone, restriction);
}
else {
ValidateQNameAttribute(restriction, "base", restriction.BaseTypeName);
}
}
PreprocessAnnotation(restriction); //set parent of annotation child of simple type restriction
ValidateIdAttribute(restriction);
}
else if (simpleType.Content is XmlSchemaSimpleTypeList) {
XmlSchemaSimpleTypeList list = (XmlSchemaSimpleTypeList)simpleType.Content;
SetParent(list, simpleType);
if (list.ItemType != null) {
if (!list.ItemTypeName.IsEmpty) {
SendValidationEvent(Res.Sch_SimpleTypeListRefBase, list);
}
SetParent(list.ItemType, list);
PreprocessSimpleType(list.ItemType, true);
}
else {
if (list.ItemTypeName.IsEmpty) {
SendValidationEvent(Res.Sch_SimpleTypeListRefBaseNone, list);
}
else {
ValidateQNameAttribute(list, "itemType", list.ItemTypeName);
}
}
PreprocessAnnotation(list); //set parent of annotation child of simple type list
ValidateIdAttribute(list);
}
else { // union
XmlSchemaSimpleTypeUnion union1 = (XmlSchemaSimpleTypeUnion)simpleType.Content;
SetParent(union1, simpleType);
int baseTypeCount = union1.BaseTypes.Count;
if (union1.MemberTypes != null) {
baseTypeCount += union1.MemberTypes.Length;
XmlQualifiedName[] qNames = union1.MemberTypes;
for (int i = 0; i < qNames.Length; ++i) {
ValidateQNameAttribute(union1, "memberTypes", qNames[i]);
}
}
if (baseTypeCount == 0) {
SendValidationEvent(Res.Sch_SimpleTypeUnionNoBase, union1);
}
for (int i = 0; i < union1.BaseTypes.Count; ++i) {
//.........这里部分代码省略.........
示例2: PreprocessSimpleType
private void PreprocessSimpleType(XmlSchemaSimpleType simpleType, bool local)
{
if (local)
{
if (simpleType.Name != null)
{
base.SendValidationEvent("Sch_ForbiddenAttribute", "name", simpleType);
}
}
else
{
if (simpleType.Name != null)
{
this.ValidateNameAttribute(simpleType);
simpleType.SetQualifiedName(new XmlQualifiedName(simpleType.Name, this.targetNamespace));
}
else
{
base.SendValidationEvent("Sch_MissRequiredAttribute", "name", simpleType);
}
if (simpleType.Final == XmlSchemaDerivationMethod.All)
{
simpleType.SetFinalResolved(XmlSchemaDerivationMethod.All);
}
else if (simpleType.Final == XmlSchemaDerivationMethod.None)
{
if (this.finalDefault == XmlSchemaDerivationMethod.All)
{
simpleType.SetFinalResolved(XmlSchemaDerivationMethod.All);
}
else
{
simpleType.SetFinalResolved(this.finalDefault & (XmlSchemaDerivationMethod.Union | XmlSchemaDerivationMethod.List | XmlSchemaDerivationMethod.Restriction | XmlSchemaDerivationMethod.Extension));
}
}
else
{
if ((simpleType.Final & ~(XmlSchemaDerivationMethod.Union | XmlSchemaDerivationMethod.List | XmlSchemaDerivationMethod.Restriction | XmlSchemaDerivationMethod.Extension)) != XmlSchemaDerivationMethod.Empty)
{
base.SendValidationEvent("Sch_InvalidSimpleTypeFinalValue", simpleType);
}
simpleType.SetFinalResolved(simpleType.Final & (XmlSchemaDerivationMethod.Union | XmlSchemaDerivationMethod.List | XmlSchemaDerivationMethod.Restriction | XmlSchemaDerivationMethod.Extension));
}
}
if (simpleType.Content == null)
{
base.SendValidationEvent("Sch_NoSimpleTypeContent", simpleType);
}
else if (simpleType.Content is XmlSchemaSimpleTypeRestriction)
{
XmlSchemaSimpleTypeRestriction content = (XmlSchemaSimpleTypeRestriction) simpleType.Content;
this.SetParent(content, simpleType);
for (int i = 0; i < content.Facets.Count; i++)
{
this.SetParent(content.Facets[i], content);
}
if (content.BaseType != null)
{
if (!content.BaseTypeName.IsEmpty)
{
base.SendValidationEvent("Sch_SimpleTypeRestRefBase", content);
}
this.PreprocessSimpleType(content.BaseType, true);
}
else if (content.BaseTypeName.IsEmpty)
{
base.SendValidationEvent("Sch_SimpleTypeRestRefBaseNone", content);
}
else
{
this.ValidateQNameAttribute(content, "base", content.BaseTypeName);
}
this.PreprocessAnnotation(content);
this.ValidateIdAttribute(content);
}
else if (simpleType.Content is XmlSchemaSimpleTypeList)
{
XmlSchemaSimpleTypeList child = (XmlSchemaSimpleTypeList) simpleType.Content;
this.SetParent(child, simpleType);
if (child.ItemType != null)
{
if (!child.ItemTypeName.IsEmpty)
{
base.SendValidationEvent("Sch_SimpleTypeListRefBase", child);
}
this.SetParent(child.ItemType, child);
this.PreprocessSimpleType(child.ItemType, true);
}
else if (child.ItemTypeName.IsEmpty)
{
base.SendValidationEvent("Sch_SimpleTypeListRefBaseNone", child);
}
else
{
this.ValidateQNameAttribute(child, "itemType", child.ItemTypeName);
}
this.PreprocessAnnotation(child);
this.ValidateIdAttribute(child);
}
else
//.........这里部分代码省略.........
示例3: PreprocessSimpleType
private void PreprocessSimpleType(XmlSchemaSimpleType simpleType, bool local) {
if (local) {
if (simpleType.Name != null) {
SendValidationEvent(Res.Sch_ForbiddenAttribute, "name", simpleType);
}
}
else {
if (simpleType.Name != null) {
ValidateNameAttribute(simpleType);
simpleType.SetQualifiedName(new XmlQualifiedName(simpleType.Name, this.targetNamespace));
}
else {
SendValidationEvent(Res.Sch_MissRequiredAttribute, "name", simpleType);
}
if (simpleType.Final == XmlSchemaDerivationMethod.All) {
simpleType.SetFinalResolved(XmlSchemaDerivationMethod.All);
}
else if (simpleType.Final == XmlSchemaDerivationMethod.None) {
if (this.finalDefault == XmlSchemaDerivationMethod.All) {
simpleType.SetFinalResolved(XmlSchemaDerivationMethod.All);
}
else {
simpleType.SetFinalResolved(this.finalDefault & simpleTypeFinalAllowed);
}
}
else {
if ((simpleType.Final & ~simpleTypeFinalAllowed) != 0) {
SendValidationEvent(Res.Sch_InvalidSimpleTypeFinalValue, simpleType);
}
simpleType.SetFinalResolved(simpleType.Final & simpleTypeFinalAllowed);
}
}
if (simpleType.Content == null) {
SendValidationEvent(Res.Sch_NoSimpleTypeContent, simpleType);
}
else if (simpleType.Content is XmlSchemaSimpleTypeRestriction) {
XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction)simpleType.Content;
if (restriction.BaseType != null) {
if (!restriction.BaseTypeName.IsEmpty) {
SendValidationEvent(Res.Sch_SimpleTypeRestRefBase, restriction);
}
PreprocessSimpleType(restriction.BaseType, true);
}
else {
if (restriction.BaseTypeName.IsEmpty) {
SendValidationEvent(Res.Sch_SimpleTypeRestRefBase, restriction);
}
else {
ValidateQNameAttribute(restriction, "base", restriction.BaseTypeName);
}
}
ValidateIdAttribute(restriction);
}
else if (simpleType.Content is XmlSchemaSimpleTypeList) {
XmlSchemaSimpleTypeList list = (XmlSchemaSimpleTypeList)simpleType.Content;
if (list.ItemType != null) {
if (!list.ItemTypeName.IsEmpty) {
SendValidationEvent(Res.Sch_SimpleTypeListRefBase, list);
}
PreprocessSimpleType(list.ItemType, true);
}
else {
if (list.ItemTypeName.IsEmpty) {
SendValidationEvent(Res.Sch_SimpleTypeListRefBase, list);
}
else {
ValidateQNameAttribute(list, "itemType", list.ItemTypeName);
}
}
ValidateIdAttribute(list);
}
else { // union
XmlSchemaSimpleTypeUnion union1 = (XmlSchemaSimpleTypeUnion)simpleType.Content;
int baseTypeCount = union1.BaseTypes.Count;
if (union1.MemberTypes != null) {
baseTypeCount += union1.MemberTypes.Length;
foreach(XmlQualifiedName qname in union1.MemberTypes) {
ValidateQNameAttribute(union1, "memberTypes", qname);
}
}
if (baseTypeCount == 0) {
SendValidationEvent(Res.Sch_SimpleTypeUnionNoBase, union1);
}
foreach(XmlSchemaSimpleType type in union1.BaseTypes) {
PreprocessSimpleType(type, true);
}
ValidateIdAttribute(union1);
}
ValidateIdAttribute(simpleType);
}