BF2Statistics.GamespyRedirectForm.SetStatus C# (CSharp) Method

SetStatus() private method

This method sets the address, image, and image balloon text for the services listed in this form by service index.
private SetStatus ( int i, string address, Bitmap Img, string ImgText = "" ) : void
i int The service index
address string The text to display in the IP address box
Img System.Drawing.Bitmap The image to display in the image box for this service
ImgText string The mouse over balloon text to display
return void
        private void SetStatus(int i, string address, Bitmap Img, string ImgText = "")
        {
            // Prevent exception
            if (!IsHandleCreated) return;

            // Invoke this in the thread that created the handle
            Invoke((Action)delegate
            {
                switch (i)
                {
                    case 0:
                        Address1.Text = address;
                        Status1.Image = Img;
                        Tipsy.SetToolTip(Status1, ImgText);
                        break;
                    case 1:
                        Address2.Text = address;
                        Status2.Image = Img;
                        Tipsy.SetToolTip(Status2, ImgText);
                        break;
                    case 2:
                        Address4.Text = address;
                        Status4.Image = Img;
                        Tipsy.SetToolTip(Status4, ImgText);
                        break;
                    case 3:
                        Address5.Text = address;
                        Status5.Image = Img;
                        Tipsy.SetToolTip(Status5, ImgText);
                        break;
                }
            });
        }