예제 #1
0
        public static void Update()
        {
            if (Root != null)
            {
                return;
            }

            Root = new Dictionary <string, IDictionary>();

            string Book = FileTools.LoadTextFile(BookkeepingFileName, FileMode.OpenOrCreate);

            if (Book == null)
            {
                Book = "";
            }

            string[] Lines = Book.Split('\n');
            foreach (string Line in Lines)
            {
                if (string.IsNullOrEmpty(Line))
                {
                    continue;
                }

                if (Line.EndsWith("/"))
                {
                    IList <string> DirectoryPath = FromDirectoryName(Line);
                    InsertDirectory(DirectoryPath, out bool inserted);
                }
                else
                {
                    IList <string> FilePath = FromFileName(Line);
                    InsertFile(FilePath, out bool inserted);
                }
            }
        }
예제 #2
0
        private static void Commit()
        {
            string Content = CommitPersistentState();

            FileTools.CommitTextFile(PersistentStatePath, Content);
        }