Пример #1
0
 /// <summary>
 /// Adiciona erros
 /// </summary>
 /// <param name="Msg"></param>
 public void Add(MsgError Msg)
 {
     if (!ErrorExists(Msg))
     {
         Items.Add(Msg);
     }
     //if (OnException != null)
     //{ OnException(Msg); }
 }
Пример #2
0
 public MsgError getLastError()
 {
     if (HasError)
     {
         MsgError er = Items[Items.Count - 1];
         Items.RemoveAt(Items.Count - 1);
         return(er);
     }
     else
     {
         return(new MsgError("", new Exception()));
     }
 }
Пример #3
0
 /// <summary>
 /// Verifica semelhança no erro
 /// </summary>
 /// <param name="Msg"></param>
 /// <returns></returns>
 private bool ErrorExists(MsgError Msg)
 {
     for (int i = 0; i < Items.Count; i++)
     {
         if
         (
             Msg.Title == Items[i].Title &&
             Msg.Exception != null && Msg.Exception.Message == Items[i].Exception.Message &&
             Msg.AppName == Items[i].AppName
         )
         {
             return(true);
         }
     }
     return(false);
 }
Пример #4
0
        private void setError(MsgError Error)
        {
            txtTitle.Text = Error.Title;
            txtLevel.Text = Error.AppName;

            if (Error.Exception != null)
            {
                txtMessage.Text    = Error.Exception.Message;
                txtStackTrace.Text = Error.Exception.StackTrace;

                if (Error.Exception.InnerException != null)
                {
                    txtErroInterno.Text = Error.Exception.InnerException.Message;
                }
            }
        }