Exemplo n.º 1
0
        private void RegisterSC <T>()
        {
            string s   = typeof(T).FullName;
            int    idx = s.LastIndexOf('_');
            string sub = s.Substring(idx + 1);
            int    n   = Convert.ToInt32(sub, 16);
            var    ph  = new ProtoHandler <T>();

            sdict.Add(n, ph);
            sdict_str.Add(s, ph);
        }
Exemplo n.º 2
0
        public void RemoveCallback <T>(Action <T> proc)
        {
            string        n = typeof(T).FullName;
            IProtoHandler iph;
            bool          b = sdict_str.TryGetValue(n, out iph);

            if (b)
            {
                ProtoHandler <T> pht = iph as ProtoHandler <T>;
                pht.OnReceive -= proc;
            }
        }