Example #1
0
 /// <summary>
 /// Registers the observer
 /// </summary>
 /// <param name="observer">The observer.</param>
 public void RegisterObserver(ILogObserver observer)
 {
     if (!_logObservers.Contains(observer))
     {
         _logObservers.Add(observer);
     }
 }
Example #2
0
 public static void Dettach(ILogObserver observador)
 {
     if (observadores.Contains(observador))
     {
         observadores.Remove(observador);
     }
 }
Example #3
0
 public void Unsubscribe(ILogObserver observer)
 {
     lock (@lock)
     {
         observers.Remove(observer);
     }
 }
Example #4
0
 public static void Attach(ILogObserver observador)
 {
     if (!observadores.Contains(observador))
     {
         observadores.Add(observador);
     }
 }
 private void FinalizeSessionLogging()
 {
     if (sessionWriter != null)
     {
         logger.Unsubscribe(sessionWriter);
         sessionWriter = null;
     }
 }
 private void InitializeSessionLogging()
 {
     if (Session?.AppConfig?.ServiceLogFilePath != null)
     {
         sessionWriter = logWriterFactory.Invoke(Session.AppConfig.ServiceLogFilePath);
         logger.Subscribe(sessionWriter);
         logger.LogLevel = Session.Settings.LogLevel;
     }
     else
     {
         logger.Warn("Could not initialize session writer due to missing configuration data!");
     }
 }
Example #7
0
        public void Subscribe(ILogObserver observer)
        {
            if (observer == null)
            {
                throw new ArgumentNullException(nameof(observer));
            }

            lock (@lock)
            {
                if (!observers.Contains(observer))
                {
                    observers.Add(observer);
                }
            }
        }
 /// <summary>
 /// UnSubscribe if you do not want to get notified about changes to the Log
 /// </summary>
 /// <param name="ilo"></param>
 public void UnSubscribe(ILogObserver ilo)
 {
     textHandler -= new LogHandler <CombatLog>(ilo.logTextChangedEvent);
 }
Example #9
0
 public void Unsubscribe(ILogObserver observer)
 {
     logger.Unsubscribe(observer);
 }
Example #10
0
 public void Subscribe(ILogObserver observer)
 {
     logger.Subscribe(observer);
 }
Example #11
0
 /// <summary>
 /// Registriert neue Observer im Event-Log.
 /// </summary>
 /// <param name="observer"></param>
 public void Register(ILogObserver observer)
 {
     observers.Add(observer);
     observer.OnNewEvent += observer_OnNewEvent;
 }
Example #12
0
 /// <summary>
 /// Attach a listening observer logging device to logger.
 /// </summary>
 /// <param name="observer">Observer (listening device).</param>
 public void Attach(ILogObserver observer)
 {
     _logList.Add(observer);
 }
 public LogConsoleViewModel(ILogStorage logStorage, ILogObserver logObserver)
 {
     _logStorage  = logStorage;
     _logObserver = logObserver;
 }
Example #14
0
 public void RemoveObserver(ILogObserver observer)
 {
     observers.Remove(observer);
 }
Example #15
0
 public void AddObserver(ILogObserver observer)
 {
     observers.Add(observer);
 }
Example #16
0
 /// <summary>
 /// Attach a new log observer to be notified when a log event is triggered.
 /// </summary>
 /// <param name="observer">The observer to attach.</param>
 public void Attach(ILogObserver observer)
 {
     _observers.Add(observer);
 }