コード例 #1
0
 private void ParentContainer_SettingChanged(object sender, SettingChangeEventArgs e)
 {
     if (e.Key.StartsWith(KeyPrefix))
     {
         var rawKey = e.Key.Substring(KeyPrefix.Length);
         SettingChanging?.Invoke(this, new SettingChangeEventArgs(Tag, rawKey, e.OldValue, e.NewValue));
     }
 }
コード例 #2
0
 public void Set <T>(string key, T value)
 {
     SetValue(
         value,
         actBeforeChange: (oldValue, newValue) => {
         SettingChanging?.Invoke(this, new SettingChangeEventArgs(Tag, key, oldValue, newValue));
     },
         actAfterChange: (oldValue, newValue) => {
         SettingChanged?.Invoke(this, new SettingChangeEventArgs(Tag, key, oldValue, newValue));
     },
         propertyName: key);
 }
コード例 #3
0
 protected virtual void OnSettingChanging(SettingChangingEventArgs e)
 {
     SettingChanging?.Invoke(this, e);
 }
コード例 #4
0
 private void SettingChangingHandler(object sender, SettingChangingEventArgs e)
 {
     SettingChanging?.Invoke(sender, e);
 }