Skip to main content
2 of 3
added 50 characters in body
Simon Forsberg
  • 59.4k
  • 9
  • 156
  • 309

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)

Simon Forsberg
  • 59.4k
  • 9
  • 156
  • 309