/// <summary> /// Raises ValidatePropertyValue event. /// </summary> /// <param name="e">Provides event arguments.</param> protected virtual void OnValidatePropertyValue(ValidatePropertyValueEventArgs e) { ValidatePropertyValueEventHandler handler = ValidatePropertyValue; if (handler != null) handler(this, e); }
internal void InvokeValidatePropertyValue(ValidatePropertyValueEventArgs args) { ValidatePropertyValueEventHandler h = ValidatePropertyValue; if (h != null) h(this, args); }
private void ValidatePropertyValue(object target, object value, PropertyDescriptor propertyDescriptor) { AdvPropertyGrid pg = this.AdvPropertyGrid; if (pg == null) return; if (!pg.HasValidatePropertyValueHandlers) return; ValidatePropertyValueEventArgs args = new ValidatePropertyValueEventArgs(propertyDescriptor.Name, value, target); pg.InvokeValidatePropertyValue(args); if (args.Cancel) throw new InvalidPropertyValueException(args.Message); }