Example #1
0
        /// <summary>
        ///     Saves the dictionary according to its filename
        /// </summary>
        public void Save()
        {
            Util.DontNotify(() =>
            {
                if (Watcher != null)
                {
                    Watcher.StopWatching();
                }

                Updater updater = new Updater(true);
                updater.visit(this);

                VersionedWriter writer = new VersionedWriter(FilePath);
                unParse(writer, false);
                writer.Close();

                updater = new Updater(false);
                updater.visit(this);

                if (Watcher != null)
                {
                    Watcher.StartWatching();
                }

                foreach (DeleteFilesHandler file in FilesToDelete)
                {
                    file.DeleteFile();
                }
                FilesToDelete.Clear();
            });
        }
Example #2
0
        /// <summary>
        ///     Saves the frame provided associated to this frame ref
        /// </summary>
        /// <param name="frame"></param>
        public void SaveFrame(Frame frame)
        {
            Directory.CreateDirectory(Path.GetDirectoryName(FileName));

            VersionedWriter writer = new VersionedWriter(FileName);

            frame.unParse(writer, false);
            writer.Close();
        }
Example #3
0
        /// <summary>
        ///     Saves the chapter provided associated to this chapter ref
        /// </summary>
        /// <param name="chapter"></param>
        public void SaveChapter(Chapter chapter)
        {
            Directory.CreateDirectory(Path.GetDirectoryName(FileName));

            VersionedWriter writer = new VersionedWriter(FileName);

            chapter.unParse(writer, false);
            writer.Close();
        }
        /// <summary>
        /// Saves the dictionary according to its filename
        /// </summary>
        public void save()
        {
            Updater updater = new Updater(BasePath);

            updater.visit(this);

            VersionedWriter writer = new VersionedWriter(FilePath);

            unParse(writer, false);
            writer.Close();
        }
Example #5
0
        /// <summary>
        ///     Removes the temporary file associated to that item
        /// </summary>
        public void ClearTempFile()
        {
            VersionedWriter writer = new VersionedWriter(FileName);

            writer.Close();
        }