示例#1
0
        /// <summary>
        /// Sets this observable's value.
        /// </summary>
        /// <param name="_NewValue">The new value of this observable.</param>
        /// <param name="_ForceEvent">If true, the changes event will be triggered even if the given new value is the same as the current
        /// one.</param>
        protected virtual void SetValue(T _NewValue, bool _ForceEvent = false)
        {
            if (!_ForceEvent && _NewValue.Equals(m_ObservableValue))
            {
                return;
            }

            T previousValue = m_ObservableValue;

            m_ObservableValue = _NewValue;

            ObservableChanges <T> changes = new ObservableChanges <T>(previousValue, m_ObservableValue);

            HandleChanges(changes);
        }
示例#2
0
 /// <summary>
 /// Called when changes event is triggered.
 /// </summary>
 protected abstract void HandleChanges(ObservableChanges <T> _Changes);