CHAPTER 2 BUILDING C# APPLICATIONS
Figure 2-14. Activating a code refactoring
Name your new method ConfigureCUI using the resulting dialog box. When you have finished, you
will find that your Main() method calls the newly generated ConfigureCUI() method, which now
contains the previously selected code.
class Program
{
static void Main(string[] args)
{
ConfigureCUI();
}
}
// Wait for key press to close.
Console.ReadLine();
private static void ConfigureCUI()
{
// Set up Console UI (CUI)
Console.Title = "My Rocking App";
Console.ForegroundColor = ConsoleColor.Yellow;
Console.BackgroundColor = ConsoleColor.Blue;
Console.WriteLine("*************************************");
Console.WriteLine("***** Welcome to My Rocking App *****");
Console.WriteLine("*************************************");
Console.BackgroundColor = ConsoleColor.Black;
}
61