Class Border
Creates a 3D border around a surface.
Implements
Inherited Members
Namespace: SadConsole.UI
Assembly: SadConsole.Extended.dll
Syntax
public class Border : ScreenSurface, IDisposable, IScreenSurfaceEditable, IScreenSurface, IScreenObject, IPositionable, IComponentHost, ISurface, ISurfaceSettable
Constructors
Border(IScreenSurface, BorderParameters, IFont?)
Creates a border and adds it as a child object to contents
.
Declaration
public Border(IScreenSurface contents, Border.BorderParameters parameters, IFont? font = null)
Parameters
Type | Name | Description |
---|---|---|
IScreenSurface | contents | The object the border will be around. |
Border.BorderParameters | parameters | Border.BorderParameters to be used in creating the Border. |
IFont | font | Optional IFont for the border CellSurface. |
Border(IScreenSurface, string)
Creates a border (with a shadow and a title) and adds it as a child object to contents
.
Declaration
public Border(IScreenSurface contents, string title)
Parameters
Type | Name | Description |
---|---|---|
IScreenSurface | contents | The object the border will be around. |
string | title | Title to display on the border. |
Border(IScreenSurface, string, Color, Color)
Creates a border (with a shadow and a title) and adds it as a child object to contents
.
Declaration
public Border(IScreenSurface contents, string title, Color textColor, Color borderColor)
Parameters
Type | Name | Description |
---|---|---|
IScreenSurface | contents | The object the border will be around. |
string | title | Optional title to display on the border. |
Color | textColor | Title text foreground color. |
Color | borderColor | Border line foreground color and title text background color. |
Border(Window)
Creates a border and adds it as a child object to the window.
Declaration
public Border(Window contents)
Parameters
Type | Name | Description |
---|---|---|
Window | contents | The window the border will be around. |
Methods
Create3DForSurface(IScreenSurface, string, Color?, Color?, Color?, Color?, Color?)
Creates a chunky 3d border using Connected3dBox glyphs.
Declaration
public static Border Create3DForSurface(IScreenSurface contents, string title, Color? titleForeground = null, Color? titleBackground = null, Color? borderBrightColor = null, Color? borderDarkColor = null, Color? borderBetweenColor = null)
Parameters
Type | Name | Description |
---|---|---|
IScreenSurface | contents | The object the border will be around. |
string | title | Optional title to display on the border. |
Color? | titleForeground | Foreground color of the title. Defaults to a brighter version of the content's DefaultBackground. |
Color? | titleBackground | Background color of the title. Defaults to the content's DefaultForeground. |
Color? | borderBrightColor | The bright color of the 3D border. Defaults to AnsiWhiteBright. |
Color? | borderDarkColor | The dark color of the 3D border. Defaults to AnsiBlackBright. |
Color? | borderBetweenColor | The corner color of the 3D border. Defaults to the content's DefaultBackground. |
Returns
Type | Description |
---|---|
Border | The created border, attached to the content. |
Remarks
For a nice looking border, set the content's DefaultForeground to AnsiWhite and the DefaultBackground to AnsiBlue, before calling this method.
CreateForSurface(IScreenSurface, string)
Helper method to add a border to a surface.
Declaration
public static void CreateForSurface(IScreenSurface contents, string title)
Parameters
Type | Name | Description |
---|---|---|
IScreenSurface | contents | The object the border will be around. |
string | title | Optional title to display on the border. |
CreateForWindow(Window)
Helper method to add a border to a window.
Declaration
public static void CreateForWindow(Window contents)
Parameters
Type | Name | Description |
---|---|---|
Window | contents | The window the border will be around. |