Esempio n. 1
0
        static void Main(string[] args)
        {
            // Decided to create a class for this to process the numbers and maintain a cache
            NumberWordSwapper numberSwapper = new NumberWordSwapper("My", "Word", 1000);

            // Attaching the below method to capture the caches list as it is completed.
            numberSwapper.PropertyChanged += NumberSwapper_PropertyChanged;
            var output = numberSwapper.ProcessValues();

            // this call isn't completely needed now since the NumberSwapper_PropertyChange is
            //   Printing out the results but I left it to show that all the results can also be printed out as well.
            //   this is also handy since if the upperlimit is set to something lower then the cache size then the cache
            //   is not used.
            Console.WriteLine("Complete showing whole list below");
            foreach (string result in output)
            {
                Console.WriteLine(result);
            }
        }