Beispiel #1
0
        public override int Deserialize(string rawTlv, int pos)
        {
            if (rawTlv.Length == 0)
            {
                return(0);
            }

            children = new QRDEList();

            Tag        = (TagId)GetEnum(typeof(TagId), Convert.ToInt16(rawTlv.Substring(pos, 2)));
            pos        = pos + 2;
            Length     = Convert.ToInt16(rawTlv.Substring(pos, 2));
            pos        = pos + 2;
            Value      = rawTlv.Substring(pos, Length);
            pos        = pos + Length;
            IsTemplate = QRMetaDataSourceSingleton.Instance.DataSource.IsTemplate(Tag, TagParent);
            //DataFormatterBase formatter = QRMetaDataSourceSingleton.Instance.DataSource.GetFormatter(Tag, TagParent);
            if (IsTemplate)
            {
                for (int i = 0; i < Value.Length;)
                {
                    QRDE child = new QRDE
                    {
                        TagParent = Tag
                    };
                    i = child.Deserialize(Value, i);
                    Children.AddToList(child);
                }
            }
            return(pos);
        }
Beispiel #2
0
 public QRDE()
 {
     Tag       = TagId.None;
     TagParent = TagId.None;
     children  = new QRDEList();
 }