/// <summary>
        /// Raises the <see cref="StateChanged"/> event.
        /// </summary>
        protected virtual void OnStateChanged(StateChangedEventArgs e)
        {
            EventHandler<StateChangedEventArgs> stateHandler = StateChanged;
            if (stateHandler != null)
            {
                stateHandler(this, e);
            }

            EventHandler changedHandler = (EventHandler)handlers[changedKey];
            if (changedHandler != null)
            {
                changedHandler(this, EventArgs.Empty);
            }
        }
示例#2
0
        /// <summary>
        /// Raises the <see cref="StateElement.StateChanged"/> event and sets the <see cref="HasChanges"/> flag to true.
        /// </summary>
        protected override void OnStateChanged(StateChangedEventArgs e)
        {
            if (traceSource != null)
                traceSource.TraceInformation(Properties.Resources.TraceStateChangedMessage, id, e.Key);

            base.OnStateChanged(e);
            hasChanges = true;
        }