本文整理汇总了C#中Microsoft.Build.Framework.BuildFinishedEventArgs.ToPropertyValues方法的典型用法代码示例。如果您正苦于以下问题:C# BuildFinishedEventArgs.ToPropertyValues方法的具体用法?C# BuildFinishedEventArgs.ToPropertyValues怎么用?C# BuildFinishedEventArgs.ToPropertyValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Build.Framework.BuildFinishedEventArgs
的用法示例。
在下文中一共展示了BuildFinishedEventArgs.ToPropertyValues方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildFinished
void BuildFinished(object sender, BuildFinishedEventArgs e)
{
AppendLine(string.Format("#Build Finished"));
if (IsVerbosityAtLeast(LoggerVerbosity.Detailed)) {
AppendLine(e.ToPropertyValues().ToMarkdownTable().ToMarkdown());
}
AppendLine("Target summary".ToMarkdownSubHeader().ToMarkdown());
var targetSummary = from t in this._targetsExecuted
orderby t.Value.TimeSpent descending
select new Tuple<string, int>(t.Value.Name, t.Value.TimeSpent.Milliseconds);
AppendLine(targetSummary.ToList().ToMarkdownBarChart().ToMarkdown());
AppendLine("Task summary".ToMarkdownSubHeader().ToMarkdown());
var taskSummary = from t in this._taskExecuted
orderby t.Value.TimeSpent descending
select new Tuple<string, int>(t.Value.Name, t.Value.TimeSpent.Milliseconds);
AppendLine(taskSummary.ToList().ToMarkdownBarChart().ToMarkdown());
}
示例2: BuildFinished
void BuildFinished(object sender, BuildFinishedEventArgs e)
{
AppendLine(string.Format("####Build Finished").ToMarkdownRawMarkdown());
AppendLine(e.Message.ToMarkdownParagraph());
if (IsVerbosityAtLeast(LoggerVerbosity.Diagnostic)) {
AppendLine(e.ToPropertyValues().ToMarkdownTable().ToMarkdown().ToMarkdownRawMarkdown());
if (e.BuildEventContext != null) {
AppendLine(e.BuildEventContext.ToPropertyValues().ToMarkdownTable().ToMarkdown().ToMarkdownRawMarkdown());
}
AppendLine("Target summary".ToMarkdownSubHeader());
var targetSummary = from t in this._targetsExecuted
orderby t.Value.TimeSpent descending
select new Tuple<string, int>(t.Value.Name, t.Value.TimeSpent.Milliseconds);
AppendLine(targetSummary.ToList().ToMarkdownBarChart());
AppendLine("Task summary".ToMarkdownSubHeader());
var taskSummary = from t in this._taskExecuted
orderby t.Value.TimeSpent descending
select new Tuple<string, int>(t.Value.Name, t.Value.TimeSpent.Milliseconds);
AppendLine(taskSummary.ToList().ToMarkdownBarChart());
}
List<IMarkdownElement> toc = new List<IMarkdownElement>();
toc.Add("#### Build Summary\r\n".ToMarkdownRawMarkdown());
// toc.Add(new HorizontalRule());
foreach (var project in this._projectsExecuted.OrderBy(p=>p.StartedArgs.Timestamp)) {
string formatStr = @" - [{0}]({1}) | {2} | ```time={3} targets={4}```";
ProjectFinishedEventArgs finishedArgs = project.FinishedArgs as ProjectFinishedEventArgs;
string failStr = finishedArgs.Succeeded ? string.Empty : @"<font color=""red"">Failed</font>";
string color = finishedArgs.Succeeded ? "green" : "red";
string statusString = string.Format(
@"<font color=""{0}"">{1}</font>",
color,
finishedArgs.Succeeded ? "Succeeded" : "Failed");
string targetNames = (project.StartedArgs as ProjectStartedEventArgs).TargetNames;
if (string.IsNullOrEmpty(targetNames)) {
targetNames = "(default targets)";
}
string md = string.Format(
formatStr,
Path.GetFileName(project.Name),
this.GetLinkNameFor(project.StartedArgs as ProjectStartedEventArgs),
statusString,
string.Format("{0}s",project.TimeSpent.TotalSeconds),
targetNames
);
toc.Add(md.ToMarkdownRawMarkdown());
}
toc.AddRange(MdElements);
MdElements = toc;
}