Beispiel #1
0
        public static void SaveState()
        {
            var stateModel = new StateModel
            {
                Notebooks = NotebooksRepository.Get(),
                Pages     = PagesRepository.Get(),
                Content   = PageContentRepository.GetAll()
            };

            var json = Newtonsoft.Json.JsonConvert.SerializeObject(stateModel);

            var settingsModel = GetSettingsModel();

            var dataToSave = json.Encrypt(settingsModel);

            File.WriteAllBytes(settingsModel.File, dataToSave);

            UiNotifications.Notify(ConsoleColor.Red, ConsoleColor.Black, "Saved to Disk...", 5);

            Task.Run(() => dataToSave.SaveToBlobAsync(settingsModel));
        }