Beispiel #1
0
        /// <summary>
        /// Reads a single template definition.
        /// </summary>
        /// <returns></returns>
        public NodeTemplate ReadTemplateDefinition()
        {
            NodeTemplateType type = (NodeTemplateType)Reader.ReadByte();

            if (!TemplateParsers.ContainsKey(type))
            {
                throw new InvalidDataException("Unknown node template type.");
            }
            return(TemplateParsers[type](this));
        }
Beispiel #2
0
 /// <summary>
 /// Writes the given template type to the output stream.
 /// </summary>
 /// <param name="Type"></param>
 public void WriteTemplateType(NodeTemplateType Type)
 {
     Writer.Write((byte)Type);
 }