An Encog data object that can be used to hold property data. This is a collection of name-value pairs that can be saved in an Encog persisted file.
Inheritance: Encog.Persist.BasicPersistedObject
示例#1
0
        /// <summary>
        /// Clone this object.
        /// </summary>
        /// <returns>A clonned version of this object.</returns>
        public override object Clone()
        {
            PropertyData result = new PropertyData();
            result.Name = this.Name;
            result.Description = this.Description;

            foreach (String key in this.data.Keys)
            {
                result[key] = this[key];
            }
            return result;
        }
        /// <summary>
        /// Load the specified Encog object from an XML reader.
        /// </summary>
        /// <param name="xmlin">The XML reader to use.</param>
        /// <returns>The loaded object.</returns>
        public IEncogPersistedObject Load(ReadXML xmlin)
        {
            String name = xmlin.LastTag.Attributes[
                   EncogPersistedCollection.ATTRIBUTE_NAME];
            String description = xmlin.LastTag.Attributes[
                   EncogPersistedCollection.ATTRIBUTE_DESCRIPTION];

            this.propertyData = new PropertyData();

            this.propertyData.Name = name;
            this.propertyData.Description = description;

            while (xmlin.ReadToTag())
            {
                if (xmlin.IsIt(PropertyDataPersistor.TAG_PROPERTIES, true))
                {
                    HandleProperties(xmlin);
                }
                else if (xmlin.IsIt(EncogPersistedCollection.TYPE_PROPERTY, false))
                {
                    break;
                }

            }

            return this.propertyData;
        }