Пример #1
0
        private static void PersistBackgroundWorkerOnDoWork(object sender, DoWorkEventArgs e)
        {
            var xmlSaver = new DiaryXmlWriter();
            var arg      = (PersistDreamEntriesArgs)e.Argument;

            var result = xmlSaver.WriteEntriesToFile(arg.Path, arg.Entries.Where(entry => !entry.ToDelete));

            e.Result = result ? PersistenceOperationResult.Successful : PersistenceOperationResult.Error;
        }
Пример #2
0
        public void CreateDatabaseFile(string path)
        {
            var writer = new DiaryXmlWriter();

            writer.CreateFile(path);
        }