/// <summary> /// Check the system root folder in documents /// </summary> public EllyApplication() { epath = HelperFactory.GetModuleByType <EPath>(); if (epath == null) { Debug.Log(GetInfo().ModuleName, "Cannot get EPath", Debug.DebugType.LogError); return; } InitializeFolder(); ReadAppinfo(); }
/// <summary> /// Reading data from "document/data/language" /// And if there is no data in the folder, create a empty one. /// </summary> public override void OnLoad() { base.OnLoad(); epath = HelperFactory.GetModuleByType <EPath>(); if (epath == null) { Debug.Log(GetInfo().ModuleName, "Cannot get EPath", Debug.DebugType.LogError); return; } ReadAppLanguage(); }
/// <summary> /// writing message on end of target logging text file /// </summary> /// <param name="o"></param> private static void FileUpdate(string newLine) { EPath epath = HelperFactory.GetModuleByType <EPath>(); /* Lastest */ string[] currentLastest = File.ReadAllLines(Path.Combine(epath._ApplicationConfigPath(), EPath.ApplicationData, EPath.ApplicationLog, "Lastest log.txt")); List <string> _currentLastest = new List <string>(currentLastest); _currentLastest.Add(newLine); File.WriteAllLines(Path.Combine(epath._ApplicationConfigPath(), EPath.ApplicationData, EPath.ApplicationLog, "Lastest log.txt"), _currentLastest.ToArray()); /* Datetime */ if (File.Exists(Path.Combine(epath._ApplicationConfigPath(), EPath.ApplicationData, EPath.ApplicationLog, Filename))) { File.Delete(Path.Combine(epath._ApplicationConfigPath(), EPath.ApplicationData, EPath.ApplicationLog, Filename)); } File.WriteAllLines(Path.Combine(epath._ApplicationConfigPath(), EPath.ApplicationData, EPath.ApplicationLog, Filename), Message); }