116 references to TypeKind
System.Private.Xml (116)
System\Xml\Serialization\Models.cs (14)
50case TypeKind.Enum: 53case TypeKind.Primitive: 56case TypeKind.Array: 57case TypeKind.Collection: 58case TypeKind.Enumerable: 61case TypeKind.Root: 62case TypeKind.Class: 63case TypeKind.Struct: 197if (model.ReadOnly && model.FieldTypeDesc.Kind != TypeKind.Collection && model.FieldTypeDesc.Kind != TypeKind.Enumerable) 223if (fieldInfo.IsInitOnly && typeDesc.Kind != TypeKind.Collection && typeDesc.Kind != TypeKind.Enumerable) 238if (!propertyInfo.CanWrite && typeDesc.Kind != TypeKind.Collection && typeDesc.Kind != TypeKind.Enumerable)
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (4)
686if (special.TypeDesc!.Kind == TypeKind.Node) 954case TypeKind.Node: 966case TypeKind.Serializable: 1917if (special.TypeDesc!.Kind == TypeKind.Attribute)
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (2)
307case TypeKind.Node: 877if (special.TypeDesc!.Kind == TypeKind.Attribute || special.TypeDesc.CanBeAttributeValue)
System\Xml\Serialization\SoapReflectionImporter.cs (12)
189case TypeKind.Enum: 191case TypeKind.Primitive: 193case TypeKind.Array: 194case TypeKind.Collection: 195case TypeKind.Enumerable: 197case TypeKind.Root: 198case TypeKind.Class: 199case TypeKind.Struct: 298if (model.TypeDesc.Kind == TypeKind.Root) return GetRootMapping(); 742if (!(fieldTypeDesc.Kind == TypeKind.Primitive || fieldTypeDesc.Kind == TypeKind.Enum)) 748if (fieldTypeDesc.Kind == TypeKind.Enum)
System\Xml\Serialization\Types.cs (47)
88private readonly TypeKind _kind; 99internal TypeDesc(string name, string fullName, XmlSchemaType? dataType, TypeKind kind, TypeDesc? baseTypeDesc, TypeFlags flags, string? formatterName) 106_isXsdType = kind == TypeKind.Primitive; 109else if (kind == TypeKind.Enum) 111else if (_kind == TypeKind.Root) 119internal TypeDesc(string name, string fullName, TypeKind kind, TypeDesc? baseTypeDesc, TypeFlags flags) 124: this(type!.Name, type.FullName!, dataType, TypeKind.Primitive, (TypeDesc?)null, flags, formatterName) 129internal TypeDesc(Type? type, string name, string fullName, TypeKind kind, TypeDesc? baseTypeDesc, TypeFlags flags, TypeDesc? arrayElementTypeDesc) 184internal TypeKind Kind 292get { return _kind == TypeKind.Void; } 297get { return _kind == TypeKind.Class; } 302get { return _kind == TypeKind.Struct || _kind == TypeKind.Class; } 307get { return _kind == TypeKind.Array || _kind == TypeKind.Collection || _kind == TypeKind.Enumerable; } 312get { return _kind == TypeKind.Collection; } 317get { return _kind == TypeKind.Enumerable; } 322get { return _kind == TypeKind.Array; } 327get { return _kind == TypeKind.Primitive; } 332get { return _kind == TypeKind.Enum; } 342get { return _kind == TypeKind.Root; } 364_nullableTypeDesc = new TypeDesc($"NullableOf{_name}", $"System.Nullable`1[{_fullName}]", null, TypeKind.Struct, this, _flags | TypeFlags.OptionalValue, _formatterName); 407internal TypeDesc CreateArrayTypeDesc() => _arrayTypeDesc ??= new TypeDesc(null, $"{_name}[]", $"{_fullName}[]", TypeKind.Array, null, TypeFlags.Reference | (_flags & TypeFlags.UseReflection), this); 757TypeKind kind; 782kind = TypeKind.Root; 787kind = TypeKind.Enum; 793kind = TypeKind.Void; 797kind = TypeKind.Serializable; 803kind = TypeKind.Array; 814kind = TypeKind.Collection; 820kind = TypeKind.Primitive; 824kind = TypeKind.Primitive; 830kind = TypeKind.Enum; 834kind = TypeKind.Struct; 850kind = TypeKind.Attribute; 855kind = TypeKind.Node; 867kind = TypeKind.Class; 875kind = TypeKind.Void; 891kind = TypeKind.Void; 897if (kind == TypeKind.Class && !type.IsAbstract) 902if (kind == TypeKind.Struct || kind == TypeKind.Class) 907kind = TypeKind.Enumerable; 917if (directReference && (typeDesc.IsClass || kind == TypeKind.Serializable)) 1089if (typeDesc.Kind == TypeKind.Collection || typeDesc.Kind == TypeKind.Enumerable)
System\Xml\Serialization\XmlReflectionImporter.cs (19)
427case TypeKind.Enum: 429case TypeKind.Primitive: 432case TypeKind.Array: 433case TypeKind.Collection: 434case TypeKind.Enumerable: 441case TypeKind.Root: 442case TypeKind.Class: 443case TypeKind.Struct: 459if (model.TypeDesc.Kind == TypeKind.Serializable) 519if (typeDesc.Kind == TypeKind.Serializable) 730if (model.TypeDesc.Kind == TypeKind.Root) return GetRootMapping(); 1580if (accessor.TypeDesc.ArrayElementTypeDesc.Kind == TypeKind.Serializable) 1827if (element.Mapping.TypeDesc!.Kind == TypeKind.Node) 1871if (accessor.TypeDesc.Kind == TypeKind.Serializable) 2147if (!(fieldTypeDesc.Kind == TypeKind.Primitive || fieldTypeDesc.Kind == TypeKind.Enum)) 2154if (fieldTypeDesc.Kind == TypeKind.Enum) 2239bool isAny = mapping.TypeDesc!.Kind == TypeKind.Node; 2266if (typeDesc.Kind == TypeKind.Node)
System\Xml\Serialization\XmlSchemaExporter.cs (2)
416case TypeKind.Node: 434case TypeKind.Serializable:
System\Xml\Serialization\XmlSchemaImporter.cs (4)
558structMapping.TypeDesc = new TypeDesc(typeName, typeName, TypeKind.Struct, baseTypeDesc, flags); 614structMapping.TypeDesc = new TypeDesc(typeName, typeName, TypeKind.Struct, baseTypeDesc, flags); 1744enumMapping.TypeDesc = new TypeDesc(typeName, typeName, TypeKind.Enum, null, 0); 1801enumMapping.TypeDesc = new TypeDesc(typeName, typeName, TypeKind.Enum, null, 0);
System\Xml\Serialization\XmlSerializationReader.cs (4)
3799if (special.TypeDesc!.Kind == TypeKind.Attribute) 4081case TypeKind.Node: 4809case TypeKind.Node: 4818case TypeKind.Serializable:
System\Xml\Serialization\XmlSerializationReaderILGen.cs (4)
2037if (special.TypeDesc!.Kind == TypeKind.Attribute) 2322case TypeKind.Node: 3177case TypeKind.Node: 3193case TypeKind.Serializable:
System\Xml\Serialization\XmlSerializationWriter.cs (2)
3464if (special.TypeDesc!.Kind == TypeKind.Attribute || special.TypeDesc.CanBeAttributeValue) 3899case TypeKind.Node:
System\Xml\Serialization\XmlSerializationWriterILGen.cs (2)
1360if (special.TypeDesc!.Kind == TypeKind.Attribute || special.TypeDesc.CanBeAttributeValue) 1874case TypeKind.Node: