System.Xml.Serialization.TypeDesc.CheckSupported C# (CSharp) Method

CheckSupported() private method

private CheckSupported ( ) : void
return void
        internal void CheckSupported()
        {
            if (IsUnsupported)
            {
                if (Exception != null)
                {
                    throw Exception;
                }
                else
                {
                    throw new NotSupportedException(SR.Format(SR.XmlSerializerUnsupportedType, FullName));
                }
            }
            if (_baseTypeDesc != null)
                _baseTypeDesc.CheckSupported();
            if (_arrayElementTypeDesc != null)
                _arrayElementTypeDesc.CheckSupported();
        }

Usage Example

Example #1
0
        internal TypeDesc GetArrayTypeDesc(Type type)
        {
            TypeDesc typeDesc = (TypeDesc)_arrayTypeDescs[type];

            if (typeDesc == null)
            {
                typeDesc = GetTypeDesc(type);
                if (!typeDesc.IsArrayLike)
                {
                    typeDesc = ImportTypeDesc(type, null, false);
                }
                typeDesc.CheckSupported();
                _arrayTypeDescs.Add(type, typeDesc);
            }
            return(typeDesc);
        }
All Usage Examples Of System.Xml.Serialization.TypeDesc::CheckSupported