本文整理汇总了C#中Microsoft.Build.BuildEngine.Engine.EngineBuildLoop方法的典型用法代码示例。如果您正苦于以下问题:C# Engine.EngineBuildLoop方法的具体用法?C# Engine.EngineBuildLoop怎么用?C# Engine.EngineBuildLoop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Build.BuildEngine.Engine
的用法示例。
在下文中一共展示了Engine.EngineBuildLoop方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NodeLocalEngineLoop
//.........这里部分代码省略.........
{
ReportUnhandledError(e);
}
catch (Exception e)
{
// Wrap the exception in a InternalLoggerException and send it to the parent node
string errorCode;
string helpKeyword;
string message = ResourceUtilities.FormatResourceString(out errorCode, out helpKeyword, "FatalErrorWhileInitializingLogger", loggerDescription.Name);
ReportUnhandledError(new InternalLoggerException(message, e, null, errorCode, helpKeyword, true));
}
// If there was a failure registering loggers, null out the engine pointer
if (exitedDueToError)
{
localEngine = null;
return;
}
localEngine.RegisterLogger(newLogger);
}
localEngine.ExternalLoggingServices = outProcLoggingService;
}
// Hook up logging service to forward all events to the central engine if necessary
if (centralizedLogging)
{
if (nodeLoggers.Length != 0)
{
localEngine.LoggingServices.ForwardingService = outProcLoggingService;
localEngine.ExternalLoggingServices = outProcLoggingService;
}
else
{
localEngine.LoggingServices = outProcLoggingService;
}
}
localEngine.LoggingServices.OnlyLogCriticalEvents = this.logOnlyCriticalEvents;
if (!useBreadthFirstTraversal)
{
localEngine.PostEngineCommand(new ChangeTraversalTypeCommand(useBreadthFirstTraversal, true));
}
// Post all the requests that passed in while the engine was being constructed
// into the engine queue
lock (buildRequests)
{
while (buildRequests.Count != 0)
{
BuildRequest buildRequest = buildRequests.Dequeue();
localEngine.PostBuildRequest(buildRequest);
}
}
try
{
// If there are forwarding loggers registered - generate a custom build started
if (nodeLoggers.Length > 0)
{
localEngine.LoggingServices.LogBuildStarted(EngineLoggingServicesInProc.CENTRAL_ENGINE_EVENTSOURCE);
localEngine.LoggingServices.ProcessPostedLoggingEvents();
}
// Trigger the actual build if shutdown was not called while the engine was being initialized
if (!nodeShutdown)
{
localEngine.EngineBuildLoop(null);
}
}
catch (Exception e)
{
// Unhandled exception during execution. The node has to be shutdown.
ReportUnhandledError(e);
}
finally
{
if (localEngine != null)
{
// Flush all the messages associated before shutting down
localEngine.LoggingServices.ProcessPostedLoggingEvents();
NodeManager nodeManager = localEngine.NodeManager;
// If the local engine is already shutting down, the TEM will be nulled out
if (nodeManager.TaskExecutionModule != null && nodeManager.TaskExecutionModule.TaskExecutionTime != 0)
{
TimeSpan taskTimeSpan = new TimeSpan(localEngine.NodeManager.TaskExecutionModule.TaskExecutionTime);
totalTaskTime = (int)taskTimeSpan.TotalMilliseconds;
}
localEngine.Shutdown();
}
// Flush all the events to the parent engine
outProcLoggingService.ProcessPostedLoggingEvents();
// Indicate that the node logger thread should exit
exitNodeEvent.Set();
}
}