|
using System;
using System.ComponentModel;
namespace NotifyTest {
/// <summary>
/// This class extends <see cref="T:PropertyNotificationEventArgs"/> and
/// allows for cancelling of the associated event.
/// </summary>
public class CancelPropertyNotificationEventArgs : PropertyNotificationEventArgs {
#region Constructors
/// <summary>
/// Initializes a new instance of the
/// <see cref="CancelPropertyNotificationEventArgs"/> class.
/// </summary>
/// <param name="propertyName">
/// The name of the property that is associated with this
/// notification.
/// </param>
public CancelPropertyNotificationEventArgs(String propertyName)
: base(propertyName) {
// No-op
}
/// <summary>
/// Initializes a new instance of the
/// <see cref="CancelPropertyNotificationEventArgs"/> class.
/// </summary>
/// <param name="propertyName">
/// The name of the property that is associated with this
/// notification.
/// </param>
/// <param name="oldValue">The old value.</param>
/// <param name="newValue">The new value.</param>
public CancelPropertyNotificationEventArgs(String propertyName,
Object oldValue, Object newValue)
: base(propertyName, oldValue, newValue) {
// No-op
}
#endregion // Constructors
#region Properties/Fields
/// <summary>
/// Holds a value indicating whether the associated event should be
/// cancelled.
/// </summary>
private Boolean cancel = false;
/// <summary>
/// Gets or sets a value indicating whether the associated event should
/// be cancelled.
/// </summary>
/// <value>
/// <c>true</c> if the event should be cancelled; otherwise, <c>false</c>.
/// </value>
public Boolean Cancel {
get {
return this.cancel;
}
set {
this.cancel = value;
}
}
#endregion // Properties/Fields
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
My name is Tom Goff and I have been working as a Software Engineer for over 15 years. Over my career, I have primarily focused on Windows programming with C++ and C#. I have also worked extensively with Microsoft SQL Server over the past 6 years.