Exemplo n.º 1
0
        /// <summary>
        /// Validate pstring visit.
        /// </summary>
        /// <param name="item"></param>
        public void Visit(PStringDataItem item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }
            AB_RootDataTag tag = RetrieveTag(item);

            Assert.AreEqual(tag.Value, "\"" + item.Value + "\"");
        }
Exemplo n.º 2
0
        /// <summary>
        /// Visit pstring item.
        /// </summary>
        /// <param name="item"></param>
        public void Visit(PStringDataItem item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }
            //
            // First byte indicates the size of the string.
            //

            byte[] values = GetItemValue(item).Skip(1).ToArray();

            var chars = new char[values.Length];

            for (int i = 0; i < chars.Length; i++)
            {
                chars[i] = (char)values[i];
            }
            item.Value = new string(chars);
            Context.DataItems.Add(item);
        }