Exemple #1
0
        /// <summary>
        /// Raises the <see cref="E:PropertyChanging"/> event.
        /// </summary>
        /// <param name="e">
        /// The <see cref="CancelPropertyNotificationEventArgs"/> instance
        /// containing the event data.
        /// </param>
        protected void OnPropertyChanging(CancelPropertyNotificationEventArgs e)
        {
            PropertyChangingEventHandler temp = this.PropertyChanging;

            if (null != temp)
            {
                temp(this, e);
            }
        }
Exemple #2
0
        /// <summary>
        /// Raises the <see cref="E:PropertyChanging"/> event.
        /// </summary>
        /// <param name="propertyName">
        /// Name of the property that is changing.
        /// </param>
        /// <param name="oldValue">The old value.</param>
        /// <param name="newValue">The new value.</param>
        /// <returns><c>true</c> if the change can continue; otherwise <c>false</c>.</returns>
        protected Boolean OnPropertyChanging(String propertyName,
                                             Object oldValue, Object newValue)
        {
            CancelPropertyNotificationEventArgs e = new CancelPropertyNotificationEventArgs(propertyName,
                                                                                            oldValue, newValue);

            OnPropertyChanging(e);
            return(!e.Cancel);
        }