/// <summary> /// Initializes a new instance of the PropertyValue class. /// </summary> /// <param name="propertyContainer">The container of this property.</param> /// <param name="propertyName">The name of the property.</param> protected PropertyValue(IPropertyContainer propertyContainer, string propertyName) { Param.RequireNotNull(propertyContainer, "propertyContainer"); Param.RequireValidString(propertyName, "propertyName"); PropertyDescriptor descriptor = propertyContainer.PropertyDescriptors[propertyName]; if (descriptor == null) { throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Strings.PropertyDescriptorDoesNotExist, propertyName)); } this.propertyDescriptor = descriptor; }
/// <summary> /// Initializes a new instance of the PropertyValue class. /// </summary> /// <param name="propertyDescriptor">The property descriptor that this value represents.</param> protected PropertyValue(PropertyDescriptor propertyDescriptor) { Param.RequireNotNull(propertyDescriptor, "propertyDescriptor"); this.propertyDescriptor = propertyDescriptor; }