From a365f4df2ef37729052ae5b3e2e722306d64d71f Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 24 Nov 2019 13:30:47 +0200 Subject: Added backup restore interfaces. --- .../BackupRestore/BackupEventArgs.cs | 16 ++++++++++ .../Tango.PPC.Common/BackupRestore/BackupFile.cs | 12 +++++++ .../BackupRestore/BackupRestoreEventArgs.cs | 16 ++++++++++ .../BackupRestore/BackupRestoreStage.cs | 37 ++++++++++++++++++++++ .../BackupRestore/BackupSettings.cs | 16 ++++++++++ .../Tango.PPC.Common/BackupRestore/BackupStage.cs | 23 ++++++++++++++ .../BackupRestore/IBackupManager.cs | 18 +++++++++++ 7 files changed, 138 insertions(+) create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/BackupRestore/BackupEventArgs.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/BackupRestore/BackupFile.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/BackupRestore/BackupRestoreEventArgs.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/BackupRestore/BackupRestoreStage.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/BackupRestore/BackupSettings.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/BackupRestore/BackupStage.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/BackupRestore/IBackupManager.cs (limited to 'Software/Visual_Studio/PPC') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/BackupRestore/BackupEventArgs.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/BackupRestore/BackupEventArgs.cs new file mode 100644 index 000000000..6de357b4f --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/BackupRestore/BackupEventArgs.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Common.BackupRestore +{ + public class BackupEventArgs : EventArgs + { + public bool IsIntermediate { get; set; } + public double Progress { get; set; } + public double MaxProgress { get; set; } + public BackupStage Stage { get; set; } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/BackupRestore/BackupFile.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/BackupRestore/BackupFile.cs new file mode 100644 index 000000000..a864614f5 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/BackupRestore/BackupFile.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Common.BackupRestore +{ + class BackupFile + { + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/BackupRestore/BackupRestoreEventArgs.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/BackupRestore/BackupRestoreEventArgs.cs new file mode 100644 index 000000000..7851d99fa --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/BackupRestore/BackupRestoreEventArgs.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Common.BackupRestore +{ + public class BackupRestoreEventArgs : EventArgs + { + public bool IsIntermediate { get; set; } + public double Progress { get; set; } + public double MaxProgress { get; set; } + public BackupStage Stage { get; set; } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/BackupRestore/BackupRestoreStage.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/BackupRestore/BackupRestoreStage.cs new file mode 100644 index 000000000..ce59a18bb --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/BackupRestore/BackupRestoreStage.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Common.BackupRestore +{ + public enum BackupRestoreStage + { + [Description("Initializing")] + Initializing, + + //Backup + [Description("Backing up data...")] + BackingupDatabase, + [Description("Backing up application...")] + BackingupApplication, + [Description("Backing up settings...")] + BackingupSettings, + [Description("Writing settings...")] + WritingSettings, + [Description("Compressing files...")] + CompressingFiles, + [Description("Finalizing backup...")] + FinalizingBackup, + + //Restore + [Description("Validating backup...")] + ValidatingBackup, + [Description("Extracting content...")] + ExtractingContent, + [Description("Restoring data...")] + RestoringDatabase, + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/BackupRestore/BackupSettings.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/BackupRestore/BackupSettings.cs new file mode 100644 index 000000000..d1225a609 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/BackupRestore/BackupSettings.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Common.BackupRestore +{ + public class BackupSettings + { + public bool IncludeDatabase { get; set; } + public bool IncludeApplication { get; set; } + public bool IncludeFirmware { get; set; } + public bool IncludeSettings { get; set; } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/BackupRestore/BackupStage.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/BackupRestore/BackupStage.cs new file mode 100644 index 000000000..d5a81e401 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/BackupRestore/BackupStage.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Common.BackupRestore +{ + public enum BackupStage + { + [Description("Initializing")] + Initializing, + [Description("Creating database backup...")] + CreatingDatabaseBackup, + [Description("Creating application backup...")] + CreatingApplicationBackup, + [Description("Compressing files...")] + CompressingFiles, + [Description("Finalizing backup...")] + Finalizing, + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/BackupRestore/IBackupManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/BackupRestore/IBackupManager.cs new file mode 100644 index 000000000..6a91ebc3d --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/BackupRestore/IBackupManager.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Common.BackupRestore +{ + public interface IBackupManager + { + /// + /// Creates a backup file containing database, application and firmware versions. + /// + /// The file path. + /// + Task CreateBackup(String filePath); + } +} -- cgit v1.3.1