The InputAttribute is used to represent an attribute within an element. Rather than representing an attribute as a name value pair of strings, an attribute is instead represented as an input node, in the same manner as an element. The reason for representing an attribute in this way is such that a uniform means of extracting and parsing values can be used for inputs.
Inheritance: InputNode
示例#1
0
        /// This is used to add a new <c>InputAttribute</c> node to
        /// the map. The created node can be used by an input node to
        /// to represent the attribute as another input node. Once the
        /// node is created it can be acquired using the specified name.
        /// </summary>
        /// <param name="name">
        /// This is the name of the node to be created.
        /// </param>
        /// <param name="value">
        /// This is the value to be given to the node.
        /// </param>
        /// <returns>
        /// This returns the node that has just been added.
        /// </returns>
        public InputNode Put(String name, String value)
        {
            InputNode node = new InputAttribute(source, name, value);

            if (name != null)
            {
                Put(name, node);
            }
            return(node);
        }
示例#2
0
        /// <summary>
        /// This is used to insert all attributes belonging to the start
        /// element to the map. All attributes acquired from the element
        /// are converted into <c>InputAttribute</c> objects so
        /// that they can be used as input nodes by an input node.
        /// </summary>
        /// <param name="element">
        /// The element to acquire attributes from.
        /// </param>
        private void Build(EventNode element)
        {
            foreach (Attribute entry in element)
            {
                InputAttribute value = new InputAttribute(source, entry);

                if (!entry.IsReserved())
                {
                    Put(value.Name, value);
                }
            }
        }