Exemplo n.º 1
0
        /// <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);
        }
Exemplo n.º 2
0
        private void DetectLanFolderSize()
        {
            string[] langaugeDataPaths = Directory.GetFiles(Path.Combine(epath._ApplicationConfigPath(), EPath.ApplicationData, EPath.ApplicationLanguage));

            if (langaugeDataPaths.Length == 0)
            {
                Debug.Log(GetInfo().ModuleName, "No language detect, create a empty default one", Debug.DebugType.Log);
                File.WriteAllText(Path.Combine(epath._ApplicationConfigPath(), EPath.ApplicationData, EPath.ApplicationLanguage, "DefaultLan.json"),
                                  JsonConvert.SerializeObject(
                                      new LanguageStruct("DefaultTag", new LanguageCategory[] {
                    new LanguageCategory("Default category",
                                         new LanguageLabel[] {
                        new LanguageLabel("Default ID", "Test")
                    })
                }), Formatting.Indented));
                return;
            }
        }
Exemplo n.º 3
0
 private void InitializeFolder()
 {
     CheckExistss(new string[] {
         /* document/Elly Sandbox/ */
         epath._ApplicationConfigPath(),
         /* document/Elly Sandbox/bin */
         Path.Combine(epath._ApplicationConfigPath(), EPath.ApplicationBin),
         /* document/Elly Sandbox/data */
         Path.Combine(epath._ApplicationConfigPath(), EPath.ApplicationData),
         /* document/Elly Sandbox/data/language */
         Path.Combine(epath._ApplicationConfigPath(), EPath.ApplicationData, EPath.ApplicationLanguage),
         /* document/Elly Sandbox/data/logs */
         Path.Combine(epath._ApplicationConfigPath(), EPath.ApplicationData, EPath.ApplicationLog),
         /* document/Elly Sandbox/mods */
         Path.Combine(epath._ApplicationConfigPath(), EPath.ApplicationMods),
         /* document/Elly Sandbox/web */
         Path.Combine(epath._ApplicationConfigPath(), EPath.ApplicationWeb),
         /* document/Elly Sandbox/setting */
         Path.Combine(epath._ApplicationConfigPath(), EPath.ApplicationSetting)
     });
 }