internal static string GetPropertyName(PropertyDescriptor property) { var attr = property.GetCustomAttributes <TextSerializeElementAttribute>().FirstOrDefault(); return(attr == null ? property.Name : attr.Name); }
internal static bool IsNoSerializable(PropertyDescriptor property, object value) { var defaultValue = property.GetCustomAttributes <DefaultValueAttribute>().FirstOrDefault(); return(defaultValue == null || defaultValue.Value == null || !defaultValue.Value.ToType(property.PropertyType).Equals(value)); }