/// <summary> /// Registers the observer /// </summary> /// <param name="observer">The observer.</param> public void RegisterObserver(ILogObserver observer) { if (!_logObservers.Contains(observer)) { _logObservers.Add(observer); } }
public static void Dettach(ILogObserver observador) { if (observadores.Contains(observador)) { observadores.Remove(observador); } }
public void Unsubscribe(ILogObserver observer) { lock (@lock) { observers.Remove(observer); } }
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!"); } }
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); }
public void Unsubscribe(ILogObserver observer) { logger.Unsubscribe(observer); }
public void Subscribe(ILogObserver observer) { logger.Subscribe(observer); }
/// <summary> /// Registriert neue Observer im Event-Log. /// </summary> /// <param name="observer"></param> public void Register(ILogObserver observer) { observers.Add(observer); observer.OnNewEvent += observer_OnNewEvent; }
/// <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; }
public void RemoveObserver(ILogObserver observer) { observers.Remove(observer); }
public void AddObserver(ILogObserver observer) { observers.Add(observer); }
/// <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); }