Example #1
0
        public static void DoHardWork()
        {
            LoggerSingleton logger    = LoggerSingleton.GetInstance();
            HardProcessor   processor = new HardProcessor(1);

            logger.Log("Hard work started...");
            processor.ProcessTo(5);
            logger.Log("Hard work finished...");
        }
Example #2
0
        public int ProcessTo(int end)
        {
            int sum = 0;

            for (int i = _start; i <= end; ++i)
            {
                sum += i;
            }
            LoggerSingleton.GetInstance().Log(
                "Processor just calculated some value: " + sum);
            return(sum);
        }
Example #3
0
 public HardProcessor(int start)
 {
     _start = start;
     LoggerSingleton.GetInstance().Log("Processor just created.");
 }