using NStack;
using System;
using System.Text.Json.Serialization;
using System.Data;
using System.Text;
using System.Collections.Generic;
namespace Terminal.Gui {
///
/// Specifies the border style for a and to be used by the class.
///
public enum BorderStyle {
///
/// No border is drawn.
///
None,
///
/// The border is drawn using single-width line glyphs.
///
Single,
///
/// The border is drawn using double-width line glyphs.
///
Double,
///
/// The border is drawn using single-width line glyphs with rounded corners.
///
Rounded,
// TODO: Support Ruler
/////
///// The border is drawn as a diagnostic ruler ("|123456789...").
/////
//Ruler
}
///
/// Defines the visual border for a . Also provides helper APIS for rendering the border.
///
public class Border {
///
/// Raised if any of the properties that define the border are changed.
///
public event Action BorderChanged;
private BorderStyle _style;
private Color _forgroundColor;
private Color _backgroundColor;
///
/// Specifies the for a view.
///
[JsonInclude, JsonConverter (typeof (JsonStringEnumConverter))]
public BorderStyle BorderStyle {
get => _style;
set {
_style = value;
OnBorderChanged ();
}
}
///
/// Gets or sets the that draws the outer border color.
///
[JsonInclude, JsonConverter (typeof (ColorJsonConverter))]
public Color ForgroundColor {
get => _forgroundColor;
set {
_forgroundColor = value;
OnBorderChanged ();
}
}
///
/// Gets or sets the that fills the area between the bounds of a .
///
[JsonInclude, JsonConverter (typeof (ColorJsonConverter))]
public Color BackgroundColor {
get => _backgroundColor;
set {
_backgroundColor = value;
OnBorderChanged ();
}
}
// TODO: These are all temporary to keep code compiling
///
///
///
public bool DrawMarginFrame { get; set; }
///
///
///
public Point Effect3DOffset { get; set; } = new Point (1, 1);
///
///
///
public bool Effect3D { get; set; }
///
///
///
public Thickness BorderThickness { get; set; } = new Thickness (0);
///
///
///
public object Effect3DBrush { get; set; }
///
///
///
public Thickness PaddingThickness { get; set; } = new Thickness (0);
///
/// Invoke the event.
///
public virtual void OnBorderChanged ()
{
BorderChanged?.Invoke (this);
}
}
}