/// <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(); }
/// <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); }