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