static Texture2DOverride() { Texture2DOverride.DataLock = new object(); Texture2DOverride.unused = new Dictionary <int, DateTime>(); Texture2DOverride.loaded = new Dictionary <int, Texture2DCacheData>(); Texture2DOverride.WriterLock = new object(); Texture2DOverride.MAINFOLDERKEY = "sMainFolder"; Texture2DOverride.Load(); TimeSpan timeSpan = TimeSpan.FromSeconds(15); Texture2DOverride.timer = new System.Timers.Timer(timeSpan.TotalMilliseconds) { AutoReset = true }; Texture2DOverride.timer.Elapsed += new ElapsedEventHandler(Texture2DOverride.timer_Elapsed); Texture2DOverride.timer.Start(); Texture2DOverride.writerdata = new List <Texture2DDumpData>(); timeSpan = TimeSpan.FromSeconds(15); Texture2DOverride.writertimer = new System.Timers.Timer(timeSpan.TotalMilliseconds) { AutoReset = false }; Texture2DOverride.writertimer.Elapsed += new ElapsedEventHandler(Texture2DOverride.WriterTimerElapsed); IniSettings.LanguageDirChanged += new Action <string>((string value) => Texture2DOverride.Load()); IniSettings.ProcessPathDirChanged += new Action <string>((string value) => Texture2DOverride.Load()); }
private static void WatcherNotice(object sender, FileSystemEventArgs e) { if (Texture2DOverride.lastraisedfile == e.FullPath && DateTime.Now < Texture2DOverride.lastraisedtime) { return; } Texture2DOverride.lastraisedfile = e.FullPath; Texture2DOverride.lastraisedtime = DateTime.Now.AddSeconds(1); Texture2DOverride.Load(); }