private static bool TryToExecute(TryToExecuteParams tryToExecuteParams) { Write(string.Format("* {0} ({1}): ", tryToExecuteParams.Name, tryToExecuteParams.Parameter)); try { tryToExecuteParams.Action(tryToExecuteParams.Parameter); WriteLine(" !!!Success!!!", ConsoleColor.Yellow); return(true); } catch (Exception ex) { WriteLine(string.Format(" Exception: {0}", ex.Message), ConsoleColor.Red); return(false); } }
private static bool TryToExecute(TryToExecuteParams tryToExecuteParams) { Write(string.Format("* {0} ({1}): ", tryToExecuteParams.Name, tryToExecuteParams.Parameter)); try { tryToExecuteParams.Action(tryToExecuteParams.Parameter); WriteLine(" !!!Success!!!", ConsoleColor.Yellow); return true; } catch (Exception ex) { WriteLine(string.Format(" Exception: {0}", ex.Message), ConsoleColor.Red); return false; } }