static void Main(string [] args) { foreach (string arg in Environment.GetCommandLineArgs()) { if (arg == "uninstall") { locker.unlockAllFiles(); Application.Exit(); } } //initialize Application lockerSettings settings = new lockerSettings(); if (settings.fileMap.Count > 0 && settings.fileMap[0] == "begin") { settings.fileMap.Clear(); settings.fileList.Clear(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new OptionsForm()); settings.Save(); Application.Restart(); } else { SettingsSystem.init(); SettingsSystem.Sync(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new PlayGame()); } }
static void Main(string [] args) { foreach (string arg in Environment.GetCommandLineArgs()) { if (arg == "uninstall") { locker.unlockAllFiles(); Application.Exit(); } } //initialize Application lockerSettings settings = new lockerSettings(); if (settings.fileMap.Count > 0 && settings.fileMap[0] == "begin") { settings.fileMap.Clear(); settings.fileList.Clear(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new OptionsForm()); settings.Save(); Application.Restart(); } else { SettingsSystem.init(); SettingsSystem.Sync(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new PlayGame()); } }
private void loadLocker() { if (File.Exists(locker.homeDir + "Locker.dat")) { settings.fileList.Clear(); settings.fileMap.Clear(); FileStream fskey = new FileStream(locker.homeDir + "Locker.dat", FileMode.Open, FileAccess.Read); BinaryReader br = new BinaryReader(fskey); int FileCount = br.ReadInt32(); int MapCount = br.ReadInt32(); string file; int i; for (i = 0; i < FileCount; i++) { file = br.ReadString(); settings.fileList.Add(file); } for (i = 0; i < MapCount; i++) { file = br.ReadString(); settings.fileMap.Add(file); } br.Close(); settings.Save(); } else { saveLocker(); } }
public static string lockFile(string filename) { encryptFile(filename, filename); lockerSettings settings = new lockerSettings(); settings.Reload(); settings.fileList.Add(filename); settings.Save(); SettingsSystem.Sync(); return filename; }
public static string lockFile(string filename) { encryptFile(filename, filename); lockerSettings settings = new lockerSettings(); settings.Reload(); settings.fileList.Add(filename); settings.Save(); SettingsSystem.Sync(); return(filename); }
private void saveOptions() { settings.Reload(); settings.alertBeforeKill = optionsAlertBeforeKill.Checked; settings.alertAudible = optionsAudible.Checked; settings.checkInWait = new TimeSpan(0, (int)optionsCheckInTime.Value, 0); settings.incorrectWait = new TimeSpan(0, (int)optionsIncorrectWait.Value, 0); settings.probability = (int)optionsProbability.Value; settings.alertTakeFocus = optionsTakeFocus.Checked; settings.timedGame = new TimeSpan(0, (int)optionsTimedGame.Value, 0); settings.alertVisual = optionsVisual.Checked; settings.waitToPlay = new TimeSpan(0, (int)optionsWaitToPlay.Value, 0); settings.Save(); }
private void buttonLock_Click(object sender, EventArgs e) { DialogResult result = openFileDialogExecutible.ShowDialog(); if (result == DialogResult.OK) { NameDialog named = new NameDialog(); if (named.ShowDialog() == DialogResult.OK) { locker.lockFile(openFileDialogExecutible.FileName); settings = SettingsSystem.GetSettings(); settings.fileMap.Add(named.textBox1.Text); settings.Save(); refreshList(); } } }
private void buttonLock_Click(object sender, EventArgs e) { DialogResult result = openFileDialogExecutible.ShowDialog(); if (result == DialogResult.OK) { NameDialog named = new NameDialog(); if (named.ShowDialog() == DialogResult.OK) { locker.lockFile(openFileDialogExecutible.FileName); settings = SettingsSystem.GetSettings(); settings.fileMap.Add(named.textBox1.Text); settings.Save(); refreshList(); } } }