//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // UCDocItems //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public static void UnitTest_DocItems() { UC_Collections.DocItems.Clear(); string _name = "CustomSideBar"; string _fName = "CustomSideBar.winDirectory"; string _path = @"C:\Users\Aji Suprana\Documents\Projects\Applications\20180314_WPFCustomSideBar\CustomSideBar"; UC_DocItem newDocPanel = UC_DocItem.Add(_name, _path, _fName, FileFormats.folder); _name = "Test123"; _fName = "Test123.winDirectory"; _path = @"C:\Users\Aji Suprana\Documents\Projects\Applications\20180314_WPFCustomSideBar\Test123"; UC_DocItem newDocPanel1 = UC_DocItem.Add(_name, _path, _fName, FileFormats.folder); //newDocPanel.Serialize(); JObject testResult = UC_Collections.SerializeDocItems(); Console.WriteLine("[UC_Collections][UnitTest_DocItems]"); Console.WriteLine(testResult.ToString()); }
public static void DeserializeDocItems(JObject obj) { Console.WriteLine("[UC_Collection]DeserializeDocItems"); DocItems.Clear(); if (obj["docItems"] == null) { return; } IList <JToken> docItemsObject = obj["docItems"].Children().ToList(); JArray test = new JArray(obj["docitems"]); foreach (var docItemObj in docItemsObject) { string content = docItemObj.ToString(); Console.WriteLine(content); UC_DocItem newItem = UC_DocItem.Add(docItemObj); //JObject temp = docItemObj; //Console.WriteLine(docItemObj["DocName"].ToString()); } UpdateIDs(); }