BusPirate.BPConsole.DisplayPin C# (CSharp) Method

DisplayPin() private method

private DisplayPin ( Label name, Label mode, Label value, Pin pin ) : void
name System.Windows.Forms.Label
mode System.Windows.Forms.Label
value System.Windows.Forms.Label
pin Pin
return void
        private void DisplayPin(Label name, Label mode, Label value, Pin pin)
        {
            name.Text = pin.Name;
            if (pin.Type == BP_PIN_TYPE.Analog || pin.Type == BP_PIN_TYPE.Power)
            {
                value.Text = string.Format("{0:0.00}", pin.Analog);
            }
            else if (pin.Type == BP_PIN_TYPE.Input)
            {
                mode.Text = "I";
                mode.BackColor = Color.FromArgb(64, 64, 192);
                mode.ForeColor = Color.White;
            }
            else if (pin.Type == BP_PIN_TYPE.Output)
            {
                mode.Text = "O";
                mode.BackColor = Color.FromArgb(192, 64, 64);
                mode.ForeColor = Color.White;
            }
            if (pin.Type == BP_PIN_TYPE.Input || pin.Type == BP_PIN_TYPE.Output)
            {
                if (pin.Digital)
                {
                    value.Text = "HIGH";
                    value.BackColor = Color.FromArgb(0, 208, 0);
                }
                else
                {
                    value.Text = "LOW";
                    value.BackColor = Color.FromArgb(208, 208, 0);
                }
            }
        }