Ejemplo n.º 1
0
 static void Main(string[] args)
 {
     while (Console.ReadKey().Key == ConsoleKey.Enter)
     {
         Publisher publisher = new Publisher();
         publisher.Run();
         if (Console.ReadKey().Key == ConsoleKey.D)
         {
             FileOutputLogger.DeleteFile();
         }
     }
 }
        public void Run()
        {
            var fileLogger     = new FileOutputLogger();
            var standardLogger = new ConsoleOutputLogger();

            fileLogger.Subscribe(this);
            standardLogger.Subscribe(this);
            var eventArgs = new SendLogEventArgs("LogEvent published", DateTime.Now);

            if (this.OnSendLog != null)
            {
                this.OnSendLog(this, eventArgs);
            }
        }