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 objsettings = Properties.Settings.Default;
if (objsettings.StopOnBackupCurrentInstallerFailure && !DoBackupCurrentVersion(errors, logger))
return false;
if (objsettings.StopOnUpdateCodeBaseFailure && !DoGetLatestVersion(errors, logger))
return false;
if (objsettings.StopOnCompileFailure && !DoCompileCodeBase(errors, logger))
return false;
if (objsettings.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)