예제 #1
0
 private void AccumulateChanges()
 {
     if (this.accumulatedChanges == null)
     {
         this.accumulatedChanges = new SettingsChangedEventArgs();
     }
 }
예제 #2
0
 private void RaiseSettingsChanged(SettingsChangedEventArgs args)
 {
     this.OnSettingsChanged(args);
     if (this.SettingsChanged != null)
     {
         this.SettingsChanged(this, args);
     }
 }
예제 #3
0
 private void OnExitEditScope()
 {
     if (this.accumulatedChanges != null)
     {
         this.NotifyChange(this.accumulatedChanges);
         this.accumulatedChanges = null;
     }
 }
예제 #4
0
        /// <summary>
        /// Will recursively notify all <see cref="SettingsNode"/> for a settings change.
        /// </summary>
        /// <param name="args"><see cref="SettingsChangedEventArgs"/> that contain information about the change.</param>
        protected internal void NotifyChange(SettingsChangedEventArgs args)
        {
            if (args == null)
            {
                throw new ArgumentNullException("args");
            }

            args.OriginalSource = this;
            SettingsNode target = this;

            while (target != null && !target.IsInEditScope)
            {
                target.RaiseSettingsChanged(args);
                target = target.Parent;
            }

            if (target != null)
            {
                target.AccumulateChanges();
            }
        }
예제 #5
0
 /// <summary>
 /// Invoked when a SettingsChangedEventArgs reaches the <see cref="SettingsNode"/>.
 /// </summary>
 /// <param name="args">The <see cref="SettingsChangedEventArgs" /> that contains the event data.</param>
 protected virtual void OnSettingsChanged(SettingsChangedEventArgs args)
 {
 }
예제 #6
0
 private void OnDataSettingsChanged(object sender, SettingsChangedEventArgs e)
 {
     // TODO: Get change details and push them along...
     // Some changes may be processed by partial recomputations...
     this.Invalidate();
 }
예제 #7
0
 /// <summary>
 /// Notifies the Parent <see cref="SettingsNode"/> for a change.
 /// </summary>
 /// <param name="settingsEventArgs">The <see cref="SettingsChangedEventArgs" /> that contains the event data.</param>
 protected void NotifyChange(SettingsChangedEventArgs settingsEventArgs)
 {
     this.Parent.NotifyChange(settingsEventArgs);
 }