private void _Attach(Adsorber <T> asadsorber) { if (_Bind(asadsorber) == false) { _UnusedAdsorbers.Add(asadsorber); } }
public void Detach <T>(Adsorber <T> adsorber) { var notifier = _Agent.QueryNotifier <T>(); var notifier1 = _QueryNotifier(notifier); notifier1.Unregister(adsorber); }
private bool _Bind(Adsorber <T> adsorber) { var gpi = _UnusedGpis.FirstOrDefault(); if (gpi != null) { _Bind(adsorber, gpi); _UnusedGpis.Remove(gpi); return(true); } return(false); }
private void _Unbind(Adsorber <T> adsorber) { var binded = _Bindeds.FirstOrDefault(b => b.Adsorber.GetHashCode() == adsorber.GetHashCode()); if (binded == null) { return; } binded.Adsorber.Unsupply(binded.Gpi); _Bindeds.Remove(binded); _Attach(binded.Gpi); }
public abstract void Unregister <T>(Adsorber <T> adsorber);
private void _Bind(Adsorber <T> adsorber, T gpi) { adsorber.Supply(gpi); _Bindeds.Add(new Binded(adsorber, gpi)); }
public override void Register <T1>(Adsorber <T1> adsorber) { var asadsorber = adsorber as Adsorber <T>; _Attach(asadsorber); }
public Binded(Adsorber <T> adsorber, T gpi) { Adsorber = adsorber; Gpi = gpi; }
public override void Unregister <T1>(Adsorber <T1> adsorber) { _UnusedAdsorbers.RemoveAll(a => a.GetHashCode() == adsorber.GetHashCode()); _Unbind(adsorber as Adsorber <T>); }