protected bool IgnoreObjectName(string name, string path, IEnumerable<CustomAttributeData> attributes = null)
{
var ignoreByNameOrPath = _ignorePropertiesOrPaths?.Contains(name) == true || _ignorePropertiesOrPaths?.Contains(path) == true;
if (ignoreByNameOrPath)
{
return true;
}
#if FEATURE_CUSTOM_ATTRIBUTES
if (attributes?.Any(x => !_options.BitwiseHasFlag(SerializerOptions.DisableIgnoreAttributes) && (_ignoreAttributes.Contains(x.AttributeType) || _ignoreAttributes.Contains(x.AttributeType.Name))) == true)
{
return true;
}
#else
if (attributes?.Any(x => !_options.BitwiseHasFlag(SerializerOptions.DisableIgnoreAttributes) && (_ignoreAttributes.Contains(x.Constructor.DeclaringType) || _ignoreAttributes.Contains(x.Constructor.DeclaringType.Name))) == true)
{
return true;
}
#endif
return false;
}
}