Example #1
0
        /// <summary>
        /// Creates a new instance of EmberContainer.
        /// </summary>
        /// <param name="tag">The tag of the new node.</param>
        /// <param name="parent">The parent to insert the new node into.</param>
        /// <param name="type">The BerType of the new node.</param>
        public EmberContainer(BerTag tag, EmberContainer parent, uint type)
            : base(tag)
        {
            BerTypeNumber = type;

            if (parent != null)
            {
                parent.InsertChildNode(this);
            }
        }
Example #2
0
        static void Decode_Recurse(EmberReader reader, EmberContainer parent, EmberApplicationInterface application)
        {
            while (reader.Read())
            {
                var node = FromReader(reader, application);

                if (node != null)
                {
                    var container = node as EmberContainer;

                    if (container != null)
                    {
                        var childReader = new EmberReader(reader);

                        Decode_Recurse(childReader, container, application);
                    }

                    node.ValidateAfterDecode();
                    parent.InsertChildNode(node);
                }
            }
        }