private static InstallResult ExecuteContentTypes(IEnumerable <IManifest> manifests, StepVisitor visitor, out int warnings, out int errors)
{
warnings = 0;
errors = 0;
int warn;
if (!CustomInstallStep.Invoke(GetMethod <CustomInstallStep>(x => x.OnBeforeInstallContentTypes(default(bool))), visitor.IsProbing, out warn))
{
return(ReturnWithErrorResult());
}
warnings += warn;
var batchContentTypeInstallStep = AggregateContentTypeInstallSteps(manifests);
if (batchContentTypeInstallStep != null)
{
//---- Initialize
try
{
batchContentTypeInstallStep.Initialize();
}
catch (Exception e)
{
Logger.LogException(e, "INITIALIZING ERROR");
return(ReturnWithErrorResult());
}
//---- Install
try
{
StepResult result = visitor.DoIt(batchContentTypeInstallStep);
if (result.Kind == StepResultKind.Warning)
{
warnings++;
}
if (result.Kind == StepResultKind.Error)
{
return(ReturnWithErrorResult());
}
}
catch (Exception e)
{
Logger.LogException(e);
return(ReturnWithErrorResult());
}
}
if (!CustomInstallStep.Invoke(GetMethod <CustomInstallStep>(x => x.OnAfterInstallContentTypes(default(bool))), visitor.IsProbing, out warn))
{
return(ReturnWithErrorResult());
}
warnings += warn;
return(new InstallResult {
Successful = true, NeedRestart = false
});
}