ReadPropertyBlock() public method

Read all property data until an end tag, which corrisponds to the current tag, is found. The properties found will be returned in a map.
public ReadPropertyBlock ( ) : String>.IDictionary
return String>.IDictionary
        /// <summary>
        /// Handle reading an item tag.
        /// </summary>
        /// <param name="xmlIn">The XML reader.</param>
        private void HandleItem(ReadXML xmlIn)
        {
            IDictionary<String, String> properties = xmlIn.ReadPropertyBlock();
            INeuralDataPair pair = null;
            INeuralData input = new BasicNeuralData(NumberList
                   .FromList(CSVFormat.EG_FORMAT, properties
                           [BasicNeuralDataSetPersistor.TAG_INPUT]));

            if (properties.ContainsKey(BasicNeuralDataSetPersistor.TAG_IDEAL))
            {
                // supervised
                INeuralData ideal = new BasicNeuralData(NumberList
                       .FromList(CSVFormat.EG_FORMAT, properties
                               [BasicNeuralDataSetPersistor.TAG_IDEAL]));
                pair = new BasicNeuralDataPair(input, ideal);
            }
            else
            {
                // unsupervised
                pair = new BasicNeuralDataPair(input);
            }

            this.currentDataSet.Add(pair);
        }
Esempio n. 2
0
        /// <summary>
        /// Process the cloud request. 
        /// </summary>
        /// <param name="xml">The XML to parse.</param>
        private void ProcessCloud(ReadXML xml)
        {
            int ch;

            while ((ch = xml.Read()) != -1)
            {
                if (ch == 0)
                {
                    if (xml.LastTag.Name.Equals("Header"))
                    {
                        this.headerProperties = xml.ReadPropertyBlock();
                    }
                    else if (xml.LastTag.Name.Equals("Session"))
                    {
                        this.sessionProperties = xml.ReadPropertyBlock();
                    }
                    else if (xml.LastTag.Name.Equals("Response"))
                    {
                        this.responseProperties = xml.ReadPropertyBlock();
                    }
                }
            }
        }