OSDN Git Service

initial build for opensource
[applistation/AppliStation.git] / all-get / Util.cs
1 using System;\r
2 \r
3 namespace AllGet\r
4 {\r
5         \r
6         sealed class Util\r
7         {\r
8                 public static bool Confirm(string msg, bool defaultSelection)\r
9                 {\r
10                         Console.Write(msg);\r
11                         string response = Console.ReadLine();\r
12                         \r
13                         switch (response.ToLower())\r
14                         {\r
15                                 case "y":\r
16                                         return true;\r
17                                 case "n":\r
18                                         return false;\r
19                                 default:\r
20                                         return defaultSelection;\r
21                         }\r
22                 }\r
23         }\r
24 }\r