public ConfigurationItemDescriptor(string name, Type type, string comment, object defaultValue) { if (ConfigurationBase.CanSupportType(type) == false) { throw new ArgumentException(); } this.PropertyName = name; this.Comment = comment ?? string.Empty; this.DefaultValue = defaultValue; this.PropertyType = type; }
public ConfigurationItemDescriptor(string name, object value) { if (value == null) { throw new ArgumentNullException(nameof(value)); } if (ConfigurationBase.CanSupportType(value.GetType()) == false) { throw new ArgumentException(); } this.PropertyName = name; this.Comment = string.Empty; this.DefaultValue = DBNull.Value; this.PropertyType = value.GetType(); }