using System;
using System.Text;
using System.Drawing;
using DevComponents.DotNetBar.Rendering;
namespace DevComponents.DotNetBar.Presentation
{
    /// 
    /// Defines the shape border.
    /// 
    internal class ShapeBorder
    {
        #region Properties
        /// 
        /// Gets or sets the border width in pixels.
        /// 
        public int Width = 0;
        /// 
        /// Gets or sets the border color.
        /// 
        public Color Color1 = Color.Empty;
        /// 
        /// Gets or sets the ending gradient border color.
        /// 
        public Color Color2 = Color.Empty;
        /// 
        /// Gets or sets the gradient angle. Default value is 90.
        /// 
        public int GradientAngle = 90;
        #endregion
        #region Internal Implementation
        public ShapeBorder() {}
        public ShapeBorder(int borderWidth) { Width = borderWidth; }
        public ShapeBorder(LinearGradientColorTable table)
        {
            this.Color1 = table.Start;
            this.Color2 = table.End;
            this.Width = 1;
        }
        public ShapeBorder(LinearGradientColorTable table, int width)
        {
            this.Color1 = table.Start;
            this.Color2 = table.End;
            this.Width = width;
        }
        public void Apply(LinearGradientColorTable table)
        {
            if (table == null)
            {
                this.Color1 = Color.Empty;
                this.Color2 = Color.Empty;
            }
            else
            {
                this.Color1 = table.Start;
                this.Color2 = table.End;
            }
        }
        public ShapeBorder(Color color1, Color color2, int width)
        {
            this.Color1 = color1;
            this.Color2 = color2;
            this.Width = width;
        }
        public ShapeBorder(Color color1, int width)
        {
            this.Color1 = color1;
            this.Color2 = Color.Empty;
            this.Width = width;
        }
        #endregion
    }
}