70 if (defaultNamespace ==
null)
72 defaultNamespace =
string.Empty;
241 text = defaultNamespace;
382 if (dataType.Length > 0)
407 switch (
model.TypeDesc.Kind)
437 if (
model.TypeDesc.IsOptionalValue)
457 else if (
a.XmlFlags != 0)
461 if (
model.TypeDesc.IsSpecial)
584 if (!
baseQname.IsEmpty && !(
baseQname.Namespace ==
"http://www.w3.org/2001/XMLSchema"))
611 return context
switch
720 if (
a.XmlType !=
null &&
a.XmlType.Namespace !=
null)
722 text =
a.XmlType.Namespace;
724 else if (
a.XmlRoot !=
null &&
a.XmlRoot.Namespace !=
null)
726 text =
a.XmlRoot.Namespace;
745 if (
a.XmlType !=
null)
773 if (
mapping.IsFullyInitialized)
777 if (
model.TypeDesc.BaseTypeDesc !=
null)
807 if (!
mapping.BaseMapping.HasExplicitSequence())
860 if (
mapping.XmlnsMember !=
null)
904 if (
mapping.BaseMapping ==
null)
908 if (
mapping.XmlnsMember !=
null &&
mapping.BaseMapping.HasXmlnsMember)
923 if (
a.XmlType !=
null &&
a.XmlType.AnonymousType)
926 if (!
string.IsNullOrEmpty(@
namespace))
954 if (
a.XmlType !=
null &&
a.XmlType.TypeName.Length > 0)
956 text =
a.XmlType.TypeName;
958 if (
type.IsGenericType &&
text.Contains(
'{'))
969 if (!
text.Contains(
'{'))
982 for (
int i = 0; i < attributes.
Count; i++)
984 if (attributes[i].NestingLevel == level)
1004 if (
mapping.Elements.Length == 1)
1016 if (attributes.
XmlType !=
null)
1021 flag = name ==
null;
1167 if (dataType.Length > 0)
1224 for (
int i = 0; i <
model.Constants.Length; i++)
1232 if (
list.Count == 0)
1253 if (attributes.
XmlEnum ==
null)
1274 for (
int i = 0; i <
array.Length; i++)
1337 [
RequiresUnreferencedCode(
"Calls TypeScope.GetTypeDesc(Type) and XmlReflectionImporter.ImportAccessorMapping both of which RequireUnreferencedCode")]
1440 if (
a.XmlChoiceIdentifier !=
null)
1494 else if (
array.Length > 1)
1513 while (attributes !=
null && num < attributes.
Count)
1547 string name =
model.Name;
1568 if (
a.XmlChoiceIdentifier !=
null)
1585 if (
a.XmlAttribute !=
null && !
accessor.TypeDesc.ArrayElementTypeDesc.IsPrimitive && !
accessor.TypeDesc.ArrayElementTypeDesc.IsEnum)
1594 if (
a.XmlAnyAttribute !=
null)
1630 if (
a.XmlText !=
null)
1643 if (
a.XmlText ==
null &&
a.XmlElements.
Count == 0 &&
a.XmlAnyElements.
Count == 0)
1647 for (
int i = 0; i <
a.XmlElements.
Count; i++)
1656 if (
a.XmlElements.
Count == 1)
1689 for (
int j = 0;
j <
a.XmlAnyElements.
Count;
j++)
1748 if (
a.XmlArray ==
null)
1765 num =
a.XmlArray.Order;
1778 else if (!
accessor.TypeDesc.IsVoid)
1787 if (
a.XmlAnyElements.
Count > 0)
1791 if (
a.XmlAttribute !=
null)
1793 if (
a.XmlElements.
Count > 0)
1797 if (
a.XmlAttribute.Type !=
null)
1826 if (
a.XmlText !=
null)
1828 if (
a.XmlText.Type !=
null &&
a.XmlText.Type !=
fieldType)
1837 else if (
a.XmlElements.
Count == 0)
1841 for (
int k = 0;
k <
a.XmlElements.
Count;
k++)
1898 if (
a.XmlAttribute !=
null ||
a.XmlText !=
null)
1906 if (
a.XmlElements.
Count == 0 &&
a.XmlAnyElements.
Count == 0)
1910 for (
int l = 0;
l <
a.XmlElements.
Count;
l++)
1919 if (
a.XmlElements.
Count == 1)
1952 for (
int m = 0;
m <
a.XmlAnyElements.
Count;
m++)
2018 if (
accessor.ChoiceIdentifier !=
null)
2021 for (
int n = 0;
n <
accessor.Elements.Length;
n++)
2077 if (
a.XmlElements !=
null &&
a.XmlElements.
Count > 0)
2079 if (
a.XmlElements.
Count > 1)
2093 if (
a.XmlArray !=
null &&
a.XmlArray.Namespace !=
null)
2112 hashtable.
Add(
key,
false);
2144 int num =
xmlName.LastIndexOf(
':');
2145 string name = ((num < 0) ?
xmlName :
xmlName.Substring(num + 1));
2146 string ns = ((num < 0) ?
"" :
xmlName.Substring(0, num));
2157 if (
a.XmlDefaultValue ==
null ||
a.XmlDefaultValue ==
DBNull.
Value)
2164 return a.XmlDefaultValue;
2168 string text =
Enum.
Format(t,
a.XmlDefaultValue,
"G").Replace(
",",
" ");
2176 return a.XmlDefaultValue;
2220 for (
int i = 0; i < member.
Elements.Length; i++)
2268 defaultNamespace = defaultNamespace ??
string.Empty;
2279 string text =
string.Empty;
2284 if (
text.Length == 0)
static bool IsValidLanguageIndependentIdentifier(string value)
bool ICollection< KeyValuePair< TKey, TValue > >. Contains(KeyValuePair< TKey, TValue > keyValuePair)
void Add(TKey key, TValue value)
virtual bool Contains(object key)
virtual void Add(object key, object? value)
static ? string ToString(object? value)
static readonly DBNull Value
static string Format(Type enumType, object value, string format)
static CultureInfo InvariantCulture
static string XmlRpcLitArrayElement
static string XmlTypeReflectionError
static string XmlIllegalType
static string XmlChoiceIdentifierTypeEnum
static string XmlSequenceUnique
static string XmlInvalidConstantAttribute
static string XmlInvalidAttributeUse
static string XmlRpcLitElementNullable
static string XmlFieldReflectionError
static string XmlInvalidNotNullable
static string XmlMethodTypeNameConflict
static string XmlDuplicateAttributeName
static string XmlAnyElementDuplicate
static string XmlIllegalAttrOrText
static string XmlInvalidIsNullable
static string XmlIllegalMultipleTextMembers
static string XmlMultipleXmlns
static string XmlRpcLitXmlns
static string XmlCannotReconcileAccessorDefault
static string XmlPropertyReflectionError
static string XmlChoiceIdentiferAmbiguous
static string XmlInternalError
static string XmlChoiceIdentifierArrayType
static string XmlInvalidTypeAttributes
static string XmlIllegalAttributeFlagsArray
static string XmlChoiceMissingAnyValue
static string Format(string resourceFormat, object p1)
static string XmlXmlnsInvalidType
static string XmlArrayItemAmbiguousTypes
static string XmlIllegalArrayTextAttribute
static string XmlSoleXmlnsAttribute
static string XmlGetSchemaMethodMissing
static string XmlNoSerializableMembers
static string XmlCannotReconcileAttributeAccessor
static string XmlIllegalArrayArrayAttribute
static string XmlIllegalAttributesArrayAttribute
static string XmlIllegalAnyElement
static string XmlIllegalElementsArrayAttribute
static string XmlInvalidReturnPosition
static string XmlIllegalAttribute
static string XmlChoiceIdentiferMissing
static string XmlInvalidXsdDataType
static string XmlIllegalTypedTextAttribute
static string XmlInvalidDefaultValue
static string XmlSequenceInconsistent
static string XmlGetSchemaInclude
static string XmlChoiceIdentiferMemberMissing
static string XmlChoiceIdDuplicate
static string XmlIllegalTypeContext
static string XmlIllegalMultipleText
static string XmlSerializableAttributes
static string XmlRpcLitAttributes
static string XmlChoiceIdentifierType
static string XmlDataTypeMismatch
static string XmlGetSchemaMethodName
static string XmlSequenceMembers
static string XmlRpcLitAttributeAttributes
static string XmlMultipleXmlnsMembers
static string XmlSequenceMatch
static string XmlReflectionError
static string XmlAnonymousInclude
static string XmlCannotReconcileAccessor
static string XmlInvalidAttributeType
static string XmlUnsupportedInheritance
static string XmlMissingSchema
static string XmlInvalidDataTypeUsage
static string XmlTypesDuplicate
static string XmlGetSchemaMethodReturnType
static string XmlUdeclaredXsdType
static string XmlIllegalAttrOrTextInterface
static string XmlDuplicateElementName
static string XmlInvalidFormUnqualified
static string XmlRpcLitElements
static string XmlChoiceMissingValue
static string XmlRpcLitElementNamespace
ElementAccessor[] Elements
AttributeAccessor Attribute
static bool ElementsMatch(ElementAccessor[] a, ElementAccessor[] b)
static string EscapeQName(string name)
static string MakePascal(string identifier)
TypeModel GetTypeModel(Type type)
ArrayModel GetArrayModel(Type type)
static bool IsKnownType(Type type)
void AddTypeMapping(TypeMapping typeMapping)
TypeDesc GetArrayTypeDesc(Type type)
static bool IsOptionalValue(Type type)
static Type GetArrayElementType(Type type, string memberInfo)
TypeDesc GetTypeDesc(string name, string ns)
int Add(XmlArrayItemAttribute? attribute)
XmlAttributeFlags XmlFlags
XmlTypeAttribute? XmlType
XmlRootAttribute? XmlRoot
XmlEnumAttribute? XmlEnum
static string GenerateKey(Type type, XmlRootAttribute root, string ns)
void CheckContext(TypeDesc typeDesc, ImportContext context)
StructMapping CreateRootMapping()
object GetDefaultValue(TypeDesc fieldTypeDesc, Type t, XmlAttributes a)
void IncludeTypes(ICustomAttributeProvider provider, RecursionLimiter limiter)
MemberMapping ImportFieldMapping(StructModel parent, FieldModel model, XmlAttributes a, string ns, RecursionLimiter limiter)
TypeMapping ImportTypeMapping(TypeModel model, string ns, ImportContext context, string dataType, XmlAttributes a, RecursionLimiter limiter)
void IncludeType(Type type, RecursionLimiter limiter)
NullableMapping CreateNullableMapping(TypeMapping baseMapping, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type)
readonly ModelScope _modelScope
readonly NameTable _types
StructMapping GetRootMapping()
EnumMapping ImportEnumMapping(EnumModel model, string ns, bool repeats)
Exception CreateTypeReflectionException(string context, Exception e)
XmlMembersMapping ImportMembersMapping(string? elementName, string? ns, XmlReflectionMember[] members, bool hasWrapperElement, bool rpc, bool openModel)
readonly string _defaultNs
static void CheckNullable(bool isNullable, TypeDesc typeDesc, TypeMapping mapping)
static MethodInfo GetMethodFromSchemaProvider(XmlSchemaProviderAttribute provider, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] Type type)
readonly XmlAttributes _defaultAttributes
void SetBase(SerializableMapping mapping, XmlQualifiedName baseQname)
TypeMapping ImportTypeMapping(TypeModel model, string ns, ImportContext context, string dataType, XmlAttributes a, bool repeats, bool openModel, RecursionLimiter limiter)
Type CheckChoiceIdentifierType(Type type, bool isArrayLike, string identifierName, string memberName)
TypeMapping GetTypeMapping(string typeName, string ns, TypeDesc typeDesc, NameTable typeLib, Type type)
string XsdTypeName(Type type)
static ElementAccessor CreateElementAccessor(TypeMapping mapping, string ns)
bool InitializeStructMembers(StructMapping mapping, StructModel model, bool openModel, string typeName, RecursionLimiter limiter)
Type GetChoiceIdentifierType(XmlChoiceIdentifierAttribute choice, StructModel structModel, bool isArrayLike, string accessorName)
XmlTypeMapping ImportTypeMapping(Type type, string? defaultNamespace)
readonly Hashtable _anonymous
XmlReflectionImporter(string? defaultNamespace)
string XsdTypeName(Type type, XmlAttributes a, string name)
void CreateArrayElementsFromAttributes(ArrayMapping arrayMapping, XmlArrayItemAttributes attributes, Type arrayElementType, string arrayElementNs, RecursionLimiter limiter)
void IncludeType(Type type)
static Exception UnsupportedException(TypeDesc typeDesc, ImportContext context)
XmlTypeMapping ImportTypeMapping(Type type)
PrimitiveMapping ImportPrimitiveMapping(PrimitiveModel model, ImportContext context, string dataType, bool repeats)
XmlReflectionImporter(XmlAttributeOverrides? attributeOverrides)
static XmlTypeMapping GetTopLevelMapping(Type type, string defaultNamespace)
static void AddUniqueAccessor(INameScope scope, Accessor accessor)
MembersMapping ImportMembersMapping(XmlReflectionMember[] xmlReflectionMembers, string ns, bool hasWrapperElement, bool rpc, bool openModel, RecursionLimiter limiter)
MemberMapping ImportMemberMapping(XmlReflectionMember xmlReflectionMember, string ns, XmlReflectionMember[] xmlReflectionMembers, bool rpc, bool openModel, RecursionLimiter limiter)
readonly TypeScope _typeScope
XmlMembersMapping ImportMembersMapping(string? elementName, string? ns, XmlReflectionMember[] members, bool hasWrapperElement, bool rpc, bool openModel, XmlMappingAccess access)
void CheckAmbiguousChoice(XmlAttributes a, Type accessorType, string accessorName)
ElementAccessor ReconcileLocalAccessor(ElementAccessor accessor, string ns)
static void CheckForm(XmlSchemaForm form, bool isQualified)
XmlReflectionImporter(XmlAttributeOverrides? attributeOverrides, string? defaultNamespace)
static XmlReflectionMember FindSpecifiedMember(string memberName, XmlReflectionMember[] reflectionMembers)
string _savedArrayNamespace
void ImportAccessorMapping(MemberMapping accessor, FieldModel model, XmlAttributes a, string ns, Type choiceIdentifierType, bool rpc, bool openModel, RecursionLimiter limiter)
static XmlArrayItemAttribute CreateArrayItemAttribute(TypeDesc typeDesc, int nestingLevel)
XmlTypeMapping ImportTypeMapping(Type type, XmlRootAttribute? root, string? defaultNamespace)
static XmlElementAttribute CreateElementAttribute(TypeDesc typeDesc)
void CheckChoiceIdentifierMapping(EnumMapping choiceMapping)
Type GetChoiceIdentifierType(XmlChoiceIdentifierAttribute choice, XmlReflectionMember[] xmlReflectionMembers, bool isArrayLike, string accessorName)
void SetArrayMappingType(ArrayMapping mapping, string defaultNs, Type type)
ConstantMapping ImportConstantMapping(ConstantModel model)
void CheckTopLevelAttributes(XmlAttributes a, string accessorName)
static int CountAtLevel(XmlArrayItemAttributes attributes, int level)
static string GetMappingName(Mapping mapping)
XmlMembersMapping ImportMembersMapping(string? elementName, string? ns, XmlReflectionMember[] members, bool hasWrapperElement)
static void AddUniqueAccessor(MemberMapping member, INameScope elements, INameScope attributes, bool isSequence)
Accessor ReconcileAccessor(Accessor accessor, NameTable accessors)
XmlArrayItemAttributes _savedArrayItemAttributes
readonly XmlAttributeOverrides _attributeOverrides
XmlAttributes GetAttributes(MemberInfo memberInfo)
void IncludeTypes(ICustomAttributeProvider provider)
SpecialMapping ImportSpecialMapping(Type type, TypeDesc typeDesc, string ns, ImportContext context, RecursionLimiter limiter)
ElementAccessor ImportElement(TypeModel model, XmlRootAttribute root, string defaultNamespace, RecursionLimiter limiter)
readonly NameTable _elements
StructMapping ImportStructLikeMapping(StructModel model, string ns, bool openModel, XmlAttributes a, RecursionLimiter limiter)
static string GetContextName(ImportContext context)
XmlMembersMapping ImportMembersMapping(string? elementName, string? ns, XmlReflectionMember[] members, bool hasWrapperElement, bool rpc)
ArrayMapping ImportArrayLikeMapping(ArrayModel model, string ns, RecursionLimiter limiter)
static XmlArrayAttribute CreateArrayAttribute(TypeDesc typeDesc)
static bool IsAnonymousType(XmlAttributes a, string contextNs)
Exception CreateMemberReflectionException(FieldModel model, Exception e)
XmlAttributes GetAttributes(Type type, bool canBeSimpleType)
XmlTypeMapping ImportTypeMapping(Type type, XmlRootAttribute? root)
Exception CreateReflectionException(string context, Exception e)
static Exception InvalidAttributeUseException(Type type)
readonly NameTable _nullables
bool GetIsNullableSpecified()
static ? string EncodeLocalName(string? name)
DynamicallyAccessedMemberTypes