public void TestProperty() { const string xmlString = _Head + @"<root> <Public>2</Public> <Auto>3</Auto> </root>"; SProperty foo = _AssertSerDeserMatch <SProperty>(xmlString); Assert.AreEqual(3, foo.Private); Assert.AreEqual(3, foo.Auto); }
private AbstractProperty AddAttachedProperty(string name, object value, Type t) { if (_attachedProperties == null) { _attachedProperties = new Dictionary <string, AbstractProperty>(); } AbstractProperty result = new SProperty(t); result.SetValue(value); _attachedProperties[name] = result; return(result); }
public AudioSpectrumAnalyzer() { MaximumFrequencyProperty = new SProperty(typeof(int), 20000); MinimumFrequencyProperty = new SProperty(typeof(int), 20); BarCountProperty = new SProperty(typeof(int), 32); BarSpacingProperty = new SProperty(typeof(double), 5d); PeakFallDelayProperty = new SProperty(typeof(int), 10); IsFrequencyScaleLinearProperty = new SProperty(typeof(bool), false); BarHeightScalingProperty = new SProperty(typeof(BarHeightScalingStyles), BarHeightScalingStyles.Decibel); AveragePeaksProperty = new SProperty(typeof(bool), false); BarStyleProperty = new SProperty(typeof(Style), null); PeakStyleProperty = new SProperty(typeof(Style), null); ActualBarWidthProperty = new SProperty(typeof(double), 0.0d); RefreshIntervalProperty = new SProperty(typeof(int), 25); PlayerContextProperty = new SProperty(typeof(PlayerChoice), PlayerChoice.PrimaryPlayer); _animationTimer = new Timer(RefreshInterval); _animationTimer.Elapsed += AnimationTimerElapsed; Attach(); }