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)); }
public IBinding To(object obj) { Binded.Add(obj, obj); if (Resolver != null) { Resolver(this); } return(this); }
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); }
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); }
public Point2D Copy() { return(new Point2D(Binded.Copy(), Dimention)); }
internal virtual void OnBinded(BinderBindedEventArgs e) { Binded?.Invoke(this, e); }