Esempio n. 1
0
 private void AccumulateChanges()
 {
     if (this.accumulatedChanges == null)
     {
         this.accumulatedChanges = new SettingsChangedEventArgs();
     }
 }
Esempio n. 2
0
 private void RaiseSettingsChanged(SettingsChangedEventArgs args)
 {
     this.OnSettingsChanged(args);
     if (this.SettingsChanged != null)
     {
         this.SettingsChanged(this, args);
     }
 }
Esempio n. 3
0
 private void OnExitEditScope()
 {
     if (this.accumulatedChanges != null)
     {
         this.NotifyChange(this.accumulatedChanges);
         this.accumulatedChanges = null;
     }
 }
Esempio n. 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();
            }
        }
Esempio n. 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)
 {
 }
Esempio n. 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();
 }
 /// <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);
 }