public CustomAttribute[] GetCustomAttributes() { if (customAttributes == null) return new CustomAttribute[0]; return (CustomAttribute[])customAttributes.ToArray(typeof(CustomAttribute)); }