예제 #1
0
파일: ESMForm.cs 프로젝트: yikliu/WiredIn
 /// <summary>
 /// Initializes a new instance of the <see cref="ESMForm"/> class.
 /// </summary>
 /// <param name="s">The s.</param>
 public ESMForm(TimeSpan s)
 {
     InitializeComponent();
     this.span = s;
     esm = new ESM();
     esm.Wasted = s;
     DateTime n = DateTime.Now;
     esm.Time = n.ToShortDateString() + " " + n.ToShortTimeString();
 }
예제 #2
0
파일: ESMForm.cs 프로젝트: yikliu/WiredIn
        /// <summary>
        /// Logs the specified a esm.
        /// </summary>
        /// <param name="aESM">A esm.</param>
        private void Log(ESM aESM)
        {
            string folder = Path.Combine(config.WiredInFolder, "log");
            folder = Path.Combine(folder, RunIDKeeper.GetIDKeeper().GetRunID());
            if (!Directory.Exists(folder))
            {
                Directory.CreateDirectory(folder);
            }

            logFile = Path.Combine(folder, "esm.json");
            _jsonLogger = new JsonLogger();
            string json_content = JsonConvert.SerializeObject(aESM);
            _jsonLogger.LogThisToHere(json_content, logFile);
        }