示例#1
0
        /// <summary>
        /// All PDU of pduType will now be decoded using the supplied decoder.
        /// </summary>
        /// <param name="pduType"></param>
        /// <param name="decoder"></param>
        public void SetPduDecoder(PDUType pduType, IFactoryDecoder decoder)
        {
            DecoderAndEventPair dep;

            if (factoryDecoders.TryGetValue(pduType, out dep))
            {
                Debug.Log("Swapping out default decoder for " + pduType + " with " + decoder.GetType().ToString());
                dep.pduDecoder = decoder;
            }
            else
            {
                factoryDecoders.Add(pduType, new DecoderAndEventPair(decoder, null));
            }
        }
示例#2
0
 public DecoderAndEventPair(IFactoryDecoder d, PduEvent e)
 {
     pduDecoder = d;
     pduEvent   = e;
 }