• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# XmlTypeCode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中XmlTypeCode的典型用法代码示例。如果您正苦于以下问题:C# XmlTypeCode类的具体用法?C# XmlTypeCode怎么用?C# XmlTypeCode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



XmlTypeCode类属于命名空间,在下文中一共展示了XmlTypeCode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CreateGetBuiltInSimpleType

 internal static CodeExpression CreateGetBuiltInSimpleType(XmlTypeCode typeCode)  {
     return CodeDomHelper.CreateMethodCall(
             new CodeTypeReferenceExpression("XmlSchemaType"),
             Constants.GetBuiltInSimpleType,
             CodeDomHelper.CreateFieldReference(Constants.XmlTypeCode, typeCode.ToString()));
             
 }
开发者ID:o2platform,项目名称:O2.Platform.Projects,代码行数:7,代码来源:SimpleTypeCodeDomHelper.cs


示例2: IsDataTypeAttributeAllowed

 private static bool? IsDataTypeAttributeAllowed(XmlTypeCode typeCode, GeneratorConfiguration configuration)
 {
     bool? result;
     switch (typeCode)
     {
         case XmlTypeCode.AnyAtomicType:
             // union
             result = false;
             break;
         case XmlTypeCode.Integer:
         case XmlTypeCode.NegativeInteger:
         case XmlTypeCode.NonNegativeInteger:
         case XmlTypeCode.NonPositiveInteger:
         case XmlTypeCode.PositiveInteger:
             if (configuration.IntegerDataType != null && configuration.IntegerDataType != typeof(string))
                 result = false;
             else
                 result = null;
             break;
         case XmlTypeCode.Base64Binary:
         case XmlTypeCode.HexBinary:
             result = true;
             break;
         default:
             result = null;
             break;
     }
     return result;
 }
开发者ID:imileusnic,项目名称:XmlSchemaClassGenerator,代码行数:29,代码来源:CodeUtilities.cs


