예제 #1
0
        public override void Draw(CDisplay display)
        {
            base.Draw(display);

            for (int i = 0; i < display.Keys.Count; i++)
            {
                if (!char.IsControl(display.Keys[i].KeyChar))
                {
                    current_cmd.Append(display.Keys[i].KeyChar);
                }
                else if (display.Keys[i].Key == ConsoleKey.Backspace)
                {
                    if (current_cmd.Length > 0)
                    {
                        current_cmd.Remove(current_cmd.Length - 1, 1);
                    }
                }
                else if (display.Keys[i].Key == ConsoleKey.Enter)
                {
                    HandleCommand(current_cmd.ToString());
                    current_cmd.Clear();
                }
            }

            display.DrawString(0, Height, ">" + current_cmd.ToString());
        }
예제 #2
0
 public override void Draw(CDisplay display)
 {
     string[] lin = lines.ToArray();
     for (int i = start_index; i < lines.Count; i++)
     {
         display.DrawString(0, i - start_index, lin[i]);
     }
 }
예제 #3
0
 public override void Draw(CDisplay display)
 {
     try
     {
         int y = 0;
         foreach (var(key, value) in properties)
         {
             display.DrawString(0, y++, $"{key}: {value}");
         }
     }
     catch (InvalidOperationException)
     {
     }
 }