Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Manu
Backup Manager
Commits
70ae836d
Commit
70ae836d
authored
Jan 12, 2022
by
Manu
🏅
Browse files
Upgrade to .NET FW 4.8 & Cleanup
parent
eff3b470
Changes
108
Hide whitespace changes
Inline
Side-by-side
Source/BackupManager/BackupManager.BusinessLogic/BackupHandler.cs
View file @
70ae836d
...
...
@@ -2,7 +2,6 @@
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Threading.Tasks
;
using
System.Xml.Serialization
;
namespace
BackupManager.BackupProcessor
...
...
@@ -29,7 +28,7 @@ namespace BackupManager.BackupProcessor
internal
string
TargetLocation
{
get
;
set
;
}
private
List
<
BackupItem
>
BackupItems
=
new
List
<
BackupItem
>();
private
readonly
List
<
BackupItem
>
BackupItems
=
new
List
<
BackupItem
>();
/// <summary>
/// Is the backup process running?
...
...
@@ -39,10 +38,7 @@ namespace BackupManager.BackupProcessor
private
int
currentMajorProgress
=
0
;
public
int
CurrentMajorProgress
{
get
{
return
currentMajorProgress
;
}
get
=>
currentMajorProgress
;
set
{
currentMajorProgress
=
value
;
...
...
@@ -53,10 +49,7 @@ namespace BackupManager.BackupProcessor
private
int
maximumMajorProgress
=
1
;
public
int
MaximumMajorProgress
{
get
{
return
maximumMajorProgress
;
}
get
=>
maximumMajorProgress
;
set
{
maximumMajorProgress
=
value
;
...
...
@@ -64,13 +57,10 @@ namespace BackupManager.BackupProcessor
}
}
private
string
majorProgressText
=
S
tring
.
Empty
;
private
string
majorProgressText
=
s
tring
.
Empty
;
public
string
MajorProgressText
{
get
{
return
majorProgressText
;
}
get
=>
majorProgressText
;
set
{
majorProgressText
=
value
;
...
...
@@ -81,10 +71,7 @@ namespace BackupManager.BackupProcessor
private
int
currentMinorProgress
=
0
;
public
int
CurrentMinorProgress
{
get
{
return
currentMinorProgress
;
}
get
=>
currentMinorProgress
;
set
{
currentMinorProgress
=
value
;
...
...
@@ -95,10 +82,7 @@ namespace BackupManager.BackupProcessor
private
int
maximumMinorProgress
=
1
;
public
int
MaximumMinorProgress
{
get
{
return
maximumMinorProgress
;
}
get
=>
maximumMinorProgress
;
set
{
maximumMinorProgress
=
value
;
...
...
@@ -106,13 +90,10 @@ namespace BackupManager.BackupProcessor
}
}
private
string
minorProgressText
=
S
tring
.
Empty
;
private
string
minorProgressText
=
s
tring
.
Empty
;
public
string
MinorProgressText
{
get
{
return
minorProgressText
;
}
get
=>
minorProgressText
;
set
{
minorProgressText
=
value
;
...
...
Source/BackupManager/BackupManager.BusinessLogic/BackupItem.cs
View file @
70ae836d
...
...
@@ -11,10 +11,7 @@ namespace BackupManager.BusinessLogic
/// </summary>
public
string
Name
{
get
{
return
name
;
}
get
=>
name
;
set
{
name
=
value
;
...
...
@@ -29,10 +26,7 @@ namespace BackupManager.BusinessLogic
/// </summary>
public
string
Location
{
get
{
return
location
;
}
get
=>
location
;
set
{
location
=
value
;
...
...
@@ -47,10 +41,7 @@ namespace BackupManager.BusinessLogic
/// </summary>
public
DateTime
LastBackup
{
get
{
return
lastBackup
;
}
get
=>
lastBackup
;
set
{
lastBackup
=
value
;
...
...
@@ -65,10 +56,7 @@ namespace BackupManager.BusinessLogic
/// </summary>
public
DateTime
Created
{
get
{
return
created
;
}
get
=>
created
;
set
{
created
=
value
;
...
...
@@ -83,10 +71,7 @@ namespace BackupManager.BusinessLogic
/// </summary>
public
DateTime
Modified
{
get
{
return
modified
;
}
get
=>
modified
;
set
{
modified
=
value
;
...
...
@@ -98,10 +83,7 @@ namespace BackupManager.BusinessLogic
protected
void
OnPropertyChanged
(
string
propertyName
)
{
if
(
PropertyChanged
!=
null
)
{
PropertyChanged
(
this
,
new
PropertyChangedEventArgs
(
propertyName
));
}
PropertyChanged
?.
Invoke
(
this
,
new
PropertyChangedEventArgs
(
propertyName
));
}
}
}
\ No newline at end of file
Source/BackupManager/BackupManager.BusinessLogic/BackupItemLibrary.cs
View file @
70ae836d
...
...
@@ -39,15 +39,9 @@ namespace BackupManager.BusinessLogic
/// </summary>
public
string
TargetLocation
{
get
;
set
;
}
private
ObservableCollection
<
BackupItem
>
backupItems
=
new
ObservableCollection
<
BackupItem
>();
private
readonly
ObservableCollection
<
BackupItem
>
backupItems
=
new
ObservableCollection
<
BackupItem
>();
public
ObservableCollection
<
BackupItem
>
BackupItems
{
get
{
return
backupItems
;
}
}
public
ObservableCollection
<
BackupItem
>
BackupItems
=>
backupItems
;
/// <summary>
/// Loads Backup Items from a file
...
...
Source/BackupManager/BackupManager.BusinessLogic/BackupManager.BusinessLogic.csproj
View file @
70ae836d
...
...
@@ -9,7 +9,7 @@
<AppDesignerFolder>
Properties
</AppDesignerFolder>
<RootNamespace>
BackupManager.BusinessLogic
</RootNamespace>
<AssemblyName>
BackupManagerLogic
</AssemblyName>
<TargetFrameworkVersion>
v4.
7.1
</TargetFrameworkVersion>
<TargetFrameworkVersion>
v4.
8
</TargetFrameworkVersion>
<FileAlignment>
512
</FileAlignment>
<SccProjectName>
SAK
</SccProjectName>
<SccLocalPath>
SAK
</SccLocalPath>
...
...
Source/BackupManager/BackupManager.BusinessLogic/BackupProcessor.cs
View file @
70ae836d
using
BackupManager.BackupProcessor
;
using
System
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
BackupManager.BusinessLogic
{
...
...
@@ -32,21 +31,9 @@ namespace BackupManager.BusinessLogic
public
BackupHandler
BackupHandler
{
get
;
set
;
}
=
new
BackupHandler
();
public
bool
IsRunning
{
get
{
return
BackupHandler
.
IsRunning
;
}
}
public
bool
IsRunning
=>
BackupHandler
.
IsRunning
;
public
bool
IsCancelling
{
get
{
return
BackupHandler
.
IsCancelling
;
}
}
public
bool
IsCancelling
=>
BackupHandler
.
IsCancelling
;
/// <summary>
/// Start the backup process
...
...
Source/BackupManager/BackupManager.BusinessLogic/Properties/AssemblyInfo.cs
View file @
70ae836d
using
System.Reflection
;
using
System.Runtime.CompilerServices
;
using
System.Runtime.InteropServices
;
// General Information about an assembly is controlled through the following
...
...
Source/BackupManager/BackupManager.UserInterface/AboutWindow.xaml.cs
View file @
70ae836d
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows
;
using
System.Windows.Controls
;
using
System.Windows.Data
;
using
System.Windows.Documents
;
using
System.Windows.Input
;
using
System.Windows.Media
;
using
System.Windows.Media.Imaging
;
using
System.Windows.Shapes
;
using
System.Windows
;
namespace
BackupManager.UserInterface
{
...
...
Source/BackupManager/BackupManager.UserInterface/App.config
View file @
70ae836d
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
configuration
>
<
startup
>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.
7.1
"
/>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.
8
"
/>
</
startup
>
</
configuration
>
Source/BackupManager/BackupManager.UserInterface/BackupManager.UserInterface.csproj
View file @
70ae836d
...
...
@@ -9,7 +9,7 @@
<AppDesignerFolder>
Properties
</AppDesignerFolder>
<RootNamespace>
BackupManager.UserInterface
</RootNamespace>
<AssemblyName>
BackupManager
</AssemblyName>
<TargetFrameworkVersion>
v4.
7.1
</TargetFrameworkVersion>
<TargetFrameworkVersion>
v4.
8
</TargetFrameworkVersion>
<FileAlignment>
512
</FileAlignment>
<ProjectTypeGuids>
{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
</ProjectTypeGuids>
<WarningLevel>
4
</WarningLevel>
...
...
Source/BackupManager/BackupManager.UserInterface/BackupRunningWindow.xaml.cs
View file @
70ae836d
using
BackupManager.UserInterface.ViewModels
;
using
System.Threading.Tasks
;
using
System.Windows
;
namespace
BackupManager.UserInterface
...
...
Source/BackupManager/BackupManager.UserInterface/BackupSettingsWindow.xaml.cs
View file @
70ae836d
...
...
@@ -86,11 +86,13 @@ namespace BackupManager
{
BackupViewModel
backupViewModel
=
(
BackupViewModel
)
DataContext
;
BackupItem
newBackupItem
=
new
BackupItem
();
newBackupItem
.
Created
=
DateTime
.
Now
;
newBackupItem
.
Modified
=
DateTime
.
Now
;
newBackupItem
.
Name
=
""
;
newBackupItem
.
Location
=
""
;
BackupItem
newBackupItem
=
new
BackupItem
{
Created
=
DateTime
.
Now
,
Modified
=
DateTime
.
Now
,
Name
=
""
,
Location
=
""
};
backupViewModel
.
BackupItems
.
Add
(
newBackupItem
);
}
...
...
Source/BackupManager/BackupManager.UserInterface/Helpers.cs
View file @
70ae836d
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Linq
;
using
System.Windows
;
namespace
BackupManager
...
...
@@ -11,7 +7,7 @@ namespace BackupManager
{
public
static
bool
IsWindowOpen
<
T
>(
string
name
=
""
)
where
T
:
Window
{
return
S
tring
.
IsNullOrEmpty
(
name
)
return
s
tring
.
IsNullOrEmpty
(
name
)
?
Application
.
Current
.
Windows
.
OfType
<
T
>().
Any
()
:
Application
.
Current
.
Windows
.
OfType
<
T
>().
Any
(
w
=>
w
.
Name
.
Equals
(
name
));
}
...
...
Source/BackupManager/BackupManager.UserInterface/MainWindow.xaml.cs
View file @
70ae836d
...
...
@@ -15,8 +15,10 @@ namespace BackupManager
{
InitializeComponent
();
MainViewModel
mainViewModel
=
new
MainViewModel
();
mainViewModel
.
BackupItemLibraryFileName
=
""
;
MainViewModel
mainViewModel
=
new
MainViewModel
{
BackupItemLibraryFileName
=
""
};
DataContext
=
mainViewModel
;
mainViewModel
.
LoadSettings
();
...
...
Source/BackupManager/BackupManager.UserInterface/Properties/AssemblyInfo.cs
View file @
70ae836d
using
System.Reflection
;
using
System.Resources
;
using
System.Runtime.CompilerServices
;
using
System.Runtime.InteropServices
;
using
System.Windows
;
...
...
Source/BackupManager/BackupManager.UserInterface/Properties/Resources.Designer.cs
View file @
70ae836d
...
...
@@ -19,7 +19,7 @@ namespace BackupManager.UserInterface.Properties {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[
global
::
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"System.Resources.Tools.StronglyTypedResourceBuilder"
,
"1
5
.0.0.0"
)]
[
global
::
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"System.Resources.Tools.StronglyTypedResourceBuilder"
,
"1
7
.0.0.0"
)]
[
global
::
System
.
Diagnostics
.
DebuggerNonUserCodeAttribute
()]
[
global
::
System
.
Runtime
.
CompilerServices
.
CompilerGeneratedAttribute
()]
internal
class
Resources
{
...
...
Source/BackupManager/BackupManager.UserInterface/Properties/Settings.Designer.cs
View file @
70ae836d
...
...
@@ -12,7 +12,7 @@ namespace BackupManager.UserInterface.Properties {
[
global
::
System
.
Runtime
.
CompilerServices
.
CompilerGeneratedAttribute
()]
[
global
::
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator"
,
"1
5.
7.0.0"
)]
[
global
::
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator"
,
"17.0.
3.
0"
)]
internal
sealed
partial
class
Settings
:
global
::
System
.
Configuration
.
ApplicationSettingsBase
{
private
static
Settings
defaultInstance
=
((
Settings
)(
global
::
System
.
Configuration
.
ApplicationSettingsBase
.
Synchronized
(
new
Settings
())));
...
...
Source/BackupManager/BackupManager.UserInterface/RestoreWindow.xaml.cs
View file @
70ae836d
using
BackupManager.UserInterface.ViewModels
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows
;
using
System.Windows.Controls
;
using
System.Windows.Data
;
using
System.Windows.Documents
;
using
System.Windows.Input
;
using
System.Windows.Media
;
using
System.Windows.Media.Imaging
;
using
System.Windows.Shapes
;
namespace
BackupManager.UserInterface
{
...
...
Source/BackupManager/BackupManager.UserInterface/ViewModels/BackupRunningViewModel.cs
View file @
70ae836d
...
...
@@ -3,8 +3,6 @@ using BackupManager.BusinessLogic;
using
BackupManager.ViewModels
;
using
System
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Windows
;
namespace
BackupManager.UserInterface.ViewModels
{
...
...
@@ -31,10 +29,7 @@ namespace BackupManager.UserInterface.ViewModels
public
int
CurrentMajorProgress
{
get
{
return
BusinessLogic
.
BackupProcessor
.
GetInstance
().
BackupHandler
.
CurrentMajorProgress
;
}
get
=>
BusinessLogic
.
BackupProcessor
.
GetInstance
().
BackupHandler
.
CurrentMajorProgress
;
set
{
BusinessLogic
.
BackupProcessor
.
GetInstance
().
BackupHandler
.
CurrentMajorProgress
=
value
;
...
...
@@ -44,10 +39,7 @@ namespace BackupManager.UserInterface.ViewModels
public
int
MaximumMajorProgress
{
get
{
return
BusinessLogic
.
BackupProcessor
.
GetInstance
().
BackupHandler
.
MaximumMajorProgress
;
}
get
=>
BusinessLogic
.
BackupProcessor
.
GetInstance
().
BackupHandler
.
MaximumMajorProgress
;
set
{
BusinessLogic
.
BackupProcessor
.
GetInstance
().
BackupHandler
.
MaximumMajorProgress
=
value
;
...
...
@@ -57,10 +49,7 @@ namespace BackupManager.UserInterface.ViewModels
public
string
MajorProgressText
{
get
{
return
BusinessLogic
.
BackupProcessor
.
GetInstance
().
BackupHandler
.
MajorProgressText
;
}
get
=>
BusinessLogic
.
BackupProcessor
.
GetInstance
().
BackupHandler
.
MajorProgressText
;
set
{
BusinessLogic
.
BackupProcessor
.
GetInstance
().
BackupHandler
.
MajorProgressText
=
value
;
...
...
@@ -70,10 +59,7 @@ namespace BackupManager.UserInterface.ViewModels
public
int
CurrentMinorProgress
{
get
{
return
BusinessLogic
.
BackupProcessor
.
GetInstance
().
BackupHandler
.
CurrentMinorProgress
;
}
get
=>
BusinessLogic
.
BackupProcessor
.
GetInstance
().
BackupHandler
.
CurrentMinorProgress
;
set
{
BusinessLogic
.
BackupProcessor
.
GetInstance
().
BackupHandler
.
CurrentMinorProgress
=
value
;
...
...
@@ -83,10 +69,7 @@ namespace BackupManager.UserInterface.ViewModels
public
int
MaximumMinorProgress
{
get
{
return
BusinessLogic
.
BackupProcessor
.
GetInstance
().
BackupHandler
.
MaximumMinorProgress
;
}
get
=>
BusinessLogic
.
BackupProcessor
.
GetInstance
().
BackupHandler
.
MaximumMinorProgress
;
set
{
BusinessLogic
.
BackupProcessor
.
GetInstance
().
BackupHandler
.
MaximumMinorProgress
=
value
;
...
...
@@ -96,10 +79,7 @@ namespace BackupManager.UserInterface.ViewModels
public
string
MinorProgressText
{
get
{
return
BusinessLogic
.
BackupProcessor
.
GetInstance
().
BackupHandler
.
MinorProgressText
;
}
get
=>
BusinessLogic
.
BackupProcessor
.
GetInstance
().
BackupHandler
.
MinorProgressText
;
set
{
BusinessLogic
.
BackupProcessor
.
GetInstance
().
BackupHandler
.
MinorProgressText
=
value
;
...
...
@@ -110,10 +90,7 @@ namespace BackupManager.UserInterface.ViewModels
private
bool
isCancelButtonEnabled
=
false
;
public
bool
IsCancelButtonEnabled
{
get
{
return
isCancelButtonEnabled
;
}
get
=>
isCancelButtonEnabled
;
set
{
isCancelButtonEnabled
=
value
;
...
...
@@ -124,10 +101,7 @@ namespace BackupManager.UserInterface.ViewModels
private
string
cancelButtonText
=
"Cancel"
;
public
string
CancelButtonText
{
get
{
return
cancelButtonText
;
}
get
=>
cancelButtonText
;
set
{
cancelButtonText
=
value
;
...
...
Source/BackupManager/BackupManager.UserInterface/ViewModels/BackupViewModel.cs
View file @
70ae836d
using
BackupManager.BusinessLogic
;
using
System.Collections.ObjectModel
;
using
System
;
using
Ookii.Dialogs.Wpf
;
using
System.Windows.Media
;
using
System
;
using
System.Collections.ObjectModel
;
using
System.Windows
;
using
System.Windows.Media
;
namespace
BackupManager.ViewModels
{
...
...
@@ -11,10 +11,7 @@ namespace BackupManager.ViewModels
{
public
string
BackupItemLibraryFileName
{
get
{
return
BackupItemLibrary
.
GetInstance
().
FilePath
;
}
get
=>
BackupItemLibrary
.
GetInstance
().
FilePath
;
set
{
BackupItemLibrary
.
GetInstance
().
FilePath
=
value
;
...
...
@@ -29,10 +26,7 @@ namespace BackupManager.ViewModels
public
string
TargetLocation
{
get
{
return
BackupItemLibrary
.
GetInstance
().
TargetLocation
;
}
get
=>
BackupItemLibrary
.
GetInstance
().
TargetLocation
;
set
{
BackupItemLibrary
.
GetInstance
().
TargetLocation
=
value
;
...
...
@@ -40,22 +34,13 @@ namespace BackupManager.ViewModels
}
}
public
ObservableCollection
<
BackupItem
>
BackupItems
{
get
{
return
BackupItemLibrary
.
GetInstance
().
BackupItems
;
}
}
public
ObservableCollection
<
BackupItem
>
BackupItems
=>
BackupItemLibrary
.
GetInstance
().
BackupItems
;
private
BackupItem
selectedBackupItem
;
public
BackupItem
SelectedBackupItem
{
get
{
return
selectedBackupItem
;
}
get
=>
selectedBackupItem
;
set
{
selectedBackupItem
=
value
;
...
...
@@ -87,7 +72,7 @@ namespace BackupManager.ViewModels
internal
void
SaveBackupItemLibrary
()
{
if
(
BackupItemLibraryFileName
!=
S
tring
.
Empty
)
if
(
BackupItemLibraryFileName
!=
s
tring
.
Empty
)
{
Exception
e
=
BackupItemLibrary
.
GetInstance
().
SaveBackupItemLibraryToFile
();
if
(
e
!=
null
)
...
...
@@ -105,7 +90,7 @@ namespace BackupManager.ViewModels
{
VistaSaveFileDialog
saveFileDialog
=
new
VistaSaveFileDialog
();
if
(
BackupItemLibraryFileName
!=
S
tring
.
Empty
)
if
(
BackupItemLibraryFileName
!=
s
tring
.
Empty
)
{
saveFileDialog
.
FileName
=
BackupItemLibraryFileName
;
}
...
...
Source/BackupManager/BackupManager.UserInterface/ViewModels/MainViewModel.cs
View file @
70ae836d
...
...
@@ -11,10 +11,7 @@ namespace BackupManager.ViewModels
public
string
BackupItemLibraryFileName
{
get
{
return
BackupItemLibrary
.
GetInstance
().
FilePath
;
}
get
=>
BackupItemLibrary
.
GetInstance
().
FilePath
;
set
{
BackupItemLibrary
.
GetInstance
().
FilePath
=
value
;
...
...
Prev
1
2
3
4
5
6
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment