Example #1
0
 public override string serialize(object obj)
 {
     MainDetail md = (MainDetail)obj;
     StringBuilder builder = new StringBuilder();
     // opening tag
     builder.Append("<");
     builder.Append(getXmlNodeName());
     builder.Append(">");
     // title
     builder.Append("<title>");
     builder.Append(md.getTitle());
     builder.Append("</title>");
     // description
     builder.Append("<descr><![CDATA[");
     builder.Append(md.getDescr());
     builder.Append("]]></descr>");
     // media files
     MediaFilesXmlAdapter mfxa = new MediaFilesXmlAdapter(md.getMediaFiles());
     string mediaFilesXml = mfxa.serialize();
     builder.Append(mediaFilesXml);
     // closing tag
     builder.Append("</");
     builder.Append(getXmlNodeName());
     builder.Append(">");
     return builder.ToString();
 }
Example #2
0
        public override string serialize(object obj)
        {
            MainDetail    md      = (MainDetail)obj;
            StringBuilder builder = new StringBuilder();

            // opening tag
            builder.Append("<");
            builder.Append(getXmlNodeName());
            builder.Append(">");
            // title
            builder.Append("<title>");
            builder.Append(md.getTitle());
            builder.Append("</title>");
            // description
            builder.Append("<descr><![CDATA[");
            builder.Append(md.getDescr());
            builder.Append("]]></descr>");
            // media files
            MediaFilesXmlAdapter mfxa = new MediaFilesXmlAdapter(md.getMediaFiles());
            string mediaFilesXml      = mfxa.serialize();

            builder.Append(mediaFilesXml);
            // closing tag
            builder.Append("</");
            builder.Append(getXmlNodeName());
            builder.Append(">");
            return(builder.ToString());
        }
Example #3
0
        public override string serialize(object obj)
        {
            Poi           p       = (Poi)obj;
            StringBuilder builder = new StringBuilder();

            // opening tag
            builder.Append("<");
            builder.Append(getXmlNodeName());
            builder.Append(">");
            // lang
            builder.Append("<lang>");
            builder.Append(p.getLang());
            builder.Append("</lang>");
            // name
            builder.Append("<name>");
            builder.Append(p.getName());
            builder.Append("</name>");
            // latitude
            builder.Append("<latitude>");
            builder.Append(p.getLatitude());
            builder.Append("</latitude>");
            // longitude
            builder.Append("<longitude>");
            builder.Append(p.getLongitude());
            builder.Append("</longitude>");
            // type
            builder.Append("<type>");
            builder.Append(p.getType());
            builder.Append("</type>");
            // description
            builder.Append("<descr><![CDATA[");
            builder.Append(p.getDescr());
            builder.Append("]]></descr>");
            // media files
            MediaFilesXmlAdapter mfxa = new MediaFilesXmlAdapter(p.getMediaFiles());
            string mediaFilesXml      = mfxa.serialize();

            builder.Append(mediaFilesXml);
            // main details
            MainDetailsXmlAdapter mdxa = new MainDetailsXmlAdapter(p.getMainDetails());
            string mainDetailsXml      = mdxa.serialize();

            builder.Append(mainDetailsXml);
            // closing tag
            builder.Append("</");
            builder.Append(getXmlNodeName());
            builder.Append(">");
            return(builder.ToString());
        }
Example #4
0
 public override string serialize(object obj)
 {
     Poi p = (Poi)obj;
     StringBuilder builder = new StringBuilder();
     // opening tag
     builder.Append("<");
     builder.Append(getXmlNodeName());
     builder.Append(">");
     // lang
     builder.Append("<lang>");
     builder.Append(p.getLang());
     builder.Append("</lang>");
     // name
     builder.Append("<name>");
     builder.Append(p.getName());
     builder.Append("</name>");
     // latitude
     builder.Append("<latitude>");
     builder.Append(p.getLatitude());
     builder.Append("</latitude>");
     // longitude
     builder.Append("<longitude>");
     builder.Append(p.getLongitude());
     builder.Append("</longitude>");
     // type
     builder.Append("<type>");
     builder.Append(p.getType());
     builder.Append("</type>");
     // description
     builder.Append("<descr><![CDATA[");
     builder.Append(p.getDescr());
     builder.Append("]]></descr>");
     // media files
     MediaFilesXmlAdapter mfxa = new MediaFilesXmlAdapter(p.getMediaFiles());
     string mediaFilesXml = mfxa.serialize();
     builder.Append(mediaFilesXml);
     // main details
     MainDetailsXmlAdapter mdxa = new MainDetailsXmlAdapter(p.getMainDetails());
     string mainDetailsXml = mdxa.serialize();
     builder.Append(mainDetailsXml);
     // closing tag
     builder.Append("</");
     builder.Append(getXmlNodeName());
     builder.Append(">");
     return builder.ToString();
 }