1
Fork 0

changed all internal 'modifiers' to 'public'.

This commit is contained in:
Jake Howard 2014-11-11 22:55:14 +00:00
parent 3d7999f34c
commit 5c43791941
7 changed files with 34 additions and 34 deletions

View file

@ -11,7 +11,7 @@ namespace Saviour_Backup_System
{ {
class USBTools class USBTools
{ {
internal static void initDriveScan(){ public static void initDriveScan(){
Timer scanTimer = new Timer(); Timer scanTimer = new Timer();
scanTimer.Elapsed += new ElapsedEventHandler(driveScanTick); scanTimer.Elapsed += new ElapsedEventHandler(driveScanTick);
scanTimer.Interval = 1000 * 7; //seconds to check for new drives scanTimer.Interval = 1000 * 7; //seconds to check for new drives
@ -33,7 +33,7 @@ namespace Saviour_Backup_System
//check if record exists in database //check if record exists in database
} }
} }
internal static DriveInfo[] getConnectedDrives() public static DriveInfo[] getConnectedDrives()
{ {
List<DriveInfo> drivesList = new List<DriveInfo>(); List<DriveInfo> drivesList = new List<DriveInfo>();
DriveInfo[] drives = DriveInfo.GetDrives(); 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); driveChar = driveChar.Remove(driveChar.Length - 1);
RemoveDriveTools.RemoveDrive(driveChar); RemoveDriveTools.RemoveDrive(driveChar);
} }
internal static string getDriveType(DriveInfo selectedDrive) public static string getDriveType(DriveInfo selectedDrive)
{ {
string driveTypeDecoded = "Error decoding drive details!"; string driveTypeDecoded = "Error decoding drive details!";
switch (selectedDrive.DriveType) switch (selectedDrive.DriveType)
@ -86,7 +86,7 @@ namespace Saviour_Backup_System
} }
internal static int countDrives() public static int countDrives()
{ {
int numberofDrives = 0; int numberofDrives = 0;
foreach (DriveInfo drive in getConnectedDrives()) { numberofDrives++; } 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 capacity = (double)(drive.TotalSize / (1024 * 1024));
double free = (double)(drive.AvailableFreeSpace / (1024 * 1024)); double free = (double)(drive.AvailableFreeSpace / (1024 * 1024));

View file

@ -12,8 +12,8 @@ namespace Saviour_Backup_System
{ {
class databaseTools class databaseTools
{ {
internal static string databaseName = "saviour.sdf"; public static string databaseName = "saviour.sdf";
internal static SqlCeConnection conn = new SqlCeConnection("Data Source = " + databaseName + "; password=12a712d7e6f71ed07822c219318da2c0"); //password is a hash public static SqlCeConnection conn = new SqlCeConnection("Data Source = " + databaseName + "; password=12a712d7e6f71ed07822c219318da2c0"); //password is a hash
private static SqlCeCommand cmd = conn.CreateCommand(); private static SqlCeCommand cmd = conn.CreateCommand();
private static void copyDatabase() 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) if (!File.Exists(databaseName)) { //if the database doesnt exists (program hasnt been run before)
copyDatabase(); copyDatabase();
} }
} }
internal static backup[] getBackups() public static backup[] getBackups()
{ {
List<backup> backups = null; List<backup> backups = null;
conn.Open(); conn.Open();
@ -53,13 +53,13 @@ namespace Saviour_Backup_System
class backup class backup
{ {
internal string driveID; public string driveID;
internal string name; public string name;
internal Int64 startDate; public Int64 startDate;
internal string hash; public string hash;
internal Int32 duration; public Int32 duration;
internal void store() public void store()
{ {
SqlCeCommand cmd = databaseTools.conn.CreateCommand(); SqlCeCommand cmd = databaseTools.conn.CreateCommand();
cmd.CommandText = ""; cmd.CommandText = "";
@ -67,7 +67,7 @@ namespace Saviour_Backup_System
cmd.Dispose(); cmd.Dispose();
} }
internal void update() public void update()
{ {
databaseTools.conn.Open(); databaseTools.conn.Open();
SqlCeCommand cmd = databaseTools.conn.CreateCommand(); SqlCeCommand cmd = databaseTools.conn.CreateCommand();
@ -77,7 +77,7 @@ namespace Saviour_Backup_System
cmd.Dispose(); 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; driveID = Drive_ID;
name = Backup_Name; name = Backup_Name;
startDate = Start_Date; startDate = Start_Date;

View file

@ -23,7 +23,7 @@ namespace Saviour_Backup_System
} catch { } } catch { }
} }
internal void removeDisplay() { public void removeDisplay() {
formatDriveCapacityTimer.Stop(); formatDriveCapacityTimer.Stop();
driveRefreshTimer.Stop(); driveRefreshTimer.Stop();
connectedDrivesList.Update(); connectedDrivesList.Update();
@ -32,7 +32,7 @@ namespace Saviour_Backup_System
setup.icon.notifyIcon.Visible = true; setup.icon.notifyIcon.Visible = true;
} }
internal void showDisplay() { public void showDisplay() {
refreshDriveList(); refreshDriveList();
connectedDrivesList.Update(); connectedDrivesList.Update();
connectedDrivesList.Items[0].Selected = true; connectedDrivesList.Items[0].Selected = true;
@ -43,7 +43,7 @@ namespace Saviour_Backup_System
this.Show(); this.Show();
} }
internal void refreshDriveList() { public void refreshDriveList() {
DriveInfo[] drives = USBTools.getConnectedDrives(); DriveInfo[] drives = USBTools.getConnectedDrives();
if (connectedDrivesList.Items.Count == USBTools.countDrives()) { return; } //if there is no change in the numer if (connectedDrivesList.Items.Count == USBTools.countDrives()) { return; } //if there is no change in the numer
connectedDrivesList.Items.Clear(); connectedDrivesList.Items.Clear();

View file

@ -9,10 +9,10 @@ namespace Saviour_Backup_System
{ {
class notificationIcon : IDisposable class notificationIcon : IDisposable
{ {
internal NotifyIcon notifyIcon = new NotifyIcon() ; public NotifyIcon notifyIcon = new NotifyIcon() ;
internal ContextMenu contextMenu = new ContextMenu(); public ContextMenu contextMenu = new ContextMenu();
internal notificationIcon() public notificationIcon()
{ {
notifyIcon.Text = "Saviour Backup System"; notifyIcon.Text = "Saviour Backup System";
notifyIcon.Icon = Properties.Resources.redCDIconICO; 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 showProgress(object sender, EventArgs e) { return; } //nothing yet!
private void closeProgram(object sender, EventArgs e) { setup.closeProgram(); } private void closeProgram(object sender, EventArgs e) { setup.closeProgram(); }
internal void displayStillRunning() { public void displayStillRunning() {
string title = "I'm Still Here!"; string title = "I'm Still Here!";
string message = "Saviour Backup System is still running in the background"; string message = "Saviour Backup System is still running in the background";
notifyIcon.ShowBalloonTip(2000, title, message, ToolTipIcon.Info); notifyIcon.ShowBalloonTip(2000, title, message, ToolTipIcon.Info);

View file

@ -13,13 +13,13 @@ namespace Saviour_Backup_System
{ {
class setup class setup
{ {
internal static string[] runtimeArguements = null; public static string[] runtimeArguements = null;
internal static mainWindow MW; public static mainWindow MW;
internal static notificationIcon icon; public static notificationIcon icon;
internal static splashScreen SS; public static splashScreen SS;
internal static string username = Environment.UserName; //snapshots the username public static string username = Environment.UserName; //snapshots the username
internal static void initProgram(string[] args) public static void initProgram(string[] args)
{ {
runtimeArguements = args; runtimeArguements = args;
SS = new splashScreen(); 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."; 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); DialogResult result = MessageBox.Show(exitMessage, "Saviour Backup System Exiting...", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

View file

@ -17,7 +17,7 @@ namespace Saviour_Backup_System
InitializeComponent(); InitializeComponent();
} }
internal void display(bool isStartup) { public void display(bool isStartup) {
this.Show(); this.Show();
this.desc.Text = "Initialising..."; this.desc.Text = "Initialising...";
if (isStartup) { this.Hide(); } if (isStartup) { this.Hide(); }

View file

@ -8,7 +8,7 @@ namespace Saviour_Backup_System
{ {
class tools class tools
{ {
internal static string Trim(string value, int maxLength) public static string Trim(string value, int maxLength)
{ {
if (value.Length > maxLength) if (value.Length > maxLength)
{ {