public bool HasTypeSerializer(Type type) { if (type.IsValueType) { var hasSerializeMethod = ValueTypeSerializeMethods.GetMethodForType(type) != null; Debug.Assert(hasSerializeMethod == (ValueTypeDeserializeMethods.GetMethodForType(type) != null)); // <- debug check for matching deserializer return(hasSerializeMethod); } else { var hasSerializeMethod = ReferenceTypeSerializeMethods.GetMethodForType(type) != null; Debug.Assert(hasSerializeMethod == (ReferenceTypeDeserializeMethods.GetMethodForType(type) != null)); // <- debug check for matching deserializer return(hasSerializeMethod); } }
public ReferenceTypeDeserializeMethod <T> GetReferenceTypeDeserializeDelegate <T>() where T : class { return((ReferenceTypeDeserializeMethod <T>)CreateDelegate(typeof(ReferenceTypeDeserializeMethod <T>), ReferenceTypeDeserializeMethods.GetMethodForType(typeof(T)))); }