BF2Statistics.MainForm.CheckPythonStatus C# (CSharp) Method

CheckPythonStatus() private method

This method sets the Stats Python status of the BF2s python files on the main GUI.
- Initial loading of the StatsPythonConfig object - Enables / Disables Stats config and Medal editor buttons - Sets the texts, font colors and status icon image for the stats python elements
private CheckPythonStatus ( ) : void
return void
        private void CheckPythonStatus()
        {
            // Cross Threaded Crap
            if (StatsPython.Installed)
            {
                InstallBox.ForeColor = Color.Green;
                InstallBox.Text = "BF2 Statistics server files are currently installed.";
                BF2sInstallBtn.Text = "Uninstall BF2 Statistics Python";
                BF2sConfigBtn.Enabled = true;
                BF2sEditMedalDataBtn.Enabled = true;

                // ----------------------------------------------------------
                // Try and access the stats pthon config file
                // This will throw an exception if a config key is missing, or
                // is improperly formated. Missing keys could be a result of an
                // update to the files
                // ----------------------------------------------------------
                try
                {
                    // Updated status based on Ranked Mode Status
                    if (StatsPython.Config.StatsEnabled)
                    {
                        StatsStatusPic.Image = Resources.check;
                        Tipsy.SetToolTip(StatsStatusPic, "BF2 Server Stats are Enabled (Ranked)");
                    }
                    else
                    {
                        StatsStatusPic.Image = Resources.error;
                        Tipsy.SetToolTip(StatsStatusPic, "BF2 Server Stats are Disabled (Non-Ranked)");
                    }
                }
                catch (Exception)
                {
                    StatsStatusPic.Image = Resources.warning;
                    Tipsy.SetToolTip(StatsStatusPic, "Failed to load Stats Python Config");
                }
            }
            else
            {
                InstallBox.ForeColor = Color.Red;
                InstallBox.Text = "BF2 Statistics server files are currently NOT installed";
                BF2sInstallBtn.Text = "Install BF2 Statistics Python";
                BF2sConfigBtn.Enabled = false;
                BF2sEditMedalDataBtn.Enabled = false;
                StatsStatusPic.Image = Resources.error;
                Tipsy.SetToolTip(StatsStatusPic, "BF2 Statistics server files are currently NOT installed");
            }
        }
MainForm