Exemplo n.º 1
0
        public void ReadXml(XmlReader reader)
        {
            if (reader.MoveToContent() == XmlNodeType.Element && reader.LocalName == "ImageItems")
            {
                p_Image_uri = reader["Image_uri"];
                p_FileName  = reader["FileName"];

                if (reader["Enternemo"] != null)
                {
                    m_EnterMarker = (Marker)XamlReader.Parse(reader["EnterMarker"]);//LDH8282 시리얼 수정 해야함
                }
                if (reader["Selnemo"] != null)
                {
                    m_SelMarker = (Marker)XamlReader.Parse(reader["SelMarker"]);//LDH8282 시리얼 수정 해야함
                }
                if (reader["preSelnemo"] != null)
                {
                    m_preSelMarker = (Marker)XamlReader.Parse(reader["preSelMarker"]);//LDH8282 시리얼 수정 해야함
                }
                if (reader["ImgId"] != null)
                {
                    m_ImgId = UInt32.Parse(reader["ImgId"]);
                }

                if (reader.ReadToDescendant("OutLineMarkers"))
                {
                    m_OutLineMarkers.Clear();
                    while (reader.MoveToContent() == XmlNodeType.Element && reader.LocalName == "OutLineMarkers")
                    {
                        String key = reader.GetAttribute("Key");
                        OutLineRectangleItem evt = new OutLineRectangleItem();
                        evt.ReadXml(reader);
                        m_OutLineMarkers.Add(key, evt);//<- 여기서 터짐
                    }

                    m_DectedMarkers.Clear();
                    while (reader.MoveToContent() == XmlNodeType.Element && reader.LocalName == "DectedMarkers")
                    {
                        String key = reader.GetAttribute("Key");
                        OutLineRectangleItem evt = new OutLineRectangleItem();
                        evt.ReadXml(reader);
                        m_DectedMarkers.Add(key, evt);//Dictionary<int, List<OutLineRectangleItem>>();
                    }
                }
                reader.Read();
            }
        }
Exemplo n.º 2
0
        public void WriteXml(XmlWriter writer)
        {
            writer.WriteAttributeString("Image_uri", p_Image_uri);
            writer.WriteAttributeString("FileName", p_FileName);

            if (m_EnterMarker != null)
            {
                writer.WriteAttributeString("Enternemo", XamlWriter.Save(m_EnterMarker));
            }
            if (m_SelMarker != null)
            {
                writer.WriteAttributeString("Selnemo", XamlWriter.Save(m_SelMarker));
            }
            if (m_preSelMarker != null)
            {
                writer.WriteAttributeString("preSelnemo", XamlWriter.Save(m_preSelMarker));
            }

            writer.WriteAttributeString("ImgId", String.Format("{0}", m_ImgId));

            foreach (var key in m_OutLineMarkers.Keys)
            {
                writer.WriteStartElement("OutLineMarkers");
                writer.WriteAttributeString("Key", key);
                OutLineRectangleItem evt = m_OutLineMarkers[key];
                evt.WriteXml(writer);
                writer.WriteEndElement();
            }

            foreach (var key in m_DectedMarkers.Keys)
            {
                writer.WriteStartElement("DectedMarkers");
                writer.WriteAttributeString("Key", key);
                writer.WriteAttributeString("Value", XamlWriter.Save(m_DectedMarkers[key]));
                writer.WriteEndElement();
            }
        }