Exemple #1
0
        private void updateStatus(Guna.UI2.WinForms.Guna2Button button, Guna.UI2.WinForms.Guna2CirclePictureBox statusMarker, int status)
        {
            switch (status)
            {
            case 1:
                statusMarker.BeginInvoke(new Action(() => statusMarker.FillColor = Color.Green));
                button.BeginInvoke(new Action(() => { button.Text = "Disable"; button.Enabled = true; }));
                break;

            case 2:
                statusMarker.BeginInvoke(new Action(() => statusMarker.FillColor = Color.Yellow));
                button.BeginInvoke(new Action(() => { button.Text = "Loading"; button.Enabled = false; }));
                break;

            case 3:
                statusMarker.BeginInvoke(new Action(() => statusMarker.FillColor = Color.Red));
                button.BeginInvoke(new Action(() => { button.Text = "Enable"; button.Enabled = true; }));
                break;

            default:
                break;
            }
        }