示例#1
0
 /// <summary>
 /// Raises the <see cref="PropertyValueException"/> event.
 /// </summary>
 /// <param name="e">The <see cref="WpfPropertyGrid.ValueExceptionEventArgs"/> instance containing the event data.</param>
 protected virtual void OnPropertyValueException(ValueExceptionEventArgs e)
 {
     if (e == null)
     {
         throw new ArgumentNullException("e");
     }
     if (PropertyValueException != null)
     {
         PropertyValueException(this, e);
     }
 }
        public void ShouldAssignAllPropertiesFromConstructor()
        {
            PropertyItemValueMock value = new PropertyItemValueMock();
              Exception exception = new Exception();

              ValueExceptionEventArgs arguments = new ValueExceptionEventArgs("message", value, ValueExceptionSource.Get, exception);

              Assert.AreEqual<string>("message", arguments.Message);
              Assert.AreEqual<PropertyItemValue>(value, arguments.PropertyValue);
              Assert.AreEqual<ValueExceptionSource>(ValueExceptionSource.Get, arguments.Source);
              Assert.AreEqual<Exception>(exception, arguments.Exception);
        }
示例#3
0
 /// <summary>
 /// Raises the <see cref="PropertyValueException"/> event.
 /// </summary>
 /// <param name="e">The <see cref="WpfPropertyGrid.ValueExceptionEventArgs"/> instance containing the event data.</param>
 protected virtual void OnPropertyValueException(ValueExceptionEventArgs e)
 {
     if (e == null) throw new ArgumentNullException("e");
       if (PropertyValueException != null) PropertyValueException(this, e);
 }