object CreateSyncAddSelfRemOnceRelay(int args, bool addListenerBefore) { object r = null; switch (args) { case 0: myRelay = new Relay(); if (addListenerBefore) { myRelay.AddOnce(DummyDelegate1); } myRelay.AddOnce(SyncAddSelfRemDelegateOnce); r = myRelay; break; case 1: myRelay1 = new Relay <int>(); if (addListenerBefore) { myRelay1.AddOnce(DummyDelegate1); } myRelay1.AddOnce(SyncAddSelfRemDelegateOnce); r = myRelay1; break; case 2: myRelay2 = new Relay <int, float>(); if (addListenerBefore) { myRelay2.AddOnce(DummyDelegate1); } myRelay2.AddOnce(SyncAddSelfRemDelegateOnce); r = myRelay2; break; case 3: myRelay3 = new Relay <int, float, bool>(); if (addListenerBefore) { myRelay3.AddOnce(DummyDelegate1); } myRelay3.AddOnce(SyncAddSelfRemDelegateOnce); r = myRelay3; break; case 4: myRelay4 = new Relay <int, float, bool, uint>(); if (addListenerBefore) { myRelay4.AddOnce(DummyDelegate1); } myRelay4.AddOnce(SyncAddSelfRemDelegateOnce); r = myRelay4; break; } return(r); }
object CreateSyncAddOnceRelay(int args) { object r = null; switch (args) { case 0: myRelay = new Relay(); myRelay.AddOnce(SyncAddDelegateOnce); r = myRelay; break; case 1: myRelay1 = new Relay <int>(); myRelay1.AddOnce(SyncAddDelegateOnce); r = myRelay1; break; case 2: myRelay2 = new Relay <int, float>(); myRelay2.AddOnce(SyncAddDelegateOnce); r = myRelay2; break; case 3: myRelay3 = new Relay <int, float, bool>(); myRelay3.AddOnce(SyncAddDelegateOnce); r = myRelay3; break; case 4: myRelay4 = new Relay <int, float, bool, uint>(); myRelay4.AddOnce(SyncAddDelegateOnce); r = myRelay4; break; } return(r); }
void SyncAddDelegateOnce(int i, float f, bool b, uint u) { DummyDelegate1(); myRelay4.AddOnce(DummyDelegate2); }
void SyncAddDelegateOnce(int i, float f) { DummyDelegate1(); myRelay2.AddOnce(DummyDelegate2); }
void SyncAddDelegateOnce(int i) { DummyDelegate1(); myRelay1.AddOnce(DummyDelegate2); }
void SyncAddDelegateOnce() { DummyDelegate1(); myRelay.AddOnce(DummyDelegate2); }
public virtual void AddOnce(Action listener) { onRaiseRelay.AddOnce(listener); }
public void AddOnce(Action <T> listener) { onValueChanged.AddOnce(listener); }