using System;
using System.Drawing;
using System.Windows.Forms;

namespace SampleCS
{
    public enum LineState  
    {
        NotInitialized = 0,
        Disconnected,
        DeviceNotAvailable,
        HookedOff,
        HookedOn
    }

    public enum SaveState
    {
        DontSave,
        AutoSave,
        ForceSave,
    }

    public partial class PhoneButton : UserControl
    {
        public PhoneButton()
        {
            InitializeComponent();
        }

        private string telName = "Line?";
        public string TelName
        {
            get
            {
                return telName;
            }
            set
            {
                telName = value;
                labelName.Text = telName;
            } 
        }

        private LineState telState = LineState.DeviceNotAvailable;
        public LineState TelState
        {
            get
            {
                return telState;
            }
            set
            {
                if (telState != value)
                {
                    telState = value;
                    labelState.Text = telState + "";
                    Color[] scol = new Color[] { Color.DarkGray, Color.Gray, Color.Red, Color.LightBlue, Color.LightGreen };
                    labelState.BackColor = scol[(int)value];
                }
            }
        }


        private SaveState telSave;

        public SaveState TelSave
        {
            get
            {
                return telSave;
            }
            set
            {
                telSave = value;
                labelSave.Text = telSave + "";
            }
        }

        private void labelSave_Click(object sender, EventArgs e)
        {
        }
    }
}
