Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
System.Runtime.Serialization.CollectionDataContract Class Referencesealed

Classes

class  CollectionDataContractCriticalHelper
 
class  DictionaryEnumerator
 
class  GenericDictionaryEnumerator
 

Public Member Functions

override void WriteXmlValue (XmlWriterDelegator xmlWriter, object obj, XmlObjectSerializerWriteContext context)
 
override object ReadXmlValue (XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context)
 
virtual void WriteXmlElement (XmlWriterDelegator xmlWriter, object obj, XmlObjectSerializerWriteContext context, XmlDictionaryString name, XmlDictionaryString ns)
 
virtual object ReadXmlElement (XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context)
 

Static Public Member Functions

static Dictionary< Type, DataContractGetDataContracts ()
 
static DataContract GetBuiltInDataContract (Type type)
 
static DataContract GetBuiltInDataContract (string name, string ns)
 
static DataContract GetBuiltInDataContract (string typeName)
 

Package Functions

 CollectionDataContract (Type type)
 
void IncrementCollectionCount (XmlWriterDelegator xmlWriter, object obj, XmlObjectSerializerWriteContext context)
 
IEnumerator GetEnumeratorForCollection (object obj)
 
Type GetCollectionElementType ()
 
override DataContract GetValidContract (SerializationMode mode)
 
override DataContract GetValidContract ()
 
override bool IsValidContract (SerializationMode mode)
 
bool RequiresMemberAccessForRead (SecurityException securityException)
 
bool RequiresMemberAccessForWrite (SecurityException securityException)
 
virtual void WriteRootElement (XmlWriterDelegator writer, XmlDictionaryString name, XmlDictionaryString ns)
 

Static Package Functions

static bool IsCollectionInterface (Type type)
 
static bool IsCollection (Type type)
 
static bool IsCollection (Type type, [NotNullWhen(true)] out Type itemType)
 
static bool IsCollection (Type type, bool constructorRequired)
 
static bool TryCreate (Type type, [NotNullWhen(true)] out DataContract dataContract)
 
static bool CreateGetOnlyCollectionDataContract (Type type, [NotNullWhen(true)] out DataContract dataContract)
 
static bool TryCreateGetOnlyCollectionDataContract (Type type, [NotNullWhen(true)] out DataContract dataContract)
 
static MethodInfo GetTargetMethodWithName (string name, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] Type interfaceType)
 
static bool IsCollectionDataContract (Type type)
 
static bool TryGetDataContractFromGeneratedAssembly (Type type, out DataContract dataContract)
 
static DataContract GetDataContractFromGeneratedAssembly (Type type)
 
static DataContract GetDataContract (Type type)
 
static DataContract GetDataContract (RuntimeTypeHandle typeHandle, Type type)
 
static DataContract GetDataContract (RuntimeTypeHandle typeHandle, Type type, SerializationMode mode)
 
static DataContract GetDataContract (int id, RuntimeTypeHandle typeHandle, SerializationMode mode)
 
static DataContract GetDataContractSkipValidation (int id, RuntimeTypeHandle typeHandle, Type type)
 
static DataContract GetGetOnlyCollectionDataContract (int id, RuntimeTypeHandle typeHandle, Type type, SerializationMode mode)
 
static DataContract GetGetOnlyCollectionDataContractSkipValidation (int id, RuntimeTypeHandle typeHandle, Type type)
 
static DataContract GetDataContractForInitialization (int id)
 
static int GetIdForInitialization (ClassDataContract classContract)
 
static int GetId (RuntimeTypeHandle typeHandle)
 
static string GetNamespace (string key)
 
static XmlDictionaryString GetClrTypeString (string key)
 
static void ThrowInvalidDataContractException (string message, Type type)
 
static bool IsTypeSerializable (Type type)
 
static Type UnwrapRedundantNullableType (Type type)
 
static Type UnwrapNullableType (Type type)
 
static string EncodeLocalName (string localName)
 
static bool IsValidNCName (string name)
 
static XmlQualifiedName GetStableName (Type type)
 
static XmlQualifiedName GetStableName (Type type, out bool hasDataContract)
 
static bool TryGetDCAttribute (Type type, [NotNullWhen(true)] out DataContractAttribute dataContractAttribute)
 
