本文整理汇总了C#中MessageImportance类的典型用法代码示例。如果您正苦于以下问题:C# MessageImportance类的具体用法?C# MessageImportance怎么用?C# MessageImportance使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MessageImportance类属于命名空间,在下文中一共展示了MessageImportance类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LogEventsFromTextOutput
/// <summary>
/// Parses a single line of text to identify any errors or warnings in canonical format.
/// </summary>
/// <param name="singleLine">A single line of text for the method to parse.</param><param name="messageImportance">A value of <see cref="T:Microsoft.Build.Framework.MessageImportance"/> that indicates the importance level with which to log the message.</param>
protected override void LogEventsFromTextOutput(string singleLine, MessageImportance messageImportance)
{
if (!string.IsNullOrEmpty(singleLine))
{
base.LogEventsFromTextOutput(singleLine, messageImportance);
}
}
示例2: LogEventsFromTextOutput
protected override void LogEventsFromTextOutput(string singleLine, MessageImportance messageImportance)
{
if (singleLine.StartsWith("Successfully created package"))
{
var outputPackage = singleLine.Split('\'').Skip(1).First();
var outputPackageItem = new TaskItem(outputPackage);
if (outputPackage.EndsWith(".symbols.nupkg", StringComparison.OrdinalIgnoreCase))
{
OutputSymbolsPackage = new[] { outputPackageItem };
}
else
{
OutputPackage = new[] { outputPackageItem };
}
}
if (messageImportance == MessageImportance.High)
{
Log.LogError(singleLine);
return;
}
if (singleLine.StartsWith("Issue:") || singleLine.StartsWith("Description:") || singleLine.StartsWith("Solution:"))
{
Log.LogWarning(singleLine);
return;
}
base.LogEventsFromTextOutput(singleLine, messageImportance);
}
示例3: LogCommentFromText
/// <summary>
/// Log a comment
/// </summary>
/// <param name="buildEventContext">Event context information which describes who is logging the event</param>
/// <param name="importance">How important is the message, this will determine which verbosities the message will show up on.
/// The higher the importance the lower the verbosity needs to be for the message to be seen</param>
/// <param name="message">Message to log</param>
/// <exception cref="InternalErrorException">BuildEventContext is null</exception>
/// <exception cref="InternalErrorException">Message is null</exception>
public void LogCommentFromText(BuildEventContext buildEventContext, MessageImportance importance, string message)
{
lock (_lockObject)
{
this.LogCommentFromText(buildEventContext, importance, message, null);
}
}
示例4: HandleMessage
/// <summary>
/// Handle a raised message.
/// </summary>
/// <param name="message">
/// The message.
/// </param>
/// <param name="importance">
/// The importance.
/// </param>
public void HandleMessage(string message, MessageImportance importance = MessageImportance.Normal)
{
if (this.OutputMessage(importance))
{
NotificationWriter.Write(message);
}
}
示例5: LogMessage
protected void LogMessage(string message, MessageImportance importance = MessageImportance.High)
{
if (BuildEngine != null)
{
BuildEngine.LogMessageEvent(new BuildMessageEventArgs("CrmCross: " + message, "CrmCross", "CrmCross", importance));
}
}
示例6: BuildMessageEventArgs
public BuildMessageEventArgs(string message,
string helpKeyword,
string senderName,
MessageImportance importance)
: base(message, helpKeyword, senderName)
{
this.importance = importance;
}
示例7: LogItemMetadata
private static void LogItemMetadata(Task task, ITaskItem item, MessageImportance importance)
{
var metadata = item.CloneCustomMetadata();
foreach (var name in metadata.Keys.Cast<string>())
{
LogMetadata(task, name, (string)metadata[name], importance);
}
}
示例8: TaskCommandLineEventArgs
public TaskCommandLineEventArgs (string commandLine,
string taskName,
MessageImportance importance)
: base (commandLine, null, null, importance)
{
this.taskName = taskName;
this.commandLine = commandLine;
}
示例9: OutputEventArgs
/// <summary>
/// Initializes a new instance of the OutputEventArgs class.
/// </summary>
/// <param name="text">The output text.</param>
/// <param name="importance">The level of importance for this output event.</param>
public OutputEventArgs(string text, MessageImportance importance)
{
Param.RequireNotNull(text, "text");
Param.Ignore(importance);
this.Output = text;
this.Importance = importance;
}
示例10: LogEventsFromTextOutput
/// <summary>
/// Parses a single line of text to identify any errors or warnings in canonical format.
/// </summary>
/// <param name="singleLine">A single line of text for the method to parse.</param>
/// <param name="messageImportance">A value of <see cref="T:Microsoft.Build.Framework.MessageImportance"/> that indicates the importance level with which to log the message.</param>
protected override void LogEventsFromTextOutput(string singleLine, MessageImportance messageImportance)
{
bool isError = messageImportance == StandardErrorLoggingImportance;
if (isError)
base.LogEventsFromTextOutput(singleLine, messageImportance);
else
CommitHash = singleLine.Trim();
}
示例11: LogInputs
public static void LogInputs(this Task task, MessageImportance importance)
{
task.Log.LogMessage(importance, "Inputs:");
foreach (var propertyInfo in GetInputProperties(task))
{
LogProperty(propertyInfo, importance, task);
}
}
示例12: LogTaskItems
private static void LogTaskItems(ITaskItem[] taskItems, string itemGroup, MessageImportance importance, Task task)
{
task.Log.LogMessage(importance, " {0} =", itemGroup);
foreach (var item in taskItems)
{
LogTaskItem(task, item, importance);
}
}
示例13: LogEventsFromTextOutput
protected override void LogEventsFromTextOutput(string singleLine, MessageImportance messageImportance)
{
if ((Set == null || Set.Length == 0) && !String.IsNullOrWhiteSpace(singleLine) && !singleLine.StartsWith("WARNING", StringComparison.OrdinalIgnoreCase))
{
Value = singleLine;
}
base.LogEventsFromTextOutput(singleLine, messageImportance);
}
示例14: LogEventsFromTextOutput
/// <summary>
/// Parse the output of the console and gets the Branch or Tag.
/// </summary>
/// <param name="singleLine">the line being parsed</param>
/// <param name="messageImportance">message importance</param>
protected override void LogEventsFromTextOutput(string singleLine, MessageImportance messageImportance)
{
bool isError = messageImportance == StandardErrorLoggingImportance;
if (isError)
base.LogEventsFromTextOutput(singleLine, messageImportance);
else if (IsBranchStatusLine(singleLine))
Branch = ParseStatusLineOutput(singleLine);
}
示例15: ConcurrentLoggingHelper
public ConcurrentLoggingHelper (TaskLoggingHelper taskLog,
StreamReader messageStream,
MessageImportance messageImportance)
{
this.taskLog = taskLog;
this.messageStream = messageStream;
this.messageImportance = messageImportance;
this.hasLoggedErrors = false;
}