示例#1
0
        /// <summary>
        /// Initialize cache monitoring to keep cache updated with external changes.
        /// </summary>
        /// <returns>TRUE if session tokens are seeded from file</returns>
        public static bool InitializeDiskCache()
        {
            cachemonitor         = new SessionFileMonitor(AppDomain.CurrentDomain.BaseDirectory, SessionCacheFilePlaintext, new FileSystemEventHandler(OnChanged));
            updatetimer.Elapsed += HandlePending;

            bool loaded = LoadFromDisk();

            if (Settings.DebugMessages)
            {
                ConsoleIO.WriteLineFormatted(loaded ? "§8Session data has been successfully loaded from disk." : "§8No sessions could be loaded from disk");
            }



            return(loaded);
        }
示例#2
0
 /// <summary>
 /// Initialize cache monitoring to keep cache updated with external changes.
 /// </summary>
 /// <returns>TRUE if session tokens are seeded from file</returns>
 public static bool InitializeDiskCache()
 {
     cachemonitor         = new SessionFileMonitor(AppDomain.CurrentDomain.BaseDirectory, SessionCacheFilePlaintext, new FileSystemEventHandler(OnChanged));
     updatetimer.Elapsed += HandlePending;
     return(LoadFromDisk());
 }