static XmlQualifiedName GetCollectionStableName (Type type, Type itemType, out CollectionDataContractAttribute collectionContractAttribute)
 
static string GetCollectionNamespace (string elementNs)
 
static XmlQualifiedName GetDefaultStableName (Type type)
 
static void GetDefaultStableName (string fullTypeName, out string localName, out string ns)
 
static List< int > GetDataContractNameForGenericName (string typeName, StringBuilder localName)
 
static bool IsBuiltInNamespace (string ns)
 
static string GetDefaultStableNamespace (Type type)
 
static string GetDefaultStableNamespace (string clrNs)
 
static XmlQualifiedName CreateQualifiedName (string localName, string ns)
 
static string GetClrTypeFullName (Type type)
 
static void GetClrNameAndNamespace (string fullTypeName, out string localName, out string ns)
 
static string GetDataContractNamespaceFromUri (string uriString)
 
static string ExpandGenericParameters (string format, IGenericNameProvider genericNameProvider)
 
static bool IsTypeNullable (Type type)
 
static Dictionary< XmlQualifiedName, DataContractImportKnownTypeAttributes (Type type)
 
static void CheckAndAdd (Type type, Dictionary< Type, Type > typesChecked, [NotNullIfNotNull("nameToDataContractTable")] ref Dictionary< XmlQualifiedName, DataContract > nameToDataContractTable)
 
static bool IsTypeVisible (Type t)
 
static bool ConstructorRequiresMemberAccess (ConstructorInfo ctor)
 
static bool MethodRequiresMemberAccess (MethodInfo method)
 
static bool FieldRequiresMemberAccess (FieldInfo field)
 
static bool IsAssemblyFriendOfSerialization (Assembly assembly)
 
static string SanitizeTypeName (string typeName)
 

Static Package Attributes

const string SerializerTrimmerWarning = "Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved."
 

Properties

static Type[] KnownInterfaces [get]
 
CollectionKind Kind [get]
 
Type ItemType [get, set]
 
DataContract ItemContract [get, set]
 
DataContract SharedTypeContract [get]
 
string ItemName [get, set]
 
XmlDictionaryString CollectionItemName [get, set]
 
string KeyName [get, set]
 
string ValueName [get, set]
 
bool IsDictionary [get]
 
XmlDictionaryString ChildElementNamespace [get]
 
bool IsItemTypeNullable [get, set]
 
bool IsConstructorCheckRequired [get, set]
 
MethodInfo GetEnumeratorMethod [get]
 
MethodInfo AddMethod [get]
 
ConstructorInfo Constructor [get]
 
override Dictionary< XmlQualifiedName, DataContractKnownDataContracts [get, set]
 
string InvalidCollectionInSharedContractMessage [get]
 
string DeserializationExceptionMessage [get]
 
bool IsReadOnlyContract [get]
 
XmlFormatCollectionWriterDelegate XmlFormatWriterDelegate [get, set]
 
XmlFormatCollectionReaderDelegate XmlFormatReaderDelegate [get, set]
 
XmlFormatGetOnlyCollectionReaderDelegate XmlFormatGetOnlyCollectionReaderDelegate [get, set]
 
MethodInfo ParseMethod [get]
 
DataContractCriticalHelper Helper [get]
 
Type UnderlyingType [get, set]
 
Type OriginalUnderlyingType [get, set]
 
virtual bool IsBuiltInDataContract [get, set]
 
Type TypeForInitialization [get]
 
bool IsValueType [get, set]
 
bool IsReference [get, set]
 
XmlQualifiedName StableName [get, set]
 
virtual bool IsISerializable [get, set]
 
XmlDictionaryString Name [get, set]
 
virtual XmlDictionaryString Namespace [get, set]
 
virtual bool HasRoot [get, set]
 
virtual XmlDictionaryString TopLevelElementName [get, set]
 
virtual XmlDictionaryString TopLevelElementNamespace [get, set]
 
virtual bool CanContainReferences [get]
 
virtual bool IsPrimitive [get]
 

Private Member Functions

 CollectionDataContract (Type type, CollectionKind kind, Type itemType, MethodInfo getEnumeratorMethod, string deserializationExceptionMessage)
 
 CollectionDataContract (Type type, CollectionKind kind, Type itemType, MethodInfo getEnumeratorMethod, MethodInfo addMethod, ConstructorInfo constructor)
 
 CollectionDataContract (Type type, CollectionKind kind, Type itemType, MethodInfo getEnumeratorMethod, MethodInfo addMethod, ConstructorInfo constructor, bool isConstructorCheckRequired)
 
 CollectionDataContract (Type type, string invalidCollectionInSharedContractMessage)
 
