本文整理汇总了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);
}
}
示例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;
}
示例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);
}
}
}
示例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);
}