System.ComponentModel.PropertyDescriptor.SetValue C# (CSharp) Method

SetValue() public abstract method

When overridden in a derived class, sets the value of the component to a different value.

public abstract SetValue ( object component, object value ) : void
component object
value object
return void
        public abstract void SetValue(object component, object value);

Usage Example

Esempio n. 1
0
 /// <summary>
 /// Processes the property.
 /// </summary>
 /// <param name="value">The value.</param>
 /// <param name="property">The property.</param>
 private static void ProcessProperty(object value, PropertyDescriptor property)
 {
     if (property.Attributes.Contains(AntiXssHtmlText))
     {
         property.SetValue(value, Sanitizer.GetSafeHtmlFragment((string) property.GetValue(value)));
     }
     else if (property.Attributes.Contains(AntiXssIgnore))
     {
         // do nothing this contains special text
     }
     else
     {
         property.SetValue(value, HttpUtility.HtmlDecode(HttpUtility.HtmlEncode((string)property.GetValue(value))));
     }
 }
All Usage Examples Of System.ComponentModel.PropertyDescriptor::SetValue