Пример #1
0
        /// <summary>
        /// Export the Userdata and images into the .vnbak file
        /// <see cref="ExportUserData"/>
        /// </summary>
        public void ExportUserData()
        {
            try
            {
                string savePath;
                var    settings = new FolderBrowserDialogSettings();
                bool?  result   = _dialogService.ShowFolderBrowserDialog(this, settings);
                if (result == true)
                {
                    savePath = settings.SelectedPath;
                }
                else
                {
                    return;
                }


                var fileName  = $@"{savePath}\VnManager_Export_{DateTime.UtcNow:yyyy-MMMM-dd}.vnbak";
                var didCreate = ImportExportHelper.Compact(fileName);
                if (didCreate)
                {
                    _windowManager.ShowMessageBox($"{App.ResMan.GetString("UserDataExportedPath")}\n{fileName}", $"{App.ResMan.GetString("UserDataExportedTitle")}");
                }
            }
            catch (Exception e)
            {
                App.Logger.Warning(e, "Failed to export userData");
                SentryHelper.SendException(e, null, SentryLevel.Error);
            }
        }