|
using System;
using System.Collections.Generic;
using System.Text;
using ConsoleApplication1.data;
using Bulasoft.Common.Serialization;
using System.Drawing;
using System.IO;
using System.Xml.Serialization;
using System.Collections;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
AdvancedSerialization();
}
private static void AdvancedSerialization()
{
TreeItemCollection collection = new TreeItemCollection();
TreeItem root = collection.Add("root");
root.Color = Color.Red;
root.Icon = "icon1";
TreeItem item1 = collection.Add("item1");
item1.Color = Color.Black;
item1.Icon = "icon2";
TreeItem item2 = collection.Add("item2");
item2.Color = Color.White;
item2.Icon = "icon1";
TreeItem item11 = collection.Add("item11");
item11.Color = Color.Purple;
item11.Parent = item11;
item11.Icon = "icon3";
Writer.Write(collection, "test.xml", false);
collection.AcceptChanges();
item11.Parent = root;
Writer.Write(collection, "changes.xml", true);
TreeItemCollection collection2 = new TreeItemCollection();
Reader.Read("test.xml", collection2, null);
Reader.Read("changes.xml", collection2, null);
TreeItem rItem = collection2.FindElem(root.ID.Value);
TreeItem new_item11 = collection2.Find(item11.Name);
if (new_item11.Parent == rItem)
Console.WriteLine("Perfect");
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.