Ejemplo n.º 1
0
        public Game CheckIn(bool emergency)
        {
            lockerSettings settings = SettingsSystem.GetSettings(true);

            //alert the user of its death
            if (!emergency)
            {
                proc.WaitForExit((int)settings.checkInWait.TotalMilliseconds);
            }

            while (!proc.HasExited)
            {
                proc.Kill();
                proc.WaitForExit(10000);
            }
            if (!timeLog.detectedLogError() || usingDetailedTime)
            {
                timeLog.endSession(proc.ExitTime);
            }
            else if (timeLog.detectedLogError())
            {
                timeLog.addNewSession(proc.StartTime, proc.ExitTime);
            }
            else
            {
                //forget this session
            }
            locker.removeFile(unlock);
            TimeLogFactory.saveLog(timeLog);
            settings         = SettingsSystem.GetSettings();
            settings.lastTry = DateTime.Now;
            checkedout       = false;
            SettingsSystem.Sync();
            return(this);
        }
Ejemplo n.º 2
0
        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());
            }
        }
Ejemplo n.º 3
0
        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);
        }