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