public void ShouldInvokePropertyChangedEvent_WhenValueIsChanged() { if (!_valueAndTypeStoredTestPassed) { Assert.Inconclusive("Required test \"ShouldStoreValueAndTypeCorrectly_WhenConstructorIsCalled\" did not pass"); } const double previousValue = 2d; const double newValue = 8d; var testProperty = new Property(previousValue); var propertyChanged = false; UserPropertyChangedArgs eventArgs = null; testProperty.PropertyChanged += (sender, args) => { propertyChanged = true; eventArgs = args; }; testProperty.Value = newValue; Assert.IsTrue(propertyChanged); Assert.AreEqual(previousValue, eventArgs.ValueBefore); Assert.AreEqual(newValue, eventArgs.ValueAfter); _eventCalledTestPassed = true; }
protected override void OnTickrateChange(object source, UserPropertyChangedArgs args) { interval = CalculateInterval(args.ValueAfter); }
/// <summary> /// Event if the tickrate changes /// </summary> /// <param name="source"></param> /// <param name="args"></param> protected override void OnTickrateChange(object source, UserPropertyChangedArgs args) { timer.Interval = new TimeSpan(0, 0, 0, 0, CalculateInterval(args.ValueAfter)); }
/// <summary> /// Event if the tickrate changes /// </summary> /// <param name="source"></param> /// <param name="args"></param> protected abstract void OnTickrateChange(object source, UserPropertyChangedArgs args);