/// <summary> /// Serialize items using helper class /// </summary> /// <param name="path">Path to the file to be created</param> private void serializeItems(string path, List <FileItem> currentFiles, List <FolderItem> currentFolders) { var serialization = new JsonSerializationHelper(); serialization.Serialize(currentFiles, Path.Combine(path, JSONFILENAME)); serialization.Serialize(currentFolders, Path.Combine(path, JSONFOLDERSNAME)); }
/// <summary> /// Deserialize files using helper class /// </summary> /// <param name="path">Path to the serialized file</param> private object deserializeItems(string path, ItemType itemType) { var serialization = new JsonSerializationHelper(); switch (itemType) { case ItemType.File: return(serialization.Deserialize <List <FileItem> >(Path.Combine(path))); case ItemType.Folder: return(serialization.Deserialize <List <FolderItem> >(Path.Combine(path))); default: return(null); } }