示例3: Init

		private void Init (DateTime value, XmlSchemaType xmlType)
		{
			if (xmlType == null)
				throw new ArgumentNullException ("xmlType");
			xmlTypeCode = XmlTypeCode.DateTime;
			this.dateTimeValue = value;
			schemaType = xmlType;
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:8,代码来源:XmlAtomicValue.cs


示例4: GetBuiltInComplexType

 public static XmlSchemaComplexType GetBuiltInComplexType(XmlTypeCode typeCode)
 {
     if (typeCode == XmlTypeCode.Item)
     {
         return XmlSchemaComplexType.AnyType;
     }
     return null;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:XmlSchemaType.cs


示例5: Init

		private void Init (byte [] value, XmlSchemaType xmlType)
		{
			if (xmlType == null)
				throw new ArgumentNullException ("xmlType");
			xmlTypeCode = XmlTypeCode.Base64Binary;
			this.bytesValue = value;
			schemaType = xmlType;
		}
开发者ID:nobled,项目名称:mono,代码行数:8,代码来源:XmlAtomicValue.cs


示例6: GetFacetsChecker

        internal static FacetsChecker GetFacetsChecker(XmlTypeCode typeCode)
        {
            if (FacetsCheckerMapping == null)
            {
                InitMapping();
            }

            return FacetsCheckerMapping[typeCode];
            
        }
开发者ID:alcardac,项目名称:SDMXRI_WS_OF,代码行数:10,代码来源:FacetChecker.cs


示例7: FacetsCompiler

 public FacetsCompiler(DatatypeImplementation baseDatatype, RestrictionFacets restriction) {
     firstPattern = true;
     regStr = null;
     pattern_facet = null;
     datatype = baseDatatype;
     derivedRestriction = restriction;
     baseFlags = datatype.Restriction != null ? datatype.Restriction.Flags : 0;
     baseFixedFlags = datatype.Restriction != null ? datatype.Restriction.FixedFlags : 0;
     validRestrictionFlags = datatype.ValidRestrictionFlags;
     nonNegativeInt = DatatypeImplementation.GetSimpleTypeFromTypeCode(XmlTypeCode.NonNegativeInteger).Datatype;
     builtInEnum = !(datatype is Datatype_union || datatype is Datatype_List) ? datatype.TypeCode : 0;
     builtInType = (int)builtInEnum > 0 ? DatatypeImplementation.GetSimpleTypeFromTypeCode(builtInEnum).Datatype : datatype;
 }
开发者ID:uQr,项目名称:referencesource,代码行数:13,代码来源:FacetChecker.cs


示例8: FacetsCompiler

 public FacetsCompiler(DatatypeImplementation baseDatatype, RestrictionFacets restriction)
 {
     _firstPattern = true;
     _regStr = null;
     _pattern_facet = null;
     _datatype = baseDatatype;
     _derivedRestriction = restriction;
     _baseFlags = _datatype.Restriction != null ? _datatype.Restriction.Flags : 0;
     _baseFixedFlags = _datatype.Restriction != null ? _datatype.Restriction.FixedFlags : 0;
     _validRestrictionFlags = _datatype.ValidRestrictionFlags;
     _nonNegativeInt = DatatypeImplementation.GetSimpleTypeFromTypeCode(XmlTypeCode.NonNegativeInteger).Datatype;
     _builtInEnum = !(_datatype is Datatype_union || _datatype is Datatype_List) ? _datatype.TypeCode : 0;
     _builtInType = (int)_builtInEnum > 0 ? DatatypeImplementation.GetSimpleTypeFromTypeCode(_builtInEnum).Datatype : _datatype;
 }
开发者ID:geoffkizer,项目名称:corefx,代码行数:14,代码来源:FacetChecker.cs


示例9: CheckBuiltInFacets

        private Exception CheckBuiltInFacets(string s, XmlTypeCode typeCode, bool verifyUri)
        {
            Exception exception = null;
            switch (typeCode)
            {
                case XmlTypeCode.AnyUri:
                    if (verifyUri)
                    {
                        Uri uri;
                        exception = XmlConvert.TryToUri(s, out uri);
                    }
                    return exception;

                case XmlTypeCode.QName:
                case XmlTypeCode.Notation:
                    return exception;

                case XmlTypeCode.NormalizedString:
                    return XmlConvert.TryVerifyNormalizedString(s);

                case XmlTypeCode.Token:
                    return XmlConvert.TryVerifyTOKEN(s);

                case XmlTypeCode.Language:
                    if ((s != null) && (s.Length != 0))
                    {
                        if (!LanguagePattern.IsMatch(s))
                        {
                            return new XmlSchemaException("Sch_InvalidLanguageId", string.Empty);
                        }
                        return exception;
                    }
                    return new XmlSchemaException("Sch_EmptyAttributeValue", string.Empty);

                case XmlTypeCode.NmToken:
                    return XmlConvert.TryVerifyNMTOKEN(s);

                case XmlTypeCode.Name:
                    return XmlConvert.TryVerifyName(s);

                case XmlTypeCode.NCName:
                case XmlTypeCode.Id:
                case XmlTypeCode.Idref:
                case XmlTypeCode.Entity:
                    return XmlConvert.TryVerifyNCName(s);
            }
            return exception;
        }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:48,代码来源:StringFacetsChecker.cs


示例10: GetFallbackType

		public static XmlTypeCode GetFallbackType (XmlTypeCode type)
		{
			switch (type) {
			case XmlTypeCode.AnyAtomicType:
				return XmlTypeCode.Item;
			case XmlTypeCode.UntypedAtomic:
				return XmlTypeCode.String;
			case XmlTypeCode.Notation:
				return XmlTypeCode.QName;
			case XmlTypeCode.NormalizedString:
			case XmlTypeCode.Token:
			case XmlTypeCode.Language:
			case XmlTypeCode.NmToken:
			case XmlTypeCode.Name:
			case XmlTypeCode.NCName:
			case XmlTypeCode.Id:
			case XmlTypeCode.Idref:
			case XmlTypeCode.Entity:
				return XmlTypeCode.String;
			case XmlTypeCode.NonPositiveInteger:
				return XmlTypeCode.Decimal;
			case XmlTypeCode.NegativeInteger:
				return XmlTypeCode.NonPositiveInteger;
			case XmlTypeCode.Long:
				return XmlTypeCode.Integer;
			case XmlTypeCode.Short:
				return XmlTypeCode.Int;
			case XmlTypeCode.Byte:
				return XmlTypeCode.Int;
			case XmlTypeCode.NonNegativeInteger:
				return XmlTypeCode.Decimal;
			case XmlTypeCode.UnsignedLong:
				return XmlTypeCode.NonNegativeInteger;
			case XmlTypeCode.UnsignedInt:
				return XmlTypeCode.Integer;
			case XmlTypeCode.UnsignedShort:
				return XmlTypeCode.Int;
			case XmlTypeCode.UnsignedByte:
				return XmlTypeCode.UnsignedShort;
			case XmlTypeCode.PositiveInteger:
				return XmlTypeCode.NonNegativeInteger;
			default:
				return XmlTypeCode.None;
			}
		}
开发者ID:nlhepler,项目名称:mono,代码行数:45,代码来源:XQueryConvert.cs


示例11: GetEffectiveType

 private static Type GetEffectiveType(XmlTypeCode typeCode, XmlSchemaDatatypeVariety variety, GeneratorConfiguration configuration)
 {
     Type result;
     switch (typeCode)
     {
         case XmlTypeCode.AnyAtomicType:
             // union
             result = typeof(string);
             break;
         case XmlTypeCode.AnyUri:
         case XmlTypeCode.Duration:
         case XmlTypeCode.GDay:
         case XmlTypeCode.GMonth:
         case XmlTypeCode.GMonthDay:
         case XmlTypeCode.GYear:
         case XmlTypeCode.GYearMonth:
         case XmlTypeCode.Time:
             result = variety == XmlSchemaDatatypeVariety.List ? typeof(string[]) : typeof(string);
             break;
         case XmlTypeCode.Integer:
         case XmlTypeCode.NegativeInteger:
         case XmlTypeCode.NonNegativeInteger:
         case XmlTypeCode.NonPositiveInteger:
         case XmlTypeCode.PositiveInteger:
             if (configuration.IntegerDataType == null || configuration.IntegerDataType == typeof(string))
                 result = typeof(string);
             else
             {
                 result = configuration.IntegerDataType;
             }
             break;
         default:
             result = null;
             break;
     }
     return result;
 }
开发者ID:imileusnic,项目名称:XmlSchemaClassGenerator,代码行数:37,代码来源:CodeUtilities.cs


示例12: CheckBuiltInFacets

        private Exception CheckBuiltInFacets(string s, XmlTypeCode typeCode, bool verifyUri) {
            Exception exception = null;

            switch (typeCode) {

                case XmlTypeCode.AnyUri:
                    if (verifyUri) {
                        Uri uri;
                        exception = XmlConvert.TryToUri(s, out uri);
                    }
                    break;

                case XmlTypeCode.NormalizedString:
                    exception = XmlConvert.TryVerifyNormalizedString(s);
                    break;

                case XmlTypeCode.Token:
                    exception = XmlConvert.TryVerifyTOKEN(s);
                    break;

                case XmlTypeCode.Language:
                    if (s == null || s.Length == 0) {
                        return new XmlSchemaException(Res.Sch_EmptyAttributeValue, string.Empty);
                    }
                    if (!LanguagePattern.IsMatch(s)) {
                        return new XmlSchemaException(Res.Sch_InvalidLanguageId, string.Empty);
                    }
                    break;

                case XmlTypeCode.NmToken:
                    exception = XmlConvert.TryVerifyNMTOKEN(s);
                    break;

                case XmlTypeCode.Name:
                    exception = XmlConvert.TryVerifyName(s);
                    break;

                case XmlTypeCode.NCName:
                case XmlTypeCode.Id:
                case XmlTypeCode.Idref:
                case XmlTypeCode.Entity:
                    exception = XmlConvert.TryVerifyNCName(s);
                    break;
                default:
                    break;
            }
            return exception;
        }
开发者ID:uQr,项目名称:referencesource,代码行数:48,代码来源:FacetChecker.cs


示例13: ConvertToType

 public QilNode ConvertToType(XmlTypeCode requiredType, QilNode n) {
     switch (requiredType) {
     case XmlTypeCode.String     : return ConvertToString(n);
     case XmlTypeCode.Double     : return ConvertToNumber(n);
     case XmlTypeCode.Boolean    : return ConvertToBoolean(n);
     case XmlTypeCode.Node       : return EnsureNodeSet(n);
     case XmlTypeCode.Item       : return n;
     default                     : Debug.Fail("Unexpected XmlTypeCode: " + requiredType); return null;
     }
 }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:10,代码来源:xpathqilfactory.cs


示例14: GetPrimitiveTypeCode

 internal static XmlTypeCode GetPrimitiveTypeCode(XmlTypeCode typeCode) {
     XmlSchemaSimpleType currentType = enumToTypeCode[(int)typeCode];
     while (currentType.BaseXmlSchemaType != DatatypeImplementation.AnySimpleType) {
         currentType = currentType.BaseXmlSchemaType as XmlSchemaSimpleType;
         Debug.Assert(currentType != null);
     }
     return currentType.TypeCode;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:8,代码来源:DataTypeImplementation.cs


示例15: GetSimpleTypeFromTypeCode

 internal static XmlSchemaSimpleType GetSimpleTypeFromTypeCode(XmlTypeCode typeCode) {
     return enumToTypeCode[(int) typeCode];
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:3,代码来源:DataTypeImplementation.cs


示例16: MatchesXmlType

        /// <summary>
        /// Return true if the type of "seq" is a subtype of a singleton type identified by "code".
        /// </summary>
        public bool MatchesXmlType(IList<XPathItem> seq, XmlTypeCode code) {
            if (seq.Count != 1)
                return false;

            return MatchesXmlType(seq[0], code);
        }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:9,代码来源:xmlqueryruntime.cs


示例17: GetBuiltInSimpleType

 /// <include file='doc\XmlSchemaType.uex' path='docs/doc[@for="XmlSchemaType.GetXsdSimpleType"]/*' />
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 public static XmlSchemaSimpleType GetBuiltInSimpleType(XmlTypeCode typeCode) {
     return DatatypeImplementation.GetSimpleTypeFromTypeCode(typeCode);
 }
开发者ID:uQr,项目名称:referencesource,代码行数:7,代码来源:XmlSchemaType.cs


示例18: IsIntegralType

 private bool IsIntegralType(XmlTypeCode defaultTypeCode) {
     switch (defaultTypeCode) {
         case XmlTypeCode.Integer:
         case XmlTypeCode.NegativeInteger:
         case XmlTypeCode.NonNegativeInteger:
         case XmlTypeCode.NonPositiveInteger:
         case XmlTypeCode.PositiveInteger:
         case XmlTypeCode.Long:
         case XmlTypeCode.Int:
         case XmlTypeCode.Short:
         case XmlTypeCode.Byte:
         case XmlTypeCode.UnsignedLong:
         case XmlTypeCode.UnsignedInt:
         case XmlTypeCode.UnsignedShort:
         case XmlTypeCode.UnsignedByte:
            return true;
         default:
             return false;
     }
 }
开发者ID:geoffkizer,项目名称:corefx,代码行数:20,代码来源:XmlSchemaDataType.cs


示例19: TypeCodeToString

        internal string TypeCodeToString(XmlTypeCode typeCode)
        {
            switch (typeCode)
            {
                case XmlTypeCode.None:
                    return "None";
                case XmlTypeCode.Item:
                    return "AnyType";
                case XmlTypeCode.AnyAtomicType:
                    return "AnyAtomicType";
                case XmlTypeCode.String:
                    return "String";
                case XmlTypeCode.Boolean:
                    return "Boolean";
                case XmlTypeCode.Decimal:
                    return "Decimal";
                case XmlTypeCode.Float:
                    return "Float";
                case XmlTypeCode.Double:
                    return "Double";
                case XmlTypeCode.Duration:
                    return "Duration";
                case XmlTypeCode.DateTime:
                    return "DateTime";
                case XmlTypeCode.Time:
                    return "Time";
                case XmlTypeCode.Date:
                    return "Date";
                case XmlTypeCode.GYearMonth:
                    return "GYearMonth";
                case XmlTypeCode.GYear:
                    return "GYear";
                case XmlTypeCode.GMonthDay:
                    return "GMonthDay";
                case XmlTypeCode.GDay:
                    return "GDay";
                case XmlTypeCode.GMonth:
                    return "GMonth";
                case XmlTypeCode.HexBinary:
                    return "HexBinary";
                case XmlTypeCode.Base64Binary:
                    return "Base64Binary";
                case XmlTypeCode.AnyUri:
                    return "AnyUri";
                case XmlTypeCode.QName:
                    return "QName";
                case XmlTypeCode.Notation:
                    return "Notation";
                case XmlTypeCode.NormalizedString:
                    return "NormalizedString";
                case XmlTypeCode.Token:
                    return "Token";
                case XmlTypeCode.Language:
                    return "Language";
                case XmlTypeCode.NmToken:
                    return "NmToken";
                case XmlTypeCode.Name:
                    return "Name";
                case XmlTypeCode.NCName:
                    return "NCName";
                case XmlTypeCode.Id:
                    return "Id";
                case XmlTypeCode.Idref:
                    return "Idref";
                case XmlTypeCode.Entity:
                    return "Entity";
                case XmlTypeCode.Integer:
                    return "Integer";
                case XmlTypeCode.NonPositiveInteger:
                    return "NonPositiveInteger";
                case XmlTypeCode.NegativeInteger:
                    return "NegativeInteger";
                case XmlTypeCode.Long:
                    return "Long";
                case XmlTypeCode.Int:
                    return "Int";
                case XmlTypeCode.Short:
                    return "Short";
                case XmlTypeCode.Byte:
                    return "Byte";
                case XmlTypeCode.NonNegativeInteger:
                    return "NonNegativeInteger";
                case XmlTypeCode.UnsignedLong:
                    return "UnsignedLong";
                case XmlTypeCode.UnsignedInt:
                    return "UnsignedInt";
                case XmlTypeCode.UnsignedShort:
                    return "UnsignedShort";
                case XmlTypeCode.UnsignedByte:
                    return "UnsignedByte";
                case XmlTypeCode.PositiveInteger:
                    return "PositiveInteger";

                default:
                    return typeCode.ToString();
            }
        }
开发者ID:geoffkizer,项目名称:corefx,代码行数:97,代码来源:XmlSchemaDataType.cs


示例20: CheckBuiltInFacets

        private Exception CheckBuiltInFacets(string s, XmlTypeCode typeCode, bool verifyUri)
        {
            Exception exception = null;

            switch (typeCode) {
                case XmlTypeCode.AnyUri:
                    
                    if (verifyUri) {
                        Uri uri = null;
                        exception = XmlConvertExt.TryToUri(s, out uri);
                    }
                    break;

                case XmlTypeCode.NormalizedString:
                    exception = XmlConvertExt.VerifyNormalizedString(s);
                    break;

                case XmlTypeCode.Token:
                    try
                    {
                        XmlConvert.VerifyTOKEN(s);
                    }
                    catch (Exception e)
                    {
                        exception = e;
                    }
                    break;

                case XmlTypeCode.Language:
                    if (s == null || s.Length == 0)  {
                        exception = new LinqToXsdException();
                    }
                    if (!LanguagePattern.IsMatch(s)) {
                        exception = new LinqToXsdException();
                    }
                    break;

                case XmlTypeCode.NmToken:
                    try
                    {
                        XmlConvert.VerifyNMTOKEN(s);
                    }
                    catch (Exception e)
                    {
                        exception = e;
                    }
                    break;

                case XmlTypeCode.Name:
                    try
                    {
                        XmlConvert.VerifyName(s);
                    }
                    catch(Exception e) {
                        exception = e;
                    }
                    
                    break;

                case XmlTypeCode.NCName:
                case XmlTypeCode.Id:
                case XmlTypeCode.Idref:
                case XmlTypeCode.Entity:
                    try
                    {
                        XmlConvert.VerifyNCName(s);
                    }
                    catch (Exception e)
                    {
                        exception = e;
                    }
                    break;
                default:
                    break;
            }
            return exception;
        }
开发者ID:alcardac,项目名称:SDMXRI_WS_OF,代码行数:77,代码来源:FacetChecker.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# XmlWriteMode类代码示例发布时间:2022-05-24
下一篇:
C# XmlTextWriter类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap