Inheritance: MessageObject
コード例 #1
0
        void eventSource_WarningRaised(object sender, BuildWarningEventArgs e)
        {
            //string line = string.Empty;
            //if (e.File == "EXEC")
            //{
            //    line = Strings.Warning + " "+ e.Message;
            //}
            //else
            //{
            //    line = e.File + "(" + e.LineNumber + "," + e.ColumnNumber + "): " + Strings.Warning + " " + e.Code + ": " + e.Message;
            //}


            WEMessage message = new WEMessage();

            message.Code = e.Code;
            FileMessageObject FMO = new FileMessageObject();

            message.MessageObject = FMO;
            FMO.ColumnNumber      = e.ColumnNumber;
            FMO.EndColumnNumber   = e.EndColumnNumber;
            FMO.LineNumber        = e.LineNumber;
            FMO.EndLineNumber     = e.EndLineNumber;
            FMO.File        = e.File;
            message.Message = e.Message;


            if (mEWList.AddWarning(message))
            {
                WriteIntent();
                this.OnWarning(message);
            }
        }
コード例 #2
0
        void eventSource_MessageRaised(object sender, BuildMessageEventArgs e)
        {
            //if ((e.Importance == MessageImportance.High && IsVerbosityAtLeast(LoggerVerbosity.Minimal))
            //    || (e.Importance == MessageImportance.Normal && IsVerbosityAtLeast(LoggerVerbosity.Normal))
            //    || (e.Importance == MessageImportance.Low && IsVerbosityAtLeast(LoggerVerbosity.Detailed))
            //    )
            //{
            //WriteLineWithSenderAndMessage(String.Empty, e);
            //}

            //WriteLineWithIntent(e.Message);
            //this.OnMessage(e.Message);
            MessInfo Messinfo = new MessInfo(e.Message);

            if (Messinfo.Success)
            {
                WEMessage message = new WEMessage();
                message.Code = Messinfo.Error;
                FileMessageObject FMO = new FileMessageObject();
                message.MessageObject = FMO;
                FMO.ColumnNumber      = 0;
                FMO.EndColumnNumber   = 0;
                FMO.LineNumber        = Messinfo.Line;
                FMO.EndLineNumber     = 0;
                FMO.File        = Messinfo.File;
                message.Message = Messinfo.Message;

                //string line = string.Empty;

                switch (Messinfo.Cond)
                {
                case MessInfo.Level.Error:
                    //line = message.File + "(" + message.LineNumber + "," + message.ColumnNumber + "): " + Strings.Error + " " + message.Code + ": " + message.Message;
                    if (mEWList.AddError(message))
                    {
                        WriteIntent();
                        this.OnError(message);
                    }
                    break;

                case MessInfo.Level.Warning:
                    //line = message.File + "(" + message.LineNumber + "," + message.ColumnNumber + "): " + Strings.Warning + " " + message.Code + ": " + message.Message;
                    if (mEWList.AddWarning(message))
                    {
                        WriteIntent();
                        this.OnWarning(message);
                    }
                    break;
                }

                //if(line != string.Empty)
                //WriteLineWithIntent(line);
            }


            //if (e.Message.ToLower().Contains("error:"))
            //{

            //}

            //if (e.Message.ToLower().Contains("warning:"))
            //{
            //    WriteLineWithIntent(e.Message);
            //}

            if (e.GetType() == typeof(TaskCommandLineEventArgs))
            {
                if (e.Message.ToLower().Contains("error:"))
                {
                    WriteLineWithIntent(Strings.ConsoleError + ":   " + e.Message);
                }

                if (e.Message.ToLower().Contains("warning:"))
                {
                    WriteLineWithIntent(Strings.ConsoleError + ":   " + e.Message);
                }
            }
        }
コード例 #3
0
        void eventSource_MessageRaised(object sender, BuildMessageEventArgs e)
        {
            //if ((e.Importance == MessageImportance.High && IsVerbosityAtLeast(LoggerVerbosity.Minimal))
            //    || (e.Importance == MessageImportance.Normal && IsVerbosityAtLeast(LoggerVerbosity.Normal))
            //    || (e.Importance == MessageImportance.Low && IsVerbosityAtLeast(LoggerVerbosity.Detailed))
            //    )
            //{
            //WriteLineWithSenderAndMessage(String.Empty, e);
            //}

            //WriteLineWithIntent(e.Message);
            //this.OnMessage(e.Message);
            MessInfo Messinfo = new MessInfo(e.Message);
            if (Messinfo.Success)
            {
                WEMessage message = new WEMessage();
                message.Code = Messinfo.Error;
                FileMessageObject FMO = new FileMessageObject();
                message.MessageObject = FMO;
                FMO.ColumnNumber = 0;
                FMO.EndColumnNumber = 0;
                FMO.LineNumber = Messinfo.Line;
                FMO.EndLineNumber = 0;
                FMO.File = Messinfo.File;
                message.Message = Messinfo.Message;

                //string line = string.Empty;

                switch (Messinfo.Cond)
                {
                    case MessInfo.Level.Error:
                        //line = message.File + "(" + message.LineNumber + "," + message.ColumnNumber + "): " + Strings.Error + " " + message.Code + ": " + message.Message;
                        if (mEWList.AddError(message))
                        {
                            WriteIntent();
                            this.OnError(message);
                        }
                        break;
                    case MessInfo.Level.Warning:
                        //line = message.File + "(" + message.LineNumber + "," + message.ColumnNumber + "): " + Strings.Warning + " " + message.Code + ": " + message.Message;
                        if (mEWList.AddWarning(message))
                        {
                            WriteIntent();
                            this.OnWarning(message);
                        }
                        break;
                }

                //if(line != string.Empty)
                //WriteLineWithIntent(line);
            }


            //if (e.Message.ToLower().Contains("error:"))
            //{

            //}

            //if (e.Message.ToLower().Contains("warning:"))
            //{
            //    WriteLineWithIntent(e.Message);
            //}

            if (e.GetType() == typeof(TaskCommandLineEventArgs))
            {
                if (e.Message.ToLower().Contains("error:"))
                {
                    WriteLineWithIntent(Strings.ConsoleError + ":   " + e.Message);
                }

                if (e.Message.ToLower().Contains("warning:"))
                {
                    WriteLineWithIntent(Strings.ConsoleError + ":   " + e.Message);
                }
            }

        }
コード例 #4
0
        void eventSource_WarningRaised(object sender, BuildWarningEventArgs e)
        {
            //string line = string.Empty;
            //if (e.File == "EXEC")
            //{
            //    line = Strings.Warning + " "+ e.Message;
            //}
            //else
            //{
            //    line = e.File + "(" + e.LineNumber + "," + e.ColumnNumber + "): " + Strings.Warning + " " + e.Code + ": " + e.Message;
            //}


            WEMessage message = new WEMessage();
            message.Code = e.Code;
            FileMessageObject FMO = new FileMessageObject();
            message.MessageObject = FMO;
            FMO.ColumnNumber = e.ColumnNumber;
            FMO.EndColumnNumber = e.EndColumnNumber;
            FMO.LineNumber = e.LineNumber;
            FMO.EndLineNumber = e.EndLineNumber;
            FMO.File = e.File;
            message.Message = e.Message;


            if (mEWList.AddWarning(message))
            {
                WriteIntent();
                this.OnWarning(message);
            }
        }