using System;
using System.Collections.Generic;
using System.Text;
using DaveSexton.DocProject;
using DaveSexton.DocProject.Engine;
namespace IndianHealthService.BMXNet.Doc
{
///
/// Hooks into the DocProject build process for the project in which it's defined.
///
///
///
/// This class must be registered with the DocProject in the Active Projects
/// tools options page in order for DocProject to instantiate it during a help build.
///
///
/// To cancel the build at any time call the
/// method. The build process will end after the current step is executed,
/// unless the step is being executed in the background. In that case, it may
/// end immediately.
///
///
/// Note: Do not cache instances of the class. A new
/// is created each time the project is built.
///
///
public class BuildProcess : BuildProcessComponent
{
DateTime buildStart, stepStart;
///
/// Called before the project's help build starts.
///
/// Provides information about the build process.
public override void BuildStarting(BuildContext context)
{
// Uncomment the following line to break into the debugger:
// System.Diagnostics.Debugger.Break();
buildStart = DateTime.Now;
}
///
/// Called before a is executed during a help build.
///
/// implementation to be executed.
/// Provides information about the build process.
/// true indicates that the process should continue, otherwise,
/// false indicates that the process should skip this step.
public override bool BeforeExecuteStep(IBuildStep step, BuildContext context)
{
stepStart = DateTime.Now;
return true;
}
///
/// Called after a has been executed during a help build.
///
/// implementation that was executed.
/// Provides information about the build process.
public override void AfterExecuteStep(IBuildStep step, BuildContext context)
{
TraceLine();
TraceLine("Step {0} Time Elapsed: {1}", context.CurrentStepIndex + 1, DateTime.Now - stepStart);
}
///
/// Called after the project's help build has finished.
///
///
/// The method has no affect at this
/// point in the build process. This method is the final step before the
/// build statistics are displayed.
///
/// This method is always invoked if is invoked,
/// regardless of whether an exception is thrown in any of the other methods,
/// has been called, or an exeception has
/// been thrown by the build engine.
///
///
/// To determine whether a help build failed or succeeded, examine the value of the
/// property.
///
///
/// Provides information about the build process.
public override void BuildCompleted(BuildContext context)
{
TraceLine();
TraceLine("Total Time Elapsed: {0}", DateTime.Now - buildStart);
}
}
}