Grider.CapInfo.AddDelegate C# (CSharp) Method

AddDelegate() public method

public AddDelegate ( CapsDelegate deleg ) : void
deleg CapsDelegate
return void
        public void AddDelegate(CapsDelegate deleg)
        {
            lock (this)
            {
                if (!Delegates.Contains(deleg))
                {
                    Delegates.Add(deleg);
                }
            }
        }

Usage Example

Beispiel #1
0
        // GenericCheck: replace the sim address in a packet with our proxy address
        public void GenericCheck(ref uint simIP, ref ushort simPort, ref string simCaps, bool active)
        {
            IPAddress sim_ip = new IPAddress((long)simIP);

            IPEndPoint realSim = new IPEndPoint(sim_ip, Convert.ToInt32(simPort));
            IPEndPoint fakeSim = ProxySim(realSim);

            simPort = (ushort)fakeSim.Port;
            byte[] bytes = fakeSim.Address.GetAddressBytes();
            simIP = Utils.BytesToUInt(bytes);
            if (simCaps != null && simCaps.Length > 0)
            {
                CapInfo info = new CapInfo(simCaps, realSim, "SeedCapability");
                info.AddDelegate(new CapsDelegate(FixupSeedCapsResponse));
                lock (this)
                {
                    KnownCaps[simCaps] = info;
                }
                simCaps = loginURI + simCaps;
            }

            if (active)
                activeCircuit = realSim;
        }
All Usage Examples Of Grider.CapInfo::AddDelegate