using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace MaterialSkin.Controls
{
    public partial class MaterialIndicator : UserControl
    {
        private bool _checked;

        [Browsable(false)]
        public MaterialSkinManager SkinManager => MaterialSkinManager.Instance;

        public Color CheckedColor { get; set; }
        public Color UncheckedColor { get; set; }
        public Color BorderColor { get; set; }
        public MaterialIndicator()
        {
            InitializeComponent();

        }


        public bool Checked
        {
            get { return _checked; }
            set
            {
                _checked = value;
                Invalidate();
            }
        }

        protected override void OnPaintBackground(PaintEventArgs e)
        {
            base.OnPaintBackground(e);
        }

        protected override void OnPaint(PaintEventArgs e)
        {
            e.Graphics.FillEllipse(new SolidBrush(Checked?CheckedColor:UncheckedColor),1,1,Width-2,Height-2);
            e.Graphics.DrawEllipse(new Pen(BorderColor),1,1,Width-2,Height-2 );
        }
    }
}
