public static void DrawRectangle <TGlyph, TTerminalColor>(this ITerminal <TGlyph, TTerminalColor> terminal, int left, int top, int width, int height, TGlyph glyph, TTerminalColor foreground, TTerminalColor background) { terminal.DrawLine(left, top, left + width - 1, top, glyph, foreground, background); terminal.DrawLine(left + width - 1, top, left + width - 1, top + height - 1, glyph, foreground, background); terminal.DrawLine(left + width - 1, top + height - 1, left, top + height - 1, glyph, foreground, background); terminal.DrawLine(left, top + height - 1, left, top, glyph, foreground, background); }
private static void Drawing(ITerminal <TGlyph, TColor> terminal, int left, int top, int width, int height, BorderTheme <TGlyph> borderTheme, ColorTheme <TColor> colorTheme) { terminal.Draw(left, top, borderTheme.TopLeft, colorTheme.Foreground, colorTheme.Background); terminal.DrawLine(left + 1, top, left + width - 2, top, borderTheme.Top, colorTheme.Foreground, colorTheme.Background); terminal.Draw(left + width - 1, top, borderTheme.TopRight, colorTheme.Foreground, colorTheme.Background); terminal.DrawLine(left + width - 1, top + 1, left + width - 1, top + height - 2, borderTheme.Right, colorTheme.Foreground, colorTheme.Background); terminal.Draw(left + width - 1, top + height - 1, borderTheme.BottomRight, colorTheme.Foreground, colorTheme.Background); terminal.DrawLine(left + width - 2, top + height - 1, left + 1, top + height - 1, borderTheme.Bottom, colorTheme.Foreground, colorTheme.Background); terminal.Draw(left, top + height - 1, borderTheme.BottomLeft, colorTheme.Foreground, colorTheme.Background); terminal.DrawLine(left, top + height - 2, left, top + 1, borderTheme.Left, colorTheme.Foreground, colorTheme.Background); }