public void Add(HDirectory directory)
        {
            JsonDirectoryWriter topDirectoryWriter = directoryStack.Peek();
            JsonDirectoryWriter newDirectoryWriter = topDirectoryWriter.WriteStartDirectory(directory.Name);

            newDirectoryWriter.WriteEnd();
        }
        public JsonDirectoryWriter WriteStartDirectory(string directoryName)
        {
            WriteEndFilesArray();
            WriteStartDirectoriesArray();

            JsonDirectoryWriter jsonDirectoryWriter = new JsonDirectoryWriter(Writer);

            jsonDirectoryWriter.WriteStart(directoryName);

            return(jsonDirectoryWriter);
        }
 public void AddAndOpen(HDirectory directory)
 {
     if (directoryStack.Count == 0)
     {
         directoryStack.Push(jsonSnapshotWriter);
     }
     else
     {
         JsonDirectoryWriter topDirectoryWriter = directoryStack.Peek();
         JsonDirectoryWriter newDirectoryWriter = topDirectoryWriter.WriteStartDirectory(directory.Name);
         directoryStack.Push(newDirectoryWriter);
     }
 }
        public void Add(HFile file)
        {
            JsonDirectoryWriter topDirectoryWriter = directoryStack.Peek();

            topDirectoryWriter.WriteFile(file);
        }
        public void CloseDirectory()
        {
            JsonDirectoryWriter topDirectoryWriter = directoryStack.Pop();

            topDirectoryWriter.WriteEnd();
        }