Adf.Base.Domain.DescriptorPropertyParser.SetValue C# (CSharp) Method

SetValue() public method

Sets the new value for a specific property on an object.
Unable to convert the new value to the specified property. null reference is not accept as a valid argument.
public SetValue ( object instance, PropertyInfo pi, object newvalue, CultureInfo culture ) : void
instance object Target object to set property at.
pi System.Reflection.PropertyInfo Property info for the property to set.
newvalue object Value for the property.
culture System.Globalization.CultureInfo
return void
        public void SetValue(object instance, PropertyInfo pi, object newvalue, CultureInfo culture)
        {
            var descriptor = Descriptor.Get(pi.PropertyType, newvalue.ToString());

            pi.SetValue(instance, descriptor, null);
        }