当前位置: 首页>>代码示例>>C#>>正文


C# XmlSchemaSimpleType.SetQualifiedName方法代码示例

本文整理汇总了C#中System.Xml.Schema.XmlSchemaSimpleType.SetQualifiedName方法的典型用法代码示例。如果您正苦于以下问题:C# XmlSchemaSimpleType.SetQualifiedName方法的具体用法?C# XmlSchemaSimpleType.SetQualifiedName怎么用?C# XmlSchemaSimpleType.SetQualifiedName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Xml.Schema.XmlSchemaSimpleType的用法示例。


在下文中一共展示了XmlSchemaSimpleType.SetQualifiedName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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
//.........这里部分代码省略.........
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:101,代码来源:Preprocessor.cs

示例2: StartBuiltinType

        /// <summary>
        /// Begin the creation of an XmlSchemaSimpleType object that will be used to represent a static built-in type.
        /// Once StartBuiltinType has been called for all built-in types, FinishBuiltinType should be called in order
        /// to create links between the types.
        /// </summary>
        internal static XmlSchemaSimpleType StartBuiltinType(XmlQualifiedName qname, XmlSchemaDatatype dataType) {
            XmlSchemaSimpleType simpleType;
            Debug.Assert(qname != null && dataType != null);

            simpleType = new XmlSchemaSimpleType();
            simpleType.SetQualifiedName(qname);
            simpleType.SetDatatype(dataType);
            simpleType.ElementDecl = new SchemaElementDecl(dataType);
            simpleType.ElementDecl.SchemaType = simpleType;

            return simpleType;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:17,代码来源:DataTypeImplementation.cs

示例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);
        }
开发者ID:ArildF,项目名称:masters,代码行数:92,代码来源:compiler.cs

示例4: 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) {
//.........这里部分代码省略.........
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:101,代码来源:Preprocessor.cs

示例5: StartBuiltinType

 internal static XmlSchemaSimpleType StartBuiltinType(XmlQualifiedName qname, XmlSchemaDatatype dataType)
 {
     XmlSchemaSimpleType type = new XmlSchemaSimpleType();
     type.SetQualifiedName(qname);
     type.SetDatatype(dataType);
     type.ElementDecl = new SchemaElementDecl(dataType);
     type.ElementDecl.SchemaType = type;
     return type;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:DatatypeImplementation.cs


注:本文中的System.Xml.Schema.XmlSchemaSimpleType.SetQualifiedName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。