Example #1
0
    void TestR5()
    {
      "Demonstrating Requirement #5".title();
	  DBElement<int, string> elem2 = new DBElement<int, string>();
      elem2.name = "element#2";//add a new key/value pairs
      elem2.descr = "test element#2";
      elem2.timeStamp = DateTime.Now;
      elem2.children.AddRange(new List<int>{ 16, 48 });
      elem2.payload = "elem#2's payload";
      db.insert(7, elem2);
	 
	  PersistToXML toxml  = new PersistToXML(db);
	  toxml.writeXML("Test.xml");
	  toxml.displayXML();
	  toxml.cleanDB();
	  
	  Write("\n --- Test read XML file Start---");
      LoadXML fromxml = new LoadXML(db, "ReadFile.xml");
	  fromxml.WriteToDBEngine();
	  
	  Write("\n\n Show key/value pairs in data base:\n");
      db.showDB();
	  
	  Write("\n --- Test read XML file End---");
      WriteLine();
    }
Example #2
0
	public void persistDB(XDocument message){//method used to persist a database to xml file
		XElement element = message.Element("Message").Element("File");
		PersistToXML toxml  = new PersistToXML(db);
		toxml.writeXML(element.Value);
		//toxml.displayXML();
		toxml.cleanDB();
	}