当前位置: 首页>>代码示例>>C#>>正文


C# BuildMessageEventArgs.GetType方法代码示例

本文整理汇总了C#中Microsoft.Build.Framework.BuildMessageEventArgs.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# BuildMessageEventArgs.GetType方法的具体用法?C# BuildMessageEventArgs.GetType怎么用?C# BuildMessageEventArgs.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.Build.Framework.BuildMessageEventArgs的用法示例。


在下文中一共展示了BuildMessageEventArgs.GetType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: eventSource_MessageRaised

        void eventSource_MessageRaised(object sender, BuildMessageEventArgs e)
        {
            if (e.GetType() == typeof(TaskCommandLineEventArgs))
            {
                TaskCommandLineEventArgs cl = (TaskCommandLineEventArgs)e;

                MFuVisionGenerator.EnqueueItem(cl.Message, Directory.GetCurrentDirectory(), this.ProjectBuildContext);
            }
        }
开发者ID:AlexandrSurkov,项目名称:PKStudio,代码行数:9,代码来源:MessagesCollector.cs

示例2: BuildMessage

 public BuildMessage(BuildMessageEventArgs args)
 {
     EventType = args.GetType().Name.Replace("EventArgs", "");
     Importance = (int)args.Importance;
     Message = args.Message;
     HelpKeyword = args.HelpKeyword;
     SenderName = args.SenderName;
     Timestamp = args.Timestamp;
     ThreadId = args.ThreadId;
 }
开发者ID:perpetual-motion,项目名称:clrplus,代码行数:10,代码来源:Logger.cs

示例3: eventSource_MessageRaised

        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);
                }
            }

        }
开发者ID:AlexandrSurkov,项目名称:PKStudio,代码行数:77,代码来源:MSBuildOutputLogger.cs

示例4: LogMessageEvent

        /// <summary>
        /// Stub implementation -- forwards to engine being proxied.
        /// </summary>
        public void LogMessageEvent(BuildMessageEventArgs e)
        {
            ErrorUtilities.VerifyThrowArgumentNull(e, "e");
            ErrorUtilities.VerifyThrowInvalidOperation(activeProxy == true, "AttemptingToLogFromInactiveTask");

            if (parentModule.IsRunningMultipleNodes && !e.GetType().IsSerializable)
            {
                loggingServices.LogWarning(buildEventContext, new BuildEventFileInfo(string.Empty), "ExpectedEventToBeSerializable", e.GetType().Name);
                    return;
            }
            e.BuildEventContext = buildEventContext;
            loggingServices.LogMessageEvent(e);
        }
开发者ID:nikson,项目名称:msbuild,代码行数:16,代码来源:EngineProxy.cs


注:本文中的Microsoft.Build.Framework.BuildMessageEventArgs.GetType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。