1 /** 2 * Module for change event args handling. 3 * 4 * Authors: 5 * Jacob Jensen 6 * License: 7 * https://github.com/PoisonEngine/poison-ui/blob/master/LICENSE 8 */ 9 module poison.core.eventargs.changeeventargs; 10 11 import poison.core.eventargs : EventArgs; 12 13 /// Event args for value changes. 14 class ChangeEventArgs(T) : EventArgs { 15 private: 16 /// The old value. 17 T _oldValue; 18 19 /// The new value. 20 T _newValue; 21 22 public: 23 /** 24 * Creates a new change event args. 25 * Params: 26 * oldValue = The old value. 27 * newValue = The new value. 28 */ 29 this(T oldValue, T newValue) { 30 super(); 31 32 _oldValue = oldValue; 33 _newValue = newValue; 34 } 35 36 @property { 37 /// Gets the old value. 38 T oldValue() { return _oldValue; } 39 40 /// Gets the new value. 41 T newValue() { return _newValue; } 42 } 43 }