Exemple #1
0
        public static void StoreState(List <Consumer> consumers)
        {
            PersistentSettings settings = new PersistentSettings {
                ConsumerList = consumers
            };
            PersistentFileHandler outFileHandler = new PersistentFileHandler();

            outFileHandler.Save(PersistFilename, settings);
        }
Exemple #2
0
        static List <Consumer> LoadConsumers()
        {
            PersistentFileHandler inFileHandler = new PersistentFileHandler();
            PersistentSettings    settings      = new PersistentSettings();

            settings = inFileHandler.Load(PersistFilename);

            if (settings != null)
            {
                Console.WriteLine("We have file input!");
                return(settings.ConsumerList);
            }

            return(null);
        }