Exemple #1
0
        internal static string GetPropertyName(PropertyDescriptor property)
        {
            var attr = property.GetCustomAttributes <TextSerializeElementAttribute>().FirstOrDefault();

            return(attr == null ? property.Name : attr.Name);
        }
Exemple #2
0
        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));
        }