Example #1
0
 public void Draw(Out.ClipWriterAsync writer)
 {
     for (int i = Count - 1; i >= 0; --i)
     {
         var w = writer.CreatePartialWriter(this[i].X, this[i].Y, this[i].Width, this[i].Height);
         w.BeginWrite();
         this[i].Draw(w);
         w.EndWrite();
     }
 }
Example #2
0
 public void DrawElements(Out.ClipWriterAsync writer)
 {
     for (int i = 0; i < Count; ++i)
     {
         if (this[i].Visible)
         {
             var w = writer.CreatePartialWriter(this[i].X, this[i].Y, this[i].Width, this[i].Height);
             w.BeginWrite();
             this[i].Draw(w);
             w.EndWrite();
         }
     }
 }
Example #3
0
        public override void Draw(Out.ClipWriterAsync writer)
        {
            base.Draw(writer);
            writer.SetWriterRelPos(0, 0);
            var s = Text.PadRight(Width - 2, ' ');

            if (s.Length > Width - 2)
            {
                s = s.Remove(Width - 2);
            }
            writer.Write(s, ConsoleColor.Black, BackgroundColor);
            writer.Write("X", ConsoleColor.White, ConsoleColor.DarkRed);
            writer.Write(" ", ConsoleColor.White, BackgroundColor);
            for (int i = 1; i < Height - 1; ++i)
            {
                writer.SetWriterRelPos(0, i);
                writer.Write(" ", ConsoleColor.White, BackgroundColor);
                writer.SetWriterRelPos(Width - 1, i);
                writer.Write(" ", ConsoleColor.White, BackgroundColor);
            }
            writer.SetWriterRelPos(0, Height - 1);
            s = baseString.PadRight(Width, ' ');
            if (s.Length > Width)
            {
                s = s.Remove(Width);
            }
            writer.Write(s, ConsoleColor.Black, BackgroundColor);
            for (int i = 1; i < Height - 1; ++i)
            {
                writer.SetWriterRelPos(1, i);
                writer.Write(new string(' ', Width - 2), ConsoleColor.White, ContentColor);
            }
            var w = writer.CreatePartialWriter(1, 1, Width - 2, Height - 2);

            w.BeginWrite();
            Container.DrawElements(w);
            w.EndWrite();
        }