Skip to content

Commit d526d17

Browse files
committed
Add text color for messages
1 parent b8e52f0 commit d526d17

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

SaveWin10Pictures/Program.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ internal class Program
99
private static void Main()
1010
{
1111
Action<string> display = Console.WriteLine;
12+
Console.ForegroundColor = ConsoleColor.Magenta;
1213
display("Checking if there are new images to be copied...");
1314
List<string> files = new List<string>();
1415
int counter = 0;
@@ -35,9 +36,19 @@ private static void Main()
3536
// do nothing and continue with the next file
3637
}
3738

39+
if (counter == 0)
40+
{
41+
Console.ForegroundColor = ConsoleColor.Red;
42+
}
43+
else
44+
{
45+
Console.ForegroundColor = ConsoleColor.Green;
46+
}
47+
3848
display($"{counter} image{Plural(counter)} {Plural(counter, "have")} been copied to the picture folder.");
49+
Console.ForegroundColor = ConsoleColor.Blue;
3950
display("Press any key to exit:");
40-
//Console.ReadKey(); // comment for batch to production
51+
Console.ReadKey(); // comment for batch to production
4152
}
4253

4354
public static string Plural(int number, string irregularNoun = "")

SaveWindows10WallPaper/FormMain.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public FormMain()
2222
public readonly Dictionary<string, string> _languageDicoFr = new Dictionary<string, string>();
2323
private string _currentLanguage = "english";
2424
private ConfigurationOptions _configurationOptions = new ConfigurationOptions();
25-
string ImagePath = @"%AppData%\Local\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets";
25+
// string ImagePath = @"%AppData%\Local\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets";
2626

2727
private void QuitToolStripMenuItem_Click(object sender, EventArgs e)
2828
{

0 commit comments

Comments
 (0)