mirror of
https://github.com/Stone-Red-Code/AutoBackup.git
synced 2026-09-04 00:46:07 +02:00
Cleanup
This commit is contained in:
@@ -4,26 +4,24 @@ using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Security.AccessControl;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace AutoBackup
|
||||
{
|
||||
class Backup
|
||||
internal class Backup
|
||||
{
|
||||
volatile public int processCount = 0;
|
||||
public List<string> currentStatus = new List<string>();
|
||||
public bool windowVisible = false;
|
||||
|
||||
|
||||
List<string> sourceFolders = new List<string>();
|
||||
List<List<string>> destinationFolders = new List<List<string>>();
|
||||
List<ulong[]> optionsList = new List<ulong[]>();
|
||||
List<bool> isRunning = new List<bool>();
|
||||
readonly Stopwatch stopwatch;
|
||||
readonly Timer timer;
|
||||
bool isON = false;
|
||||
private List<string> sourceFolders = new List<string>();
|
||||
private List<List<string>> destinationFolders = new List<List<string>>();
|
||||
private List<ulong[]> optionsList = new List<ulong[]>();
|
||||
private List<bool> isRunning = new List<bool>();
|
||||
private readonly Stopwatch stopwatch;
|
||||
private readonly Timer timer;
|
||||
private bool isON = false;
|
||||
|
||||
public Backup()
|
||||
{
|
||||
@@ -60,9 +58,8 @@ namespace AutoBackup
|
||||
*/
|
||||
}
|
||||
|
||||
void CheckIfFilesChanged()
|
||||
private void CheckIfFilesChanged()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void OFF()
|
||||
@@ -141,7 +138,7 @@ namespace AutoBackup
|
||||
}
|
||||
}
|
||||
|
||||
void BackupFolder(int index, ulong maxBackupFolders)
|
||||
private void BackupFolder(int index, ulong maxBackupFolders)
|
||||
{
|
||||
if (index < destinationFolders.Count)
|
||||
{
|
||||
@@ -180,7 +177,7 @@ namespace AutoBackup
|
||||
}
|
||||
}
|
||||
|
||||
void DeleteDirectory(string targetDir)
|
||||
private void DeleteDirectory(string targetDir)
|
||||
{
|
||||
File.SetAttributes(targetDir, FileAttributes.Normal);
|
||||
|
||||
@@ -201,7 +198,7 @@ namespace AutoBackup
|
||||
Directory.Delete(targetDir, false);
|
||||
}
|
||||
|
||||
int CopyDirecotory(string sourcePath, string destinationPath, int index, int fileCount, int filesCopied = 0)
|
||||
private int CopyDirecotory(string sourcePath, string destinationPath, int index, int fileCount, int filesCopied = 0)
|
||||
{
|
||||
if (isON == false) return 0;
|
||||
if (!HasReadAccessToFolder(sourcePath)) return 0;
|
||||
@@ -261,7 +258,7 @@ namespace AutoBackup
|
||||
return filesCopied;
|
||||
}
|
||||
|
||||
int GetFileCount(string path)
|
||||
private int GetFileCount(string path)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -294,7 +291,6 @@ namespace AutoBackup
|
||||
hasAccess = false;
|
||||
}
|
||||
return hasAccess;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
-15
@@ -1,31 +1,27 @@
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace AutoBackup
|
||||
{
|
||||
public partial class MainForm : Form
|
||||
{
|
||||
List<string> sourceFolders = new List<string>();
|
||||
List<List<string>> destinationFolders = new List<List<string>>();
|
||||
List<int[]> optionsList = new List<int[]>();
|
||||
readonly Backup backup;
|
||||
private List<string> sourceFolders = new List<string>();
|
||||
private List<List<string>> destinationFolders = new List<List<string>>();
|
||||
private List<int[]> optionsList = new List<int[]>();
|
||||
private readonly Backup backup;
|
||||
|
||||
bool addSourceFolder = true;
|
||||
bool blockWrite = false;
|
||||
private bool addSourceFolder = true;
|
||||
private bool blockWrite = false;
|
||||
|
||||
readonly string localApplicationDataPath;
|
||||
private readonly string localApplicationDataPath;
|
||||
|
||||
const string AppName = "AutoBackup";
|
||||
const string registrykey = "HKEY_CURRENT_USER\\" + AppName;
|
||||
private const string AppName = "AutoBackup";
|
||||
private const string registrykey = "HKEY_CURRENT_USER\\" + AppName;
|
||||
|
||||
public MainForm()
|
||||
{
|
||||
@@ -103,7 +99,7 @@ namespace AutoBackup
|
||||
statusLabel.Text = textToDisplay;
|
||||
}
|
||||
|
||||
void LoadFolders()
|
||||
private void LoadFolders()
|
||||
{
|
||||
if (!File.Exists(localApplicationDataPath + "\\data.save"))
|
||||
return;
|
||||
@@ -384,7 +380,6 @@ namespace AutoBackup
|
||||
|
||||
private void MainForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-5
@@ -1,18 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace AutoBackup
|
||||
{
|
||||
static class Program
|
||||
internal static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// Der Haupteinstiegspunkt für die Anwendung.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
private static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||
|
||||
Reference in New Issue
Block a user