Skip to main content
added 25 characters in body
Source Link
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 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)

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)

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

added 50 characters in body
Source Link
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 todoRenameMeToWhatYouThinkSuitsYouTodoRenameMeToWhatYouThinkSuitsYou()
{
    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(todoRenameMeToWhatYouThinkSuitsYouTodoRenameMeToWhatYouThinkSuitsYou());

(I apoligize for not following the coding conventions in this answer, I am not a C# developer)

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)

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)

Source Link
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)