public ConditionalPropertyDescripor(PropertyInfo property, ConditionalAttribute attribute) { this.PropertyInfo = property; this.Attribute = attribute; this.Name = property.Name; this.PropertyType = property.PropertyType; if (attribute != null && attribute.ConverterType != null) { this.Converter = Activator.CreateInstance(attribute.ConverterType) as IConditionalConverter; } }
public ConditionalPropertyDescripor(PropertyInfo property, ConditionalAttribute attribute) { this.Info = property; this.Attribute = attribute; this.Name = property.Name; this.PropertyType = property.PropertyType; var defaultAttribute = property.GetCustomAttribute <System.ComponentModel.DefaultValueAttribute>(true); if (defaultAttribute != null) { this.DefaultValue = Convert.IsDBNull(defaultAttribute.Value) ? null : defaultAttribute.Value; } if (attribute != null && attribute.ConverterType != null) { this.Converter = Activator.CreateInstance(attribute.ConverterType) as IConditionalConverter; } }
public ConditionalPropertyDescripor(PropertyInfo property, ConditionalAttribute attribute) { this.Info = property; this.Attribute = attribute; this.Name = property.Name; this.PropertyType = property.PropertyType; var defaultAttribute = property.GetCustomAttribute<System.ComponentModel.DefaultValueAttribute>(true); if(defaultAttribute != null) this.DefaultValue = Convert.IsDBNull(defaultAttribute.Value) ? null : defaultAttribute.Value; if(attribute != null && attribute.ConverterType != null) this.Converter = Activator.CreateInstance(attribute.ConverterType) as IConditionalConverter; }