BF2Statistics.MainForm.LoadModList C# (CSharp) Method

LoadModList() private method

Loads up all the supported mods, and adds them to the Mod select list
private LoadModList ( ) : void
return void
        private void LoadModList()
        {
            // Clear the list
            ModSelectList.Items.Clear();

            // Add each valid mod to the mod selection list
            foreach (BF2Mod Mod in BF2Server.Mods)
            {
                ModSelectList.Items.Add(Mod);
                if (Mod.Name == "bf2")
                    ModSelectList.SelectedIndex = ModSelectList.Items.Count - 1;
            }

            // Make sure we have a mod selected. This can fail to happen in the bf2 mod folder is changed
            if (ModSelectList.SelectedIndex == -1)
                ModSelectList.SelectedIndex = 0;

            // Add errors to icon
            if (BF2Server.ModLoadErrors.Count > 0)
            {
                ModStatusPic.Visible = true;
                Tipsy.SetToolTip(ModStatusPic, " * " + String.Join(Environment.NewLine.Repeat(1) + " * ", BF2Server.ModLoadErrors), true, 10000);
            }
            else
                ModStatusPic.Visible = false;
        }
MainForm