Inheritance: System.EventArgs
Exemplo n.º 1
0
        void Logger_WarningEvent(object sender, WarningEventArgs e)
        {
            string line = string.Empty;

            if ((e.Warning.MessageObject as FileMessageObject) != null)
            {
                FileMessageObject FMO = e.Warning.MessageObject as FileMessageObject;
                if (FMO.File == "EXEC")
                {
                    line = Strings.Warning + " " + e.Warning.Message;
                }
                else
                {
                    line = FMO.File + "(" + FMO.LineNumber + "," + FMO.ColumnNumber + "): " + Strings.Warning + " " + e.Warning.Code + ": " + e.Warning.Message;
                }
                
            }
            if ((e.Warning.MessageObject as ComponentMessageObject) != null)
            {
                ComponentMessageObject CMO = e.Warning.MessageObject as ComponentMessageObject;
                line = CMO.Component.Name + ": " + Strings.Warning + " " + e.Warning.Code + ": " + e.Warning.Message;
            }

            if (e.Warning.MessageObject == null)
            {
            }

            if (!string.IsNullOrEmpty(line))
            {
                this.AppendText(line + "\r\n");
                int linenum = GetOutputLinesCount() - 2; //En: -2 because last line always empty Ru: -2 потому что последняя линяя всегда пустая
                ErrorsAndWarningsDict.Add(linenum, e.Warning);
            }
        }
Exemplo n.º 2
0
 void Logger_WarningEvent(object sender, WarningEventArgs e)
 {
     if (this.WarningsBtn.Checked)
     {
         AddWarning(e.Warning);
     }
     this.ErrorsAndWarningsList.AddWarning(e.Warning);
     LVColumnsResize();
     SetBtnText(WarningsBtn, ErrorsAndWarningsList.WarningsCount + " Warnings");
 }