Ejemplo n.º 1
0
        public void WriteComplexContent(ComplexContentAttribute attribute, object writer,
                                        object value, WriteSettings settings, ObjectPropertyInfo info, object serializerData)
        {
            XmlWriter xmlWriter = writer.Convert <XmlWriter>();
            string    text      = ObjectUtil.ToString(info.Converter, value, settings);

            WriteComplexContent(xmlWriter, text);
        }
Ejemplo n.º 2
0
        public void ReadComplexContent(ComplexContentAttribute attribute, object reader,
                                       object receiver, ReadSettings settings, ObjectPropertyInfo info, object serializerData)
        {
            XElement current = XElementData.GetCurrent(reader);

            string value = current.HasElements ? current.FirstNode.ToString() : null;

            SerializerUtil.CheckRequiredContent(attribute, receiver, info, value);
            SerializerUtil.SetObjectValue(receiver, settings, info, value, false);
        }
Ejemplo n.º 3
0
        public void WriteComplexContent(ComplexContentAttribute attribute, object writer,
                                        object value, WriteSettings settings, ObjectPropertyInfo info, object serializerData)
        {
            var    current  = serializerData.Convert <XElement>();
            string xmlValue = ObjectUtil.ToString(info.Converter, value, settings);

            if (!string.IsNullOrEmpty(xmlValue))
            {
                XElement child = XElement.Parse(xmlValue);
                current.Add(child);
            }
        }
Ejemplo n.º 4
0
        public void ReadComplexContent(ComplexContentAttribute attribute, object reader,
                                       object receiver, ReadSettings settings, ObjectPropertyInfo info, object serializerData)
        {
            XmlReader xml = reader.Convert <XmlReader>();

            TkDebug.Assert(xml.NodeType == XmlNodeType.Element, string.Format(ObjectUtil.SysCulture,
                                                                              "ComplexContent初始要求XmlReader在Element节点上,当前状态是{0},位置不对", xml.NodeType), this);
            QName  name  = QName.Get(xml);
            string value = ReadComplexContent(xml, name);

            SerializerUtil.CheckRequiredContent(attribute, receiver, info, value);
            SerializerUtil.SetObjectValue(receiver, settings, info, value, false);
        }
Ejemplo n.º 5
0
 public void ReadComplexContent(ComplexContentAttribute attribute, object reader,
                                object receiver, ReadSettings settings, ObjectPropertyInfo info, object serializerData)
 {
     throw new NotSupportedException();
 }
Ejemplo n.º 6
0
 public void WriteComplexContent(ComplexContentAttribute attribute, object writer,
                                 object value, WriteSettings settings, ObjectPropertyInfo info, object serializerData)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 7
0
 public void WriteComplexContent(ComplexContentAttribute attribute, object writer,
                                 object value, WriteSettings settings, ObjectPropertyInfo info, object serializerData)
 {
     TkDebug.ThrowToolkitException("Json不支持ComplexContent节点", this);
 }
Ejemplo n.º 8
0
 public void ReadComplexContent(ComplexContentAttribute attribute, object reader,
                                object receiver, ReadSettings settings, ObjectPropertyInfo info, object serializerData)
 {
     TkDebug.ThrowToolkitException("Json不支持ComplexContent节点", this);
 }