5 using System.Collections.Generic;
6 using System.Reflection;
7 using SiliconStudio.Core.Reflection;
9 namespace SiliconStudio.Core.Serialization
13 public static readonly Dictionary<string, Type> CachedTypes =
new Dictionary<string, Type>();
14 public static readonly Dictionary<Type, string> ReverseCachedTypes =
new Dictionary<Type, string>();
18 DefaultValueMetadata.Delegate(
21 return new Dictionary<object, int>(ObjectReferenceEqualityComparer.Default);
28 private class ObjectReferenceEqualityComparer : EqualityComparer<object>
30 private static IEqualityComparer<object> defaultEqualityComparer;
32 public new static IEqualityComparer<object>
Default
34 get {
return defaultEqualityComparer ?? (defaultEqualityComparer =
new ObjectReferenceEqualityComparer()); }
37 public override bool Equals(
object x,
object y)
39 return ReferenceEquals(x, y);
42 public override int GetHashCode(
object obj)
44 return System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(obj);
55 protected static bool isValueType = typeof(T).GetTypeInfo().IsValueType;
58 protected static bool isSealed = typeof(T).GetTypeInfo().IsSealed || typeof(T) == typeof(Type);
64 this.dataSerializer = dataSerializer;
69 var dataSerializer = serializerSelector.GetSerializer<T>();
80 return dataSerializer;
_In_ size_t _In_ DXGI_FORMAT _In_ size_t _In_ float size_t y
Various useful extension methods on top of SerializationStream for serialization/deserialization of c...
Use the default mode depending on the type of the field/property.
Serializer context. It holds DataSerializer{T} objects and their factories.
DataSerializer< T > dataSerializer
bool ReuseReferences
Gets or sets a value indicating whether [serialization reuses references] (that is, each reference gets assigned an ID and if it is serialized again, same instance will be reused).
Describes how to serialize and deserialize an object without knowing its type. Used as a common base ...
static DataSerializer< T > Create(SerializerSelector serializerSelector, bool nullable=true)
Describes how to serialize and deserialize an object of a given type.
A class that represents a tag propety.
MemberSerializer(DataSerializer< T > dataSerializer)