コード例 #1
0
 /*
  * Button: Open SaveLog dialog.
  * */
 private void buttonSaveLog_Click(object sender, EventArgs e)
 {
     if (File.Exists(Config.Get("gameDir") + App.outputLogPath))
     {
         FormSaveLog saveLogDialog = new FormSaveLog();
         saveLogDialog.ShowDialog();
     }
     else
     {
         ErrorMessage.ShowErrorMessage("We couldn't find output_log.txt. Try running the game first?");
         //TODO: better exception handling.
     }
 }
コード例 #2
0
        private void Process_Exited(object sender, EventArgs e)
        {
            isRunning = false;
            Debug.WriteLine("timer, exited");
            // Do something if autosave is prompt or automatic.
            switch (Config.Get("autosave"))
            {
            case "prompt":
                FormSaveLog saveDialog = new FormSaveLog(true);
                saveDialog.ShowDialog();
                break;

            case "automatic":
                string lastWriteDate = App.OutputLogLastWriteDate().ToString().Replace(':', '-');
                App.CopyOutputLog(string.Format("{0}output_log_{1}.txt", App.saveLogAutosavePath, lastWriteDate));
                break;
            }
        }