Exemple #1
0
        /// <summary>
        ///     Removes the specified IChatLoggers.
        /// </summary>
        /// <param name="logger">The IChatLoggers.</param>
        /// <exception cref="System.InvalidOperationException">Can't remove an IChatLogger that is not added.</exception>
        public override void Remove(IChatLogger logger)
        {
            if (!this.ChatLoggers.Contains(logger))
            {
                throw new InvalidOperationException("Can't remove an IChatLogger that is not added.");
            }

            this.ChatLoggers.Remove(logger);
        }
Exemple #2
0
        /// <summary>
        ///     Adds the specified IChatLoggers.
        /// </summary>
        /// <param name="logger">The IChatLoggers.</param>
        /// <exception cref="System.InvalidOperationException">Can't add multiple similar instances of IChatLogger</exception>
        public override void Add(IChatLogger logger)
        {
            if (this.ChatLoggers.Contains(logger))
            {
                throw new InvalidOperationException("Can't add multiple similar instances of IChatLogger");
            }

            this.ChatLoggers.Add(logger);
        }
Exemple #3
0
        /// <summary>
        ///     Updates the logged strings.
        /// </summary>
        /// <param name="logger">The logger.</param>
        protected override void UpdateLogged(IChatLogger logger)
        {
            foreach (var messageToAdd in logger.Logged)
            {
                foreach (var existingMessage in this.LoggedMessages)
                {
                    if (messageToAdd.Equals(existingMessage))
                    {
                        continue;
                    }

                    this.OnMessageLogged();
                    this.LoggedMessages.Add(messageToAdd);
                }
            }
        }
Exemple #4
0
 public RoomManager()
 {
     _logger = ChatLoggerService.Instance;
 }
Exemple #5
0
 public UserManager()
 {
     _logger = ChatLoggerService.Instance;
 }
Exemple #6
0
 /// <summary>
 ///     Removes the specified IChatLoggers.
 /// </summary>
 /// <param name="logger">The IChatLoggers.</param>
 /// <exception cref="System.InvalidOperationException">Can't remove an IChatLogger that is not added.</exception>
 public abstract void Remove(IChatLogger logger);
Exemple #7
0
 /// <summary>
 ///     Adds the specified IChatLoggers.
 /// </summary>
 /// <param name="logger">The IChatLoggers.</param>
 /// <exception cref="System.InvalidOperationException">Can't add multiple similar instances of IChatLogger</exception>
 public abstract void Add(IChatLogger logger);
Exemple #8
0
 /// <summary>
 ///     Updates the logged strings.
 /// </summary>
 /// <param name="logger">The logger.</param>
 protected abstract void UpdateLogged(IChatLogger logger);
Exemple #9
0
 protected void Application_Error(object sender, EventArgs e)
 {
     _logger = ChatLoggerService.Instance;
     _logger.Info("Ooops" + sender.ToString());
 }