setXMLValue() 공개 메소드

public setXMLValue ( string value ) : void
value string
리턴 void
예제 #1
0
        private void ReadElement(XmlNode parentNode, Property property)
        {
            if (parentNode[property.Name] == null)
            {
                property.Value  = null;
                property.NotSet = true;
            }
            else if ((parentNode[property.Name].Attributes["nil"] != null) && (parentNode[property.Name].Attributes["nil"].Value.Equals(XmlConvert.ToString(true), StringComparison.InvariantCultureIgnoreCase)))
            {
                property.Value = null;
            }

            /* added by: msassanelli
             * 07-09-10
             * We have to check for the type of the property. Properties that do not accept an empty string as value
             * have to be handled as a not set property.
             * i.e. A tag is given that represents a boolean type and no innerText exists: It is handled as if the tag does not exist.
             */
            else if ((parentNode[property.Name].InnerText == "") &&
                     (property.TypeCode != TypeCode.String && property.TypeCode != TypeCode.Object))
            {
                property.Value  = null;
                property.NotSet = true;
            }
            /* end msassanelli */
            else
            {
                property.setXMLValue(parentNode[property.Name].InnerText);
            }
        }
예제 #2
0
        private void ReadElement(XmlNode parentNode, Property property)
        {
            if (parentNode[property.Name] == null)
            {
                property.Value = null;
                property.NotSet = true;
            }
            else if ((parentNode[property.Name].Attributes["nil"] != null) && (parentNode[property.Name].Attributes["nil"].Value.Equals(XmlConvert.ToString(true), StringComparison.InvariantCultureIgnoreCase)))
                property.Value = null;

            /* added by: msassanelli
             * 07-09-10
             * We have to check for the type of the property. Properties that do not accept an empty string as value
             * have to be handled as a not set property.
             * i.e. A tag is given that represents a boolean type and no innerText exists: It is handled as if the tag does not exist.
            */
            else if ((parentNode[property.Name].InnerText == "") &&
                   (property.TypeCode != TypeCode.String && property.TypeCode != TypeCode.Object))
            {
                property.Value = null;
                property.NotSet = true;
            }
            /* end msassanelli */
            else
                property.setXMLValue(parentNode[property.Name].InnerText);
        }