void InitCollectionDataContract (DataContract sharedTypeContract)
 
XmlFormatCollectionWriterDelegate CreateXmlFormatWriterDelegate ()
 
XmlFormatCollectionReaderDelegate CreateXmlFormatReaderDelegate ()
 
XmlFormatGetOnlyCollectionReaderDelegate CreateXmlFormatGetOnlyCollectionReaderDelegate ()
 
DataContract GetSharedTypeContract (Type type)
 
void CheckConstructor ()
 

Static Private Member Functions

static bool IsCollectionHelper (Type type, [NotNullWhen(true)] out Type itemType, bool constructorRequired)
 
static bool IsArraySegment (Type t)
 
static bool IsCollectionOrTryCreate (Type type, bool tryCreate, out DataContract dataContract, out Type itemType, bool constructorRequired)
 
static bool HandleIfInvalidCollection (Type type, bool tryCreate, bool hasCollectionDataContract, bool createContractWithException, string message, string param, ref DataContract dataContract)
 
static void GetReadOnlyCollectionExceptionMessages (Type type, string message, string param, out string deserializationExceptionMessage)
 
static string GetInvalidCollectionMessage (string message, string nestedMessage, string param)
 
static void FindCollectionMethodsOnInterface ([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] Type interfaceType, ref MethodInfo addMethod, ref MethodInfo getEnumeratorMethod)
 
static void GetCollectionMethods ([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] Type interfaceType, Type[] addMethodTypeArray, bool addMethodOnInterface, out MethodInfo getEnumeratorMethod, out MethodInfo addMethod)
 
static MethodInfo GetIEnumerableGetEnumeratorMethod ([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] Type ienumerableInterface)
 
static bool IsKnownInterface (Type type)
 
static DataContract GetGeneratedDataContract (Type type)
 
static bool IsTypeSerializable (Type type, HashSet< Type > previousCollectionTypes)
 
static void ValidatePreviousCollectionTypes (Type collectionType, Type itemType, HashSet< Type > previousCollectionTypes)
 
static bool IsAlpha (char ch)
 
static bool IsDigit (char ch)
 
static bool IsAsciiLocalName (string localName)
 
static XmlQualifiedName GetDCTypeStableName (Type type, DataContractAttribute dataContractAttribute)
 
static XmlQualifiedName GetNonDCTypeStableName (Type type)
 
static bool TryGetBuiltInXmlAndArrayTypeStableName (Type type, [NotNullWhen(true)] out XmlQualifiedName stableName)
 
static string GetArrayPrefix (ref Type itemType)
 
static void GetDefaultStableName (CodeTypeReference typeReference, out string localName, out string ns)
 
static string GetDefaultStableLocalName (Type type)
 
static string GetDefaultDataContractNamespace (Type type)
 
static void CheckExplicitDataContractNamespaceUri (string dataContractNs, Type type)
 
static string GetGlobalDataContractNamespace (string clrNs, object[] nsAttributes)
 
static string GetNamespacesDigest (string namespaces)
 
static byte[] ComputeHash (byte[] namespaces)
 
static string ExpandGenericParameters (string format, Type type)
 
static void ImportKnownTypeAttributes (Type type, Dictionary< Type, Type > typesChecked, ref Dictionary< XmlQualifiedName, DataContract > knownDataContracts)
 
static bool IsTypeVisibleInSerializationModule (Type type)
 
static bool IsMemberVisibleInSerializationModule (MemberInfo member)
 

Private Attributes

XmlDictionaryString _collectionItemName
 
XmlDictionaryString _childElementNamespace
 
DataContract _itemContract
 
CollectionDataContractCriticalHelper _helper
 
XmlDictionaryString _name
 
XmlDictionaryString _ns
 

Static Private Attributes

static readonly Dictionary< Type, DataContracts_dataContracts = new Dictionary<Type, DataContract>()
 

Detailed Description

Definition at line 12 of file CollectionDataContract.cs.


The documentation for this class was generated from the following file: