Ejemplo n.º 1
0
        public XmlDocument GetPersonXML()
        {
            PersonJSONAdaptee personJSONAdapte = new PersonJSONAdaptee();
            string            jsonPerson       = personJSONAdapte.GetPersonListJSON();

            XmlDocument doc = JsonConvert.DeserializeXmlNode(jsonPerson, "PersonList", true);

            return(doc);
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            PersonJSONAdaptee json = new PersonJSONAdaptee();
            PersonXMLAdapter  xml  = new PersonXMLAdapter();

            Program p = new Program(json);

            Console.WriteLine("=================JSON====================");
            Console.WriteLine(p._json.GetPersonListJSON().ToString());

            p = new Program(xml);
            Console.WriteLine("=================XML=====================");
            Console.WriteLine(p._xml.GetPersonXML().InnerXml);

            Console.ReadKey();
        }
Ejemplo n.º 3
0
 public Program(PersonJSONAdaptee json)
 {
     this._json = json;
 }