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
{
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<DriveInfo> drivesList = new List<DriveInfo>();
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));

View file

@ -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<backup> 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;

View file

@ -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();

View file

@ -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);

View file

@ -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);

View file

@ -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(); }

View file

@ -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)
{