private void LoadSettings() { _loadingSettings = true; txtSaveLocation.Text = Settings.Default.SaveFileLocation; numBackupInterval.Value = Settings.Default.BackupInterval; BackupTimer.Interval = (int)(numBackupInterval.Value * 60000); chkAutoBackup.Checked = Settings.Default.AutomaticBackup; txtAutoBackupLocation.Text = Settings.Default.AutomaticBackupDirectory; txtBackupDirectory.Text = Settings.Default.BackupDirectory; chkHideRestoreWarning.Checked = Settings.Default.HideRestoreWarning; chkTrayMinimize.Checked = Settings.Default.TrayMinimize; if (Settings.Default.AutomaticBackup) { BackupTimer.Enabled = true; BackupTimer.Start(); Log($"Starting automatic backups every {Settings.Default.BackupInterval} minutes"); } btnBackup.Enabled = Sekiro.IsProfilePathValid(Settings.Default.SaveFileLocation); _loadingSettings = false; }
public App() { Reset(); Logger.Info("Starting backup application"); SetUiCulture(); InitTrayIcon(); _backup = new BackupTimer(ShowMessage); _backup.Start(); //var title = Backup.Properties.Resources.StartNotificationTitle; //var content = Backup.Properties.Resources.StartNotificationContent; //_trayIcon.ShowBalloonTip(5000, title, content, System.Windows.Forms.ToolTipIcon.Info); }
private void MainWindow_Load(object sender, EventArgs e) { _console = new MConsole(); _console.CreateConsole(); ColorCodes.Add(ConsoleColor.DarkYellow); ColorCodes.Add(ConsoleColor.Green); ColorCodes.Add(ConsoleColor.Cyan); ColorCodes.Add(ConsoleColor.Gray); ColorCodes.Add(ConsoleColor.Red); OutputLogLegend(); Log("AutoStart in 4 Seconds...", MServer.UTILITY); _Server = new MServer(); IPAddressBox.Text = _Server.ServerIPAddress; PortBox.Text = _Server.ServerPort.ToString(); _Server.Version = MVersion.VERSION.ToString(); _Server.ZoneChanged += _Server_ZoneChanged; _Server.UniverseChanged += _Server_UniverseChanged; _Server.ServerInfo += _Server_ServerInfo; _Server.MetricInfo += _Server_MetricInfo; _Server.ClientConnected += _Server_ClientConnected; _Server.ClientLoggedIn += _Server_ClientLoggedIn; _Server.ClientDisconnected += _Server_ClientDisconnected; Log("Created Server Version:" + _Server.Version, MServer.UTILITY); Text += " v" + _Server.Version; LocalName = HostInfo.HostName; //ConnectionsList.DataSource = MassiveConnections; //ZoneList.DataSource = MassiveZones; ZoneList.DisplayMember = "Name"; #if DEBUG timer1.Interval = 1000; Text += " DEBUG"; #endif timer1.Start(); BackupTimer.Start(); // NetworkTimer.Start(); #if DEBUG #else #endif MaxConnectionsLabel.Text = "Max Connections" + MServer.MAXCONNECTIONS; Log("Backup schedule is: Backup every " + (BackupTimer.Interval / 3600000) + " hour", 3); GetPublicIP(); }
private void chkAutoBackup_CheckedChanged(object sender, EventArgs e) { SaveSettings(); BackupTimer.Enabled = chkAutoBackup.Checked; if (chkAutoBackup.Checked) { BackupTimer.Start(); } else { BackupTimer.Stop(); } }