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


C# XmlSchemaElement.SetFinalResolved方法代码示例

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


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

示例1: PreprocessElement

        private void PreprocessElement(XmlSchemaElement element) {
            if (element.Name != null) {
                ValidateNameAttribute(element);
                element.SetQualifiedName(new XmlQualifiedName(element.Name, this.targetNamespace));
            }
            else {
                SendValidationEvent(Res.Sch_MissRequiredAttribute, "name", element);
            }
            PreprocessElementContent(element);

            if (element.Final == XmlSchemaDerivationMethod.All) {
                element.SetFinalResolved(XmlSchemaDerivationMethod.All);
            }
            else if (element.Final == XmlSchemaDerivationMethod.None) {
                if (this.finalDefault == XmlSchemaDerivationMethod.All) {
                    element.SetFinalResolved(XmlSchemaDerivationMethod.All);
                }
                else {
                    element.SetFinalResolved(this.finalDefault & elementFinalAllowed);
                }
            }
            else {
                if ((element.Final & ~elementFinalAllowed) != 0) {
                    SendValidationEvent(Res.Sch_InvalidElementFinalValue, element);
                }
                element.SetFinalResolved(element.Final & elementFinalAllowed);
            }
            if (element.Form != XmlSchemaForm.None) {
                SendValidationEvent(Res.Sch_ForbiddenAttribute, "form", element);
            }
            if (element.MinOccursString != null) {
                SendValidationEvent(Res.Sch_ForbiddenAttribute, "minOccurs", element);
            }
            if (element.MaxOccursString != null) {
                SendValidationEvent(Res.Sch_ForbiddenAttribute, "maxOccurs", element);
            }
            if (!element.SubstitutionGroup.IsEmpty) {
                ValidateQNameAttribute(element, "type", element.SubstitutionGroup);
                XmlSchemaSubstitutionGroup substitutionGroup = (XmlSchemaSubstitutionGroup)this.schema.Examplars[element.SubstitutionGroup];
                if (substitutionGroup == null) {
                    substitutionGroup = new XmlSchemaSubstitutionGroup();
                    substitutionGroup.Examplar = element.SubstitutionGroup;
                    this.schema.Examplars.Add(element.SubstitutionGroup, substitutionGroup);
                }
                if (substitutionGroup.Members[element.QualifiedName] == null) {
                    substitutionGroup.Members.Add(element.QualifiedName, element);
                }
            }
            ValidateIdAttribute(element);
        }
开发者ID:ArildF,项目名称:masters,代码行数:50,代码来源:compiler.cs

示例2: PreprocessElement

 private void PreprocessElement(XmlSchemaElement element)
 {
     if (element.Name != null)
     {
         this.ValidateNameAttribute(element);
         element.SetQualifiedName(new XmlQualifiedName(element.Name, this.targetNamespace));
     }
     else
     {
         base.SendValidationEvent("Sch_MissRequiredAttribute", "name", element);
     }
     this.PreprocessElementContent(element);
     if (element.Final == XmlSchemaDerivationMethod.All)
     {
         element.SetFinalResolved(XmlSchemaDerivationMethod.All);
     }
     else if (element.Final == XmlSchemaDerivationMethod.None)
     {
         if (this.finalDefault == XmlSchemaDerivationMethod.All)
         {
             element.SetFinalResolved(XmlSchemaDerivationMethod.All);
         }
         else
         {
             element.SetFinalResolved(this.finalDefault & (XmlSchemaDerivationMethod.Restriction | XmlSchemaDerivationMethod.Extension));
         }
     }
     else
     {
         if ((element.Final & ~(XmlSchemaDerivationMethod.Restriction | XmlSchemaDerivationMethod.Extension)) != XmlSchemaDerivationMethod.Empty)
         {
             base.SendValidationEvent("Sch_InvalidElementFinalValue", element);
         }
         element.SetFinalResolved(element.Final & (XmlSchemaDerivationMethod.Restriction | XmlSchemaDerivationMethod.Extension));
     }
     if (element.Form != XmlSchemaForm.None)
     {
         base.SendValidationEvent("Sch_ForbiddenAttribute", "form", element);
     }
     if (element.MinOccursString != null)
     {
         base.SendValidationEvent("Sch_ForbiddenAttribute", "minOccurs", element);
     }
     if (element.MaxOccursString != null)
     {
         base.SendValidationEvent("Sch_ForbiddenAttribute", "maxOccurs", element);
     }
     if (!element.SubstitutionGroup.IsEmpty)
     {
         this.ValidateQNameAttribute(element, "type", element.SubstitutionGroup);
     }
     this.ValidateIdAttribute(element);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:53,代码来源:Preprocessor.cs

示例3: PreprocessElement

        private void PreprocessElement(XmlSchemaElement element)
        {
            if (element.Name != null)
            {
                ValidateNameAttribute(element);
                element.SetQualifiedName(new XmlQualifiedName(element.Name, _targetNamespace));
            }
            else
            {
                SendValidationEvent(SR.Sch_MissRequiredAttribute, "name", element);
            }
            PreprocessElementContent(element);

            if (element.Final == XmlSchemaDerivationMethod.All)
            {
                element.SetFinalResolved(XmlSchemaDerivationMethod.All);
            }
            else if (element.Final == XmlSchemaDerivationMethod.None)
            {
                if (_finalDefault == XmlSchemaDerivationMethod.All)
                {
                    element.SetFinalResolved(XmlSchemaDerivationMethod.All);
                }
                else
                {
                    element.SetFinalResolved(_finalDefault & elementFinalAllowed);
                }
            }
            else
            {
                if ((element.Final & ~elementFinalAllowed) != 0)
                {
                    SendValidationEvent(SR.Sch_InvalidElementFinalValue, element);
                }
                element.SetFinalResolved(element.Final & elementFinalAllowed);
            }
            if (element.Form != XmlSchemaForm.None)
            {
                SendValidationEvent(SR.Sch_ForbiddenAttribute, "form", element);
            }
            if (element.MinOccursString != null)
            {
                SendValidationEvent(SR.Sch_ForbiddenAttribute, "minOccurs", element);
            }
            if (element.MaxOccursString != null)
            {
                SendValidationEvent(SR.Sch_ForbiddenAttribute, "maxOccurs", element);
            }
            if (!element.SubstitutionGroup.IsEmpty)
            {
                ValidateQNameAttribute(element, "type", element.SubstitutionGroup);
            }
            ValidateIdAttribute(element);
        }
开发者ID:geoffkizer,项目名称:corefx,代码行数:54,代码来源:SchemaCollectionpreProcessor.cs


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