internal override void _optionsMgr_OptionsChanged(IOptions sender, OptionsChangedEventArgs ea) { _optionsMgr_OptionsChanged_TimesCalled++; }
internal void _optionsMgr_OptionsChanged(IOptions sender, OptionsChangedEventArgs ea) { throw new NotImplementedException("The method or operation is not implemented."); }
public void ApplyChanges(IDictionary<string, object> changes) { IList<string> changedOptions = new List<string>(); _suppressOptionsChangedEvent = true; foreach (string name in changes.Keys) { if (Items[name] != changes[name]) { Items[name] = changes[name]; changedOptions.Add(name); } } _suppressOptionsChangedEvent = false; OptionsChangedEventArgs ea = new OptionsChangedEventArgs(changedOptions); OnOptionsChanged(ea); }
public object this[string name] { get { return _items[name]; } set { if (value!=null) { object defaultVal = _defaults[name]; // TODO log and throw custom exception if (defaultVal.GetType() != value.GetType()) throw new InvalidOperationException("Value type must match default value type"); } object oldVal = _items[name]; _items[name] = value; if (oldVal != _items[name] && !_suppressOptionsChangedEvent) { OptionsChangedEventArgs ea = new OptionsChangedEventArgs(new string[] {name}); OnOptionsChanged(ea); } } }
protected virtual void OnOptionsChanged(OptionsChangedEventArgs ea) { if (OptionsChanged != null) OptionsChanged(this, ea); }
public void Reset() { _suppressOptionsChangedEvent = true; IList<string> changedOptions = new List<string>(); foreach (string name in _defaults.Keys) { if (_items[name] != _defaults[name]) { _items[name] = _defaults[name]; changedOptions.Add(name); } } _suppressOptionsChangedEvent = false; OptionsChangedEventArgs ea = new OptionsChangedEventArgs(changedOptions); OnOptionsChanged(ea); }
public void Reset(string [] namesOfChangedOptions) { if (namesOfChangedOptions!=null && namesOfChangedOptions.Length>0) { _suppressOptionsChangedEvent = true; for (int i = 0; i < namesOfChangedOptions.Length; i++) { _items[namesOfChangedOptions[i]] = _defaults[namesOfChangedOptions[i]]; } _suppressOptionsChangedEvent = false; OptionsChangedEventArgs ea = new OptionsChangedEventArgs(namesOfChangedOptions); OnOptionsChanged(ea); } }