ActiveListExtensions.ValueModifiers.ActiveCount.OnReplaced C# (CSharp) Method

OnReplaced() protected method

protected OnReplaced ( int index, oldValue, newValue ) : void
index int
return void
		protected override void OnReplaced(int index, TSource oldValue, TSource newValue)
		{
			if (_predicate.Invoke(newValue))
			{
				var currentValue = _values[index];
				_values[index] = true;
				if (!currentValue)
					++Value;
			}
			else if (_values[index])
			{
				_values[index] = false;
				--Value;
			}
		}