示例#1
0
        protected void SetListValue(object value, XmlSchemaDatatype datatype)
        {
            string   strValue = ListFormatter.ToString(value);
            XElement element  = this.GetUntyped();

            element.Value = strValue;
        }
        internal override bool MatchEnumeration(object value, ArrayList enumeration, XmlSchemaDatatype datatype)
        {
            string strValue = ListFormatter.ToString(value);

            foreach (object correctArray in enumeration)
            {
                if (strValue.Equals(correctArray))
                {
                    return(true);
                }
            }

            return(false);
        }
        private void SaveValue()
        {
            switch (containerType)
            {
            case ContainerType.Element:
                containerElement.Value = ListFormatter.ToString(this.items);
                return;

            case ContainerType.Attribute:
                XAttribute attr = containerElement.Attribute(itemXName);
                Debug.Assert(attr != null);
                attr.Value = ListFormatter.ToString(this.items);
                return;
            }
        }
示例#4
0
 protected void SetListAttribute(XName name,
                                 object value,
                                 XmlSchemaDatatype datatype)
 {
     SetAttribute(name, ListFormatter.ToString(value), datatype);
 }