示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
 void SyncAddDelegateOnce(int i, float f, bool b, uint u)
 {
     DummyDelegate1();
     myRelay4.AddOnce(DummyDelegate2);
 }
示例#4
0
 void SyncAddDelegateOnce(int i, float f)
 {
     DummyDelegate1();
     myRelay2.AddOnce(DummyDelegate2);
 }
示例#5
0
 void SyncAddDelegateOnce(int i)
 {
     DummyDelegate1();
     myRelay1.AddOnce(DummyDelegate2);
 }
示例#6
0
 void SyncAddDelegateOnce()
 {
     DummyDelegate1();
     myRelay.AddOnce(DummyDelegate2);
 }
示例#7
0
 public virtual void AddOnce(Action listener)
 {
     onRaiseRelay.AddOnce(listener);
 }
示例#8
0
 public void AddOnce(Action <T> listener)
 {
     onValueChanged.AddOnce(listener);
 }