private static uint GetVersionForCustomSerializer(SerializerAttribute attribute, Type targetType) { return(attribute.Version.HasValue ? attribute.Version.Value : new TypeInspector(targetType).Version); }
public static Exception InvalidSerializerMethodSignature(SerializerAttribute attribute, MethodInfo methodInfo, Type targetType) { return(SafeCreateException(() => new ShapeshifterException(InvalidSerializerMethodSignatureId, String.Format("Serializer method {0}.{1} must be Action<IShapeshifterWriter,{2}> or Action<IShapeshifterWriter,object>.", methodInfo.DeclaringType == null ? null : methodInfo.DeclaringType.FullName, methodInfo.Name, targetType.Name)))); }