Example #1
0
        public void PropertyUpdaterTest()
        {
            Regulus.Remote.Property <int> p1 = new Regulus.Remote.Property <int>(1);

            var updater = new Regulus.Remote.PropertyUpdater(p1, 1);

            Regulus.Remote.IPropertyIdValue idValue = updater;

            System.Collections.Generic.Queue <object> objs = new System.Collections.Generic.Queue <object>();
            updater.ChnageEvent += objs.Enqueue;
            p1.Value             = 1;
            p1.Value             = 2;
            p1.Value             = 3;

            Assert.True((int)objs.Dequeue() == 1);
            Assert.True((int)idValue.Instance == 1);
            updater.Reset();

            Assert.True((int)objs.Dequeue() == 3);
            Assert.True((int)idValue.Instance == 3);

            p1.Value = 4;
            p1.Value = 5;

            updater.Reset();
            Assert.True((int)objs.Dequeue() == 5);
            Assert.True((int)idValue.Instance == 5);
        }
 public PropertyObservable(Regulus.Remote.Property <T> property)
 {
     this._Property = property;
     _Value         = _Property.Value;
     _ThreadUpdater = new ThreadUpdater(() => { });
     _ThreadUpdater.Start();
 }
Example #3
0
        public void Equip()
        {
            Regulus.Remote.Property <int> p1 = new Regulus.Remote.Property <int>(1);
            Regulus.Remote.Property <int> p2 = new Regulus.Remote.Property <int>(1);

            bool result = p1 == p2;

            Assert.AreEqual(true, result);
        }
Example #4
0
 public static IObservable <TValue> PropertyChangeValue <TValue>(this Regulus.Remote.Property <TValue> ret)
 {
     return(new PropertyObservable <TValue>(ret));
 }