diff --git a/Saviour Backup System/USBTools.cs b/Saviour Backup System/USBTools.cs index 55fa7a2..aac0cbf 100644 --- a/Saviour Backup System/USBTools.cs +++ b/Saviour Backup System/USBTools.cs @@ -11,7 +11,7 @@ namespace Saviour_Backup_System { class USBTools { - internal static void initDriveScan(){ + public static void initDriveScan(){ Timer scanTimer = new Timer(); scanTimer.Elapsed += new ElapsedEventHandler(driveScanTick); scanTimer.Interval = 1000 * 7; //seconds to check for new drives @@ -33,7 +33,7 @@ namespace Saviour_Backup_System //check if record exists in database } } - internal static DriveInfo[] getConnectedDrives() + public static DriveInfo[] getConnectedDrives() { List drivesList = new List(); DriveInfo[] drives = DriveInfo.GetDrives(); @@ -48,14 +48,14 @@ namespace Saviour_Backup_System } - internal static void safelyEjectDrive(string driveChar) + public static void safelyEjectDrive(string driveChar) { driveChar = driveChar.Remove(driveChar.Length - 1); RemoveDriveTools.RemoveDrive(driveChar); } - internal static string getDriveType(DriveInfo selectedDrive) + public static string getDriveType(DriveInfo selectedDrive) { string driveTypeDecoded = "Error decoding drive details!"; switch (selectedDrive.DriveType) @@ -86,7 +86,7 @@ namespace Saviour_Backup_System } - internal static int countDrives() + public static int countDrives() { int numberofDrives = 0; foreach (DriveInfo drive in getConnectedDrives()) { numberofDrives++; } @@ -94,7 +94,7 @@ namespace Saviour_Backup_System } - internal static int spacePercentage(DriveInfo drive) + public static int spacePercentage(DriveInfo drive) { double capacity = (double)(drive.TotalSize / (1024 * 1024)); double free = (double)(drive.AvailableFreeSpace / (1024 * 1024)); diff --git a/Saviour Backup System/databaseTools.cs b/Saviour Backup System/databaseTools.cs index f2659e3..8a2acb2 100644 --- a/Saviour Backup System/databaseTools.cs +++ b/Saviour Backup System/databaseTools.cs @@ -12,8 +12,8 @@ namespace Saviour_Backup_System { class databaseTools { - internal static string databaseName = "saviour.sdf"; - internal static SqlCeConnection conn = new SqlCeConnection("Data Source = " + databaseName + "; password=12a712d7e6f71ed07822c219318da2c0"); //password is a hash + public static string databaseName = "saviour.sdf"; + public static SqlCeConnection conn = new SqlCeConnection("Data Source = " + databaseName + "; password=12a712d7e6f71ed07822c219318da2c0"); //password is a hash private static SqlCeCommand cmd = conn.CreateCommand(); private static void copyDatabase() @@ -22,12 +22,12 @@ namespace Saviour_Backup_System } - internal static void init() { + public static void init() { if (!File.Exists(databaseName)) { //if the database doesnt exists (program hasnt been run before) copyDatabase(); } } - internal static backup[] getBackups() + public static backup[] getBackups() { List backups = null; conn.Open(); @@ -53,13 +53,13 @@ namespace Saviour_Backup_System class backup { - internal string driveID; - internal string name; - internal Int64 startDate; - internal string hash; - internal Int32 duration; + public string driveID; + public string name; + public Int64 startDate; + public string hash; + public Int32 duration; - internal void store() + public void store() { SqlCeCommand cmd = databaseTools.conn.CreateCommand(); cmd.CommandText = ""; @@ -67,7 +67,7 @@ namespace Saviour_Backup_System cmd.Dispose(); } - internal void update() + public void update() { databaseTools.conn.Open(); SqlCeCommand cmd = databaseTools.conn.CreateCommand(); @@ -77,7 +77,7 @@ namespace Saviour_Backup_System cmd.Dispose(); } - internal void create(string Drive_ID, string Backup_Name, Int64 Start_Date, string Hash, Int32 Duration ) { + public void create(string Drive_ID, string Backup_Name, Int64 Start_Date, string Hash, Int32 Duration ) { driveID = Drive_ID; name = Backup_Name; startDate = Start_Date; diff --git a/Saviour Backup System/mainWindow.cs b/Saviour Backup System/mainWindow.cs index 75898b2..41a7834 100644 --- a/Saviour Backup System/mainWindow.cs +++ b/Saviour Backup System/mainWindow.cs @@ -23,7 +23,7 @@ namespace Saviour_Backup_System } catch { } } - internal void removeDisplay() { + public void removeDisplay() { formatDriveCapacityTimer.Stop(); driveRefreshTimer.Stop(); connectedDrivesList.Update(); @@ -32,7 +32,7 @@ namespace Saviour_Backup_System setup.icon.notifyIcon.Visible = true; } - internal void showDisplay() { + public void showDisplay() { refreshDriveList(); connectedDrivesList.Update(); connectedDrivesList.Items[0].Selected = true; @@ -43,7 +43,7 @@ namespace Saviour_Backup_System this.Show(); } - internal void refreshDriveList() { + public void refreshDriveList() { DriveInfo[] drives = USBTools.getConnectedDrives(); if (connectedDrivesList.Items.Count == USBTools.countDrives()) { return; } //if there is no change in the numer connectedDrivesList.Items.Clear(); diff --git a/Saviour Backup System/notificationIcon.cs b/Saviour Backup System/notificationIcon.cs index b7d27fb..a8e6653 100644 --- a/Saviour Backup System/notificationIcon.cs +++ b/Saviour Backup System/notificationIcon.cs @@ -9,10 +9,10 @@ namespace Saviour_Backup_System { class notificationIcon : IDisposable { - internal NotifyIcon notifyIcon = new NotifyIcon() ; - internal ContextMenu contextMenu = new ContextMenu(); + public NotifyIcon notifyIcon = new NotifyIcon() ; + public ContextMenu contextMenu = new ContextMenu(); - internal notificationIcon() + public notificationIcon() { notifyIcon.Text = "Saviour Backup System"; notifyIcon.Icon = Properties.Resources.redCDIconICO; @@ -31,7 +31,7 @@ namespace Saviour_Backup_System private void showProgress(object sender, EventArgs e) { return; } //nothing yet! private void closeProgram(object sender, EventArgs e) { setup.closeProgram(); } - internal void displayStillRunning() { + public void displayStillRunning() { string title = "I'm Still Here!"; string message = "Saviour Backup System is still running in the background"; notifyIcon.ShowBalloonTip(2000, title, message, ToolTipIcon.Info); diff --git a/Saviour Backup System/setup.cs b/Saviour Backup System/setup.cs index a56ac0e..c92676c 100644 --- a/Saviour Backup System/setup.cs +++ b/Saviour Backup System/setup.cs @@ -13,13 +13,13 @@ namespace Saviour_Backup_System { class setup { - internal static string[] runtimeArguements = null; - internal static mainWindow MW; - internal static notificationIcon icon; - internal static splashScreen SS; - internal static string username = Environment.UserName; //snapshots the username + public static string[] runtimeArguements = null; + public static mainWindow MW; + public static notificationIcon icon; + public static splashScreen SS; + public static string username = Environment.UserName; //snapshots the username - internal static void initProgram(string[] args) + public static void initProgram(string[] args) { runtimeArguements = args; SS = new splashScreen(); @@ -37,7 +37,7 @@ namespace Saviour_Backup_System - internal static void closeProgram() + public static void closeProgram() { string exitMessage = "Are you sure you want to close Saviour Backup System?\nAll copying backups and backup scanning will cease."; DialogResult result = MessageBox.Show(exitMessage, "Saviour Backup System Exiting...", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); diff --git a/Saviour Backup System/splashScreen.cs b/Saviour Backup System/splashScreen.cs index dc67b24..576b31d 100644 --- a/Saviour Backup System/splashScreen.cs +++ b/Saviour Backup System/splashScreen.cs @@ -17,7 +17,7 @@ namespace Saviour_Backup_System InitializeComponent(); } - internal void display(bool isStartup) { + public void display(bool isStartup) { this.Show(); this.desc.Text = "Initialising..."; if (isStartup) { this.Hide(); } diff --git a/Saviour Backup System/tools.cs b/Saviour Backup System/tools.cs index 143f5cc..1e91c1c 100644 --- a/Saviour Backup System/tools.cs +++ b/Saviour Backup System/tools.cs @@ -8,7 +8,7 @@ namespace Saviour_Backup_System { class tools { - internal static string Trim(string value, int maxLength) + public static string Trim(string value, int maxLength) { if (value.Length > maxLength) {