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


C# XdrBuilder.SetAttributePresence方法代码示例

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


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

示例1: XDR_EndAttributeType

        private static void XDR_EndAttributeType(XdrBuilder builder)
        {
            string code = null;
            if (builder._AttributeDef._HasDataType && builder._AttributeDef._AttDef.Datatype != null)
            {
                XmlTokenizedType ttype = builder._AttributeDef._AttDef.Datatype.TokenizedType;

                if (ttype == XmlTokenizedType.ENUMERATION && !builder._AttributeDef._EnumerationRequired)
                {
                    code = SR.Sch_MissDtvaluesAttribute;
                    goto cleanup;
                }

                if (ttype != XmlTokenizedType.ENUMERATION && builder._AttributeDef._EnumerationRequired)
                {
                    code = SR.Sch_RequireEnumeration;
                    goto cleanup;
                }

                // a attributes of type id is not supposed to have a default value
                if (builder._AttributeDef._Default != null && ttype == XmlTokenizedType.ID)
                {
                    code = SR.Sch_DefaultIdValue;
                    goto cleanup;
                }
            }
            else
            {
                builder._AttributeDef._AttDef.Datatype = XmlSchemaDatatype.FromXmlTokenizedType(XmlTokenizedType.CDATA);
            }

            //
            // constraints
            //
            CompareMinMaxLength(builder._AttributeDef._MinLength, builder._AttributeDef._MaxLength, builder);
            builder._AttributeDef._AttDef.MaxLength = builder._AttributeDef._MaxLength;
            builder._AttributeDef._AttDef.MinLength = builder._AttributeDef._MinLength;

            //
            // checkAttributeType 
            //
            if (builder._AttributeDef._Default != null)
            {
                builder._AttributeDef._AttDef.DefaultValueRaw = builder._AttributeDef._AttDef.DefaultValueExpanded = (string)builder._AttributeDef._Default;
                builder.CheckDefaultAttValue(builder._AttributeDef._AttDef);
            }

            builder.SetAttributePresence(builder._AttributeDef._AttDef, builder._AttributeDef._Required);

        cleanup:
            if (code != null)
            {
                builder.SendValidationEvent(code);
            }
        }
开发者ID:dotnet,项目名称:corefx,代码行数:55,代码来源:XdrBuilder.cs

示例2: XDR_EndAttributeType

 private static void XDR_EndAttributeType(XdrBuilder builder)
 {
     string code = null;
     if (builder._AttributeDef._HasDataType && (builder._AttributeDef._AttDef.Datatype != null))
     {
         XmlTokenizedType tokenizedType = builder._AttributeDef._AttDef.Datatype.TokenizedType;
         if ((tokenizedType == XmlTokenizedType.ENUMERATION) && !builder._AttributeDef._EnumerationRequired)
         {
             code = "Sch_MissDtvaluesAttribute";
         }
         else if ((tokenizedType != XmlTokenizedType.ENUMERATION) && builder._AttributeDef._EnumerationRequired)
         {
             code = "Sch_RequireEnumeration";
         }
         else
         {
             if ((builder._AttributeDef._Default == null) || (tokenizedType != XmlTokenizedType.ID))
             {
                 goto Label_00A3;
             }
             code = "Sch_DefaultIdValue";
         }
         goto Label_0164;
     }
     builder._AttributeDef._AttDef.Datatype = XmlSchemaDatatype.FromXmlTokenizedType(XmlTokenizedType.CDATA);
 Label_00A3:
     CompareMinMaxLength(builder._AttributeDef._MinLength, builder._AttributeDef._MaxLength, builder);
     builder._AttributeDef._AttDef.MaxLength = builder._AttributeDef._MaxLength;
     builder._AttributeDef._AttDef.MinLength = builder._AttributeDef._MinLength;
     if (builder._AttributeDef._Default != null)
     {
         builder._AttributeDef._AttDef.DefaultValueRaw = builder._AttributeDef._AttDef.DefaultValueExpanded = (string) builder._AttributeDef._Default;
         builder.CheckDefaultAttValue(builder._AttributeDef._AttDef);
     }
     builder.SetAttributePresence(builder._AttributeDef._AttDef, builder._AttributeDef._Required);
 Label_0164:
     if (code != null)
     {
         builder.SendValidationEvent(code);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:41,代码来源:XdrBuilder.cs


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