I would create a helper method for returning the value you want to give to OnExecutedCompleted
, and also store the value of Properties.Settings.Default
in a variable.
bool TodoRenameMeToWhatYouThinkSuitsYou()
{
SomeType obj = Properties.Settings.Default;
if (obj.StopOnBackupCurrentInstallerFailure && !DoBackupCurrentVersion(errors, logger))
return false;
if (obj.StopOnUpdateCodeBaseFailure && !DoGetLatestVersion(errors, logger))
return false;
if (obj.StopOnCompileFailure && !DoCompileCodeBase(errors, logger))
return false;
if (obj.StopOnBuildInstallerFailure && !DoBuildInstaller(errors, logger))
return false;
return true;
}
Then you can replace the smelly part in your original method with
OnExecutedCompleted(TodoRenameMeToWhatYouThinkSuitsYou());
(I apoligize for not following the coding conventions in this answer, I am not a C# developer)