コード例 #1
0
        /// <summary>
        /// Read a confirmation input [yN] from console.
        /// </summary>
        /// <param name="title">The title.</param>
        /// <param name="color">The color.</param>
        /// <returns></returns>
        public static bool NextConfirm(string title, SysDrawing::System.Drawing.Color color)
        {
            ConsoleKey response;

            do
            {
                Console.Write($"{title} [yN] ", color);
                response = Console.ReadKey(false).Key;
                if (response != ConsoleKey.Enter)
                {
                    Console.WriteLine();
                }
            } while (response != ConsoleKey.Y && response != ConsoleKey.N);

            return(response == ConsoleKey.Y);
        }
コード例 #2
0
 private uint ColorToUInt(_Color color)
 {
     return((uint)((color.A << 24) | (color.R << 16) |
                   (color.G << 8) | (color.B << 0)));
 }
コード例 #3
0
 public NamedColor(ColorNames colorName, _Color color)
 {
     ColorName = colorName;
     Color     = ColorToUInt(color);
 }