using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OrderEntrySystem
{
    internal class ColumnValues
    {
        private double maxWidth;

        public ColumnValues(string columnName, double defaultWidth)
        {
            this.ColumnName = columnName;
            this.DefaultWidth = defaultWidth;
        }

        public string ColumnName { get; }

        public double DefaultWidth { get; }

        public double MaxWidth
        {
            get
            {
                return this.maxWidth;
            }
            set
            {
                this.maxWidth = value;
                if (this.maxWidth > 0)
                {
                    this.MaxWidthIsSet = true;
                }
            }
        }

        public bool MaxWidthIsSet { get; private set; }

        public double CurrentWidth { get; set; }

        public double MaxMinusCurrent => this.MaxWidth - this.CurrentWidth;

        public bool IsMaxWidth => this.CurrentWidth >= this.MaxWidth;

        public override string ToString() => this.ColumnName;
    }
}
