Ejemplo n.º 1
0
 private void MessageUpdated(object sender, MessageUpdatedEventArgs e)
 {
     try
     {
         ProcessUpdatedMessage(e.Message.Message, e.Message.IsPartOfInitialSalvo, e.Message.IsEdited,
                               e.Message.IsBanned);
     }
     catch (DbEntityValidationException exc)
     {
         // special-case this for better error messages
         Logger.ErrorFormat("module {0} failed to process updated message due to validation error:\n{1}", this.GetType().Name, exc);
         foreach (var eve in exc.EntityValidationErrors)
         {
             Logger.InfoFormat("-- entity of type {0} in state {1}", eve.Entry.Entity.GetType().Name, eve.Entry.State);
             foreach (var ve in eve.ValidationErrors)
             {
                 Logger.InfoFormat("---- property {0} error {1}", ve.PropertyName, ve.ErrorMessage);
             }
         }
     }
     catch (Exception exc)
     {
         Logger.ErrorFormat("module {0} failed to process updated message:\n{1}", this.GetType().Name, exc);
     }
 }
Ejemplo n.º 2
0
        protected virtual void OnMessageUpdated(MessageUpdatedEventArgs e)
        {
            var handler = MessageUpdated;

            if (handler != null)
            {
                handler(this, e);
            }
        }