private bool CheckAllGenericParameters(IJsonContext context, Type[] types) { foreach (var type in types) { if (context.GetSerializatorReflection(type) == null) { return(false); } } return(true); }
private IJsonSerializator[] GetJsonSerializators(IJsonContext context, Type[] types) { IJsonSerializator[] result = new IJsonSerializator[types.Length]; for (int i = 0; i < types.Length; i++) { IJsonSerializator tmp = context.GetSerializatorReflection(types[i]); if (tmp == null) { return(null); } result[i] = tmp; } return(result); }
public bool CanBuild <T>(IJsonContext context) { var type = typeof(T); if (!IsRequestedTypeSupported(type)) { return(false); } var delegatingType = GenerateDelegatingType(type); if (delegatingType == null) { return(false); } return(context.GetSerializatorReflection(delegatingType) != null); }
public IJsonMapper <T> Build <T>(IJsonContext context) { var type = typeof(T); if (!IsRequestedTypeSupported(type)) { return(null); } var delegatingType = GenerateDelegatingType(type); if (delegatingType == null) { return(null); } var serializator = context.GetSerializatorReflection(delegatingType); if (serializator == null) { return(null); } return(Build <T>(type, delegatingType, serializator)); }