protected virtual void OnDictionaryChanged(TKey key, object value, DictionaryChangedType changedType) { if (DictionaryChanged != null) { DictionaryChanged(this, new DictionaryChangedEventArgs <TKey>(key, value, changedType)); } }
/// <summary> /// Creates a new instance of the <see cref="DictionaryChangedEventArgs{TKey,TValue}"/> class. /// </summary> /// <param name="key">The key of the item causing the change in the dictionary.</param> /// <param name="index">The index of the item causing the change in the dictionary.</param> /// <param name="value">The item that is causing the change in the dictionary.</param> /// <param name="propertyName">The name of the property causing the item to change.</param> /// <param name="dictionaryChangedType">A <see cref="DictionaryChangedType"/> value indicating the type of change.</param> public DictionaryChangedEventArgs(TKey key, int index, TValue value, string propertyName, DictionaryChangedType dictionaryChangedType) { _key = key; _index = index; _value = value; _propertyName = propertyName; _dictionaryChangedType = dictionaryChangedType; }
/// <summary> /// Creates a new instance of the <see cref="DictionaryChangedEventArgs{TKey,TValue}"/> class. /// </summary> /// <param name="key">The key of the item causing the change in the dictionary.</param> /// <param name="index">The index of the item causing the change in the dictionary.</param> /// <param name="value">The item that is causing the change in the dictionary.</param> /// <param name="dictionaryChangedType">A <see cref="DictionaryChangedType"/> value indicating the type of change.</param> public DictionaryChangedEventArgs(TKey key, int index, TValue value, DictionaryChangedType dictionaryChangedType) : this(key, index, value, null, dictionaryChangedType) { }
/// <summary> /// 构造函数 /// </summary> /// <param name="effectKey">发生变更的Key</param> /// <param name="changedType">变更类型</param> public DictionaryChangedEventArgs(T effectKey, object effecValue, DictionaryChangedType changedType) { DictionaryChangedType = changedType; EffectKey = effectKey; EffectValue = effecValue; }