Exemple #1
0
    protected void UnReg(uint msgId, BaseEvent.Callback cb)
    {
        for (int i = 0; i < mCBPairs.Count; ++i)
        {
            if (mCBPairs[i].ID == msgId && mCBPairs[i].CB == cb)
            {
                mCBPairs.RemoveAt(i);
                break;
            }
        }

        mDispatcher.UnReg(msgId, cb);
    }
Exemple #2
0
    protected void Reg(uint msgId, BaseEvent.Callback cb)
    {
        for (int i = 0; i < mCBPairs.Count; ++i)
        {
            if (mCBPairs[i].ID == msgId && mCBPairs[i].CB == cb)
            {
                return;
            }
        }

        MsgCBPair pair;

        pair.ID = msgId;
        pair.CB = cb;
        mCBPairs.Add(pair);

        mDispatcher.Reg(msgId, cb);
    }
Exemple #3
0
 public void RemoveEvent(EClientEvent uiEvitID, BaseEvent.Callback cb)
 {
     UnReg((uint)uiEvitID, cb);
 }
Exemple #4
0
 public void AddEvent(EClientEvent uiEvtID, BaseEvent.Callback callback)
 {
     Reg((uint)uiEvtID, callback);
 }