Ejemplo n.º 1
0
        private void Binder_Binded(object sender, IBinder e)
        {
            var resolved   = ResolveExpression(sender as IBinder, e);
            var expression = new BinderExpression(resolved.Output, resolved.Input);

            Binded?.Invoke(this, new BinderBindedEventArgs(expression));
        }
Ejemplo n.º 2
0
 public IBinding To(object obj)
 {
     Binded.Add(obj, obj);
     if (Resolver != null)
     {
         Resolver(this);
     }
     return(this);
 }
Ejemplo n.º 3
0
        public override void OnBind(Context p0, int p1, string p2, string p3, string p4, string p5)
        {
#if DEBUG
            System.Diagnostics.Debug.WriteLine($"OnBind {p1} {p2} {p3}");
#endif



            BindedEventArgs args = new BindedEventArgs {
                UserID = p3, ChannelID = p4
            };
            Binded?.Invoke(this, args);
        }
        public void BindToInternalInstanceProperty()
        {
            var generator = new RandomObjectGenerator();
            var original = generator.Generate<string>();
            var newValue = generator.Generate<string>();
            var binded = new Binded { InternalInstanceProperty = original };

            Assert.AreEqual(original, binded.InternalInstanceProperty);

            using (newValue.Bind(() => binded.InternalInstanceProperty))
            {
                Assert.AreEqual(newValue, binded.InternalInstanceProperty);
            }

            Assert.AreEqual(original, binded.InternalInstanceProperty);
        }
Ejemplo n.º 5
0
        public virtual void Bind(IBinder targetBinder)
        {
            if (!CanBind(targetBinder))
            {
                throw new Exception();
            }

            this.Items.Add(targetBinder);

            if (targetBinder.CanBind(this))
            {
                targetBinder.Bind(this);
            }

            // Raise
            Binded?.Invoke(this, targetBinder);
        }
Ejemplo n.º 6
0
 public Point2D Copy()
 {
     return(new Point2D(Binded.Copy(), Dimention));
 }
Ejemplo n.º 7
0
 internal virtual void OnBinded(BinderBindedEventArgs e)
 {
     Binded?.Invoke(this, e);
 }