-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,272 changed files
with
42,751 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+31.3 KB
Source/.vs/SBWPF/FileContentIndex/29098328-89e8-481e-9ee8-583aa81327e2.vsidx
Binary file not shown.
Binary file added
BIN
+32.5 KB
Source/.vs/SBWPF/FileContentIndex/60710d79-3de5-460b-aebb-a61011e3048f.vsidx
Binary file not shown.
Binary file added
BIN
+133 KB
Source/.vs/SBWPF/FileContentIndex/848d6297-069b-4378-8310-fe1f200d26a5.vsidx
Binary file not shown.
Binary file added
BIN
+34 KB
Source/.vs/SBWPF/FileContentIndex/8da7fe76-c7e3-433b-a903-74342de0766d.vsidx
Binary file not shown.
Binary file added
BIN
+40.4 KB
Source/.vs/SBWPF/FileContentIndex/fab0c1c7-a26f-4932-895a-f92c77bd228d.vsidx
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.8.34525.116 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SBWPF", "SBWPF\SBWPF.csproj", "{7E20945D-1C3F-4C6B-9A96-F27DF1D7E86E}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{7E20945D-1C3F-4C6B-9A96-F27DF1D7E86E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{7E20945D-1C3F-4C6B-9A96-F27DF1D7E86E}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{7E20945D-1C3F-4C6B-9A96-F27DF1D7E86E}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{7E20945D-1C3F-4C6B-9A96-F27DF1D7E86E}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {0046E2B5-B339-4CC9-9CAA-B3546D1DD0AC} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<Window x:Class="SBWPF.AboutDialog" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:local="clr-namespace:SBWPF" | ||
xmlns:hc="https://handyorg.github.io/handycontrol" | ||
mc:Ignorable="d" | ||
Title="AboutDialog" Height="300" Width="600" Style="{DynamicResource CustomWindowStyle}" hc:Theme.Skin="Dark"> | ||
<Grid> | ||
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Stretch" Orientation="Vertical"> | ||
<TextBlock FontSize="18" HorizontalAlignment="Center" >Smartli Backup 2.0</TextBlock> | ||
<TextBlock FontSize="12" HorizontalAlignment="Center" x:Name="versionLabel">Version: 2.0.0.0</TextBlock> | ||
<TextBlock FontSize="12" HorizontalAlignment="Center">Licensed under the MIT licence</TextBlock> | ||
<Separator hc:Theme.Skin="Dark" Margin="0 15"></Separator> | ||
<TextBlock FontSize="14" HorizontalAlignment="Center">Thanks To:</TextBlock> | ||
<TextBlock FontSize="12" HorizontalAlignment="Center">HandyControl (MIT Licence)</TextBlock> | ||
<TextBlock FontSize="12" HorizontalAlignment="Center">Newtonsoft.Json (MIT Licence)</TextBlock> | ||
<TextBlock FontSize="12" HorizontalAlignment="Center">SharpVectors / SharpVectors.wpf (BSD-3 Licence)</TextBlock> | ||
<TextBlock FontSize="12" HorizontalAlignment="Center">SVGImage (MIT Licence)</TextBlock> | ||
<TextBlock FontSize="12" HorizontalAlignment="Center">Bootstrap Icons (MIT Licence)</TextBlock> | ||
<Button Style="{StaticResource ButtonPrimary}" Click="Button_Click" Margin="15" Content="Licence Files" hc:BorderElement.CornerRadius="15"></Button> | ||
</StackPanel> | ||
</Grid> | ||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Reflection; | ||
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 SBWPF | ||
{ | ||
/// <summary> | ||
/// Interaktionslogik für AboutDialog.xaml | ||
/// </summary> | ||
public partial class AboutDialog : Window | ||
{ | ||
public AboutDialog() | ||
{ | ||
InitializeComponent(); | ||
Version version = Assembly.GetExecutingAssembly().GetName().Version; | ||
versionLabel.Text = "Version " + version.ToString(); | ||
} | ||
|
||
private void Button_Click(object sender, RoutedEventArgs e) | ||
{ | ||
var appPath = new FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).DirectoryName; | ||
var licencePath = System.IO.Path.Combine(appPath, "Legal"); | ||
|
||
Process.Start("explorer.exe", licencePath); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<Application x:Class="SBWPF.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="clr-namespace:SBWPF" | ||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml" | ||
StartupUri="MainWindow.xaml"> | ||
<Application.Resources> | ||
<ResourceDictionary> | ||
<ResourceDictionary.MergedDictionaries> | ||
<!-- Contains all of the colours and brushes for a theme --> | ||
<ResourceDictionary Source="Themes/ColourDictionaries/SoftDark.xaml"/> | ||
<!-- Contains most of the control-specific brushes which reference --> | ||
<!-- the above theme. I aim for this to contain ALL brushes, not most --> | ||
<ResourceDictionary Source="Themes/ControlColours.xaml"/> | ||
<!-- Contains all of the control styles (Button, ListBox, etc) --> | ||
<ResourceDictionary Source="Themes/Controls.xaml"/> | ||
<ResourceDictionary Source="Styles/CustomStyles.xaml" /> | ||
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml"/> | ||
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml"/> | ||
</ResourceDictionary.MergedDictionaries> | ||
</ResourceDictionary> | ||
</Application.Resources> | ||
</Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System.Configuration; | ||
using System.Data; | ||
using System.Windows; | ||
|
||
namespace SBWPF | ||
{ | ||
/// <summary> | ||
/// Interaction logic for App.xaml | ||
/// </summary> | ||
public partial class App : Application | ||
{ | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System.Windows; | ||
|
||
[assembly: ThemeInfo( | ||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located | ||
//(used if a resource is not found in the page, | ||
// or application resource dictionaries) | ||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located | ||
//(used if a resource is not found in the page, | ||
// app, or any theme specific resource dictionaries) | ||
)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<Window x:Class="SBWPF.BackupPlanWindow" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:local="clr-namespace:SBWPF" | ||
xmlns:hc="https://handyorg.github.io/handycontrol" | ||
mc:Ignorable="d" | ||
Title="Backup Plan" Height="450" Width="600" Style="{DynamicResource CustomWindowStyle}"> | ||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="40"></RowDefinition> | ||
<RowDefinition Height="40"></RowDefinition> | ||
<RowDefinition Height="40"></RowDefinition> | ||
<RowDefinition Height="*"></RowDefinition> | ||
<RowDefinition Height="40"></RowDefinition> | ||
</Grid.RowDefinitions> | ||
<Grid Grid.Row="0"> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="1*"></ColumnDefinition> | ||
<ColumnDefinition Width="3*"></ColumnDefinition> | ||
</Grid.ColumnDefinitions> | ||
<TextBlock Margin="5" Text="Backup Name" VerticalAlignment="Center"></TextBlock> | ||
<TextBox x:Name="backupNameTextbox" hc:Theme.Skin="Dark" Grid.Column="1" Margin="5"></TextBox> | ||
</Grid> | ||
<Grid Grid.Row="1"> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="1*"></ColumnDefinition> | ||
<ColumnDefinition Width="3*"></ColumnDefinition> | ||
</Grid.ColumnDefinitions> | ||
<TextBlock Margin="5" Text="Schedule" VerticalAlignment="Center"></TextBlock> | ||
<hc:ComboBox x:Name="ScheduleCombobox" hc:Theme.Skin="Dark" Margin="5" Grid.Column="1"></hc:ComboBox> | ||
</Grid> | ||
<StackPanel Orientation="Horizontal" Grid.Row="2" HorizontalAlignment="Right"> | ||
<Button x:Name="addFolderButton" Click="addFolderButton_Click" MinWidth="120" Content="Add Directory" Margin="5" Style="{StaticResource ButtonPrimary}" hc:BorderElement.CornerRadius="5" /> | ||
<Button x:Name="addFileButton" Click="addFileButton_Click" MinWidth="120" Content="Add File" Margin="5" Style="{StaticResource ButtonPrimary}" hc:BorderElement.CornerRadius="5" /> | ||
<Button x:Name="removeSelection" Click="removeSelection_Click" MinWidth="120" Content="Remove Selection" Margin="5" Style="{StaticResource ButtonDanger}" hc:BorderElement.CornerRadius="5" /> | ||
</StackPanel> | ||
<ListView x:Name="backupSources" Grid.Row="3" Margin="5" hc:Theme.Skin="Dark"> | ||
<ListView.View> | ||
<GridView> | ||
<GridViewColumn Width="auto" Header="Name" DisplayMemberBinding="{Binding Name}" ></GridViewColumn> | ||
<GridViewColumn Width="auto" Header="Path" DisplayMemberBinding="{Binding Path}"></GridViewColumn> | ||
<GridViewColumn Width="auto" Header="Type" DisplayMemberBinding="{Binding Type}"></GridViewColumn> | ||
</GridView> | ||
</ListView.View> | ||
</ListView> | ||
<StackPanel Orientation="Horizontal" Grid.Row="4" HorizontalAlignment="Right"> | ||
<Button x:Name="createPlanButton" Click="createPlanButton_Click" Content="Save Backup Plan" Margin="5" Style="{StaticResource ButtonPrimary}" hc:BorderElement.CornerRadius="15" /> | ||
</StackPanel> | ||
</Grid> | ||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
using Backuper; | ||
using Microsoft.Win32; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.IO; | ||
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 SBWPF | ||
{ | ||
/// <summary> | ||
/// Interaktionslogik für NewPlanDialog.xaml | ||
/// </summary> | ||
public partial class BackupPlanWindow : Window | ||
{ | ||
public Backuper.BackupPlan BackupPlan { get; set; } | ||
|
||
private ObservableCollection<Backuper.BackupSource> m_backupSources; | ||
private MainWindow m_mainWindow; | ||
|
||
|
||
public BackupPlanWindow(BackupPlan plan, MainWindow mainWindow) | ||
{ | ||
BackupPlan = plan; | ||
m_mainWindow = mainWindow; | ||
|
||
InitializeComponent(); | ||
|
||
m_backupSources = new ObservableCollection<BackupSource>(plan.Sources); | ||
backupSources.ItemsSource = m_backupSources; | ||
|
||
var nameBinding = new Binding("Name"); | ||
nameBinding.Source = BackupPlan; | ||
nameBinding.Mode = BindingMode.TwoWay; | ||
backupNameTextbox.SetBinding(TextBox.TextProperty, nameBinding); | ||
|
||
ScheduleCombobox.ItemsSource = Enum.GetValues(typeof(Backuper.Schedule)); | ||
var schedulebinding = new Binding("Schedule"); | ||
schedulebinding.Source = BackupPlan; | ||
schedulebinding.Mode = BindingMode.TwoWay; | ||
ScheduleCombobox.SetBinding(ComboBox.SelectedItemProperty, schedulebinding); | ||
} | ||
|
||
private void addFolderButton_Click(object sender, RoutedEventArgs e) | ||
{ | ||
OpenFolderDialog openFolderDialog = new OpenFolderDialog(); | ||
if(openFolderDialog.ShowDialog() == true) | ||
{ | ||
var folderInfo = new FileInfo(openFolderDialog.FolderName); | ||
|
||
var backupSource = new BackupSource(); | ||
backupSource.Name = folderInfo.Name; | ||
backupSource.Path = openFolderDialog.FolderName; | ||
backupSource.Type = Backuper.Type.Directory; | ||
|
||
m_backupSources.Add(backupSource); | ||
} | ||
} | ||
|
||
private void addFileButton_Click(object sender, RoutedEventArgs e) | ||
{ | ||
OpenFileDialog openFileDialog = new OpenFileDialog(); | ||
if (openFileDialog.ShowDialog() == true) | ||
{ | ||
var folderInfo = new FileInfo(openFileDialog.FileName); | ||
|
||
var backupSource = new BackupSource(); | ||
backupSource.Name = folderInfo.Name; | ||
backupSource.Path = openFileDialog.FileName; | ||
backupSource.Type = Backuper.Type.File; | ||
|
||
m_backupSources.Add(backupSource); | ||
} | ||
} | ||
|
||
private void removeSelection_Click(object sender, RoutedEventArgs e) | ||
{ | ||
if(backupSources.SelectedItem != null) | ||
{ | ||
m_backupSources.Remove((BackupSource)backupSources.SelectedItem); | ||
} | ||
} | ||
|
||
private void createPlanButton_Click(object sender, RoutedEventArgs e) | ||
{ | ||
BackupPlan.Sources = m_backupSources.ToList(); | ||
Console.WriteLine(BackupPlan.Name); | ||
m_mainWindow.SavePlans(); | ||
this.Close(); | ||
} | ||
|
||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using Backuper; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Threading; | ||
|
||
namespace SBWPF | ||
{ | ||
public class BackupWorker | ||
{ | ||
public DispatcherTimer Timer { get; set; } | ||
public Guid Guid { get; set; } | ||
private MainWindow m_mainWindow; | ||
private BackupPlan m_backupPlan; | ||
|
||
public BackupWorker(MainWindow mainWindow, BackupPlan plan) | ||
{ | ||
m_mainWindow = mainWindow; | ||
m_backupPlan = plan; | ||
Guid = Guid.NewGuid(); | ||
} | ||
|
||
public void StartTimer(int intervall) | ||
{ | ||
m_mainWindow.ShowPlanProgress(m_backupPlan); | ||
Timer = new DispatcherTimer(); | ||
Timer.Tick += Timer_Tick; | ||
Timer.Interval = TimeSpan.FromMicroseconds(intervall); | ||
Timer.Start(); | ||
} | ||
|
||
public void StopTimer() | ||
{ | ||
Timer.Stop(); | ||
m_mainWindow.HidePlanProgress(m_backupPlan); | ||
} | ||
|
||
private void Timer_Tick(object? sender, EventArgs e) | ||
{ | ||
m_mainWindow.Dispatcher.InvokeAsync(() => | ||
{ | ||
m_mainWindow.ShowPlanProgress(m_backupPlan); | ||
}); | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.