static IniSettings() { IniSettings.initialized = false; IniSettings.writetime = 3; IniSettings.LoadLock = new object(); IniSettings.LogLock = new object(); IniSettings.processname = Process.GetCurrentProcess().ProcessName; IniSettings.processfile = string.Concat(IniSettings.processname, ".exe"); IniSettings.PROCESSPATHKEY = string.Concat(IniSettings.processname, "_Folder"); IniSettings.sb = new StringBuilder(); TimeSpan timeSpan = TimeSpan.FromSeconds((double)IniSettings.LogWriterTime); IniSettings.timer = new System.Timers.Timer(timeSpan.TotalMilliseconds) { AutoReset = false }; IniSettings.timer.Elapsed += new ElapsedEventHandler(IniSettings.timer_Elapsed); try { if (File.Exists(IniSettings.LogFilePath)) { File.Delete(IniSettings.LogFilePath); } } catch (Exception exception) { IniSettings.Error(string.Concat("IniSettings:\n", exception.ToString())); } #if UNITY4 LoadIni(); #else IniSettings.Load(); #endif IniSettings.WatchTextFiles(); }
private static void WatcherNotice(object sender, FileSystemEventArgs e) { if (IniSettings.lastraisedfile == e.FullPath && DateTime.Now < IniSettings.lastraisedtime) { return; } IniSettings.lastraisedfile = e.FullPath; IniSettings.lastraisedtime = DateTime.Now.AddSeconds(1); IniSettings.Load(); }
static SubtitleSettings() { IniSettings.LoadSettings += new Action <IniFile>(SubtitleSettings.Load); IniSettings.Load(); }