Description
The OnCompileSuccess
property is an event handler that is invoked when a compilation process completes successfully within a CompileGroup
. This property allows you to define custom actions to be executed upon successful compilation. The result of the compilation can be accessed through the BuildResult
property.
Usage
To use the OnCompileSuccess
property, assign a method or lambda expression to it that matches the System.Action
delegate signature. This method will be called whenever a compilation completes successfully.
Example
// Example of using OnCompileSuccess
CompileGroup compileGroup = new CompileGroup();
// Assign a method to the OnCompileSuccess event
compileGroup.OnCompileSuccess = () =>
{
// Custom logic to execute on successful compilation
Console.WriteLine("Compilation succeeded!");
var result = compileGroup.BuildResult;
// Use the result as needed
};
// Start the build process
await compileGroup.BuildAsync();