private void retrieveVersions()
        {
            List <int> addons = new List <int>();

            foreach (string id in Properties.Settings.Default.addonVersions)
            {
                if (!id.StartsWith("ID: "))
                {
                    continue;
                }
                int result = -1;
                if (!int.TryParse(id.Replace("ID: ", ""), out result))
                {
                    continue;
                }
                else if (result != -1)
                {
                    addons.Add(result);
                }
            }
            List <Version> instVersions = new List <Version>();

            foreach (string v in Properties.Settings.Default.addonVersions)
            {
                if (!v.StartsWith("V: "))
                {
                    continue;
                }
                Version result = new Version(v.Replace("V: ", ""));
                instVersions.Add(result);
            }
            if (addons.Count != instVersions.Count)
            {
                ContentManagerException e = new ContentManagerException(this, "Settings File doesn't have same amount of addon/pass.");
                throw e;
            }
            else
            {
                int i = 0;
                while (i < addons.Count)
                {
                    foreach (ContentClass addon in this.availableAddons)
                    {
                        if (addon.ID != addons[i])
                        {
                            continue;
                        }
                        else
                        {
                            addon.addVersion(instVersions[i]);
                        }
                    }
                    i++;
                }
            }
        }
        internal ContentClass getAddonByID(int id)
        {
            ContentClass found = null;

            foreach (ContentClass addon in this.availableAddons)
            {
                if (addon.ID == id)
                {
                    if (found == null)
                    {
                        found = addon;
                    }
                    else
                    {
                        ContentManagerException e = new ContentManagerException(addon, "Only one addon per ID is supported.");
                        throw e;
                    }
                }
            }
            return(found);
        }
        internal ContentClass getAddonByName(string name)
        {
            ContentClass found = null;

            foreach (ContentClass addon in this.availableAddons)
            {
                if (addon.name == name)
                {
                    if (found == null)
                    {
                        found = addon;
                    }
                    else
                    {
                        ContentManagerException e = new ContentManagerException(addon, "More then one addon of this name.");
                        throw e;
                    }
                }
            }
            return(found);
        }
        private void retrieveSelected()
        {
            this.selectedAddons.Clear();
            List <int> selectedAddons = new List <int>();

            foreach (string id in Properties.Settings.Default.selectedAddons)
            {
                if (!id.StartsWith("ID: "))
                {
                    continue;
                }
                int result = -1;
                if (!int.TryParse(id.Replace("ID: ", ""), out result))
                {
                    continue;
                }
                else if (result != -1)
                {
                    selectedAddons.Add(result);
                }
            }
            List <string> savedPass = new List <string>();

            foreach (string pass in Properties.Settings.Default.selectedAddons)
            {
                if (!pass.StartsWith("PW: "))
                {
                    continue;
                }
                string result = pass.Replace("PW: ", "");
                savedPass.Add(result);
            }
            if (selectedAddons.Count != savedPass.Count)
            {
                ContentManagerException e = new ContentManagerException(this, "Settings File doesn't have same amount of addon/pass.");
                throw e;
            }
            else
            {
                int i = 0;
                while (i < selectedAddons.Count)
                {
                    foreach (ContentClass addon in this.availableAddons)
                    {
                        if (addon.ID != selectedAddons[i])
                        {
                            continue;
                        }
                        if ((addon.protection) && (!this.protectionManager.checkPassword(addon, savedPass[i], true)))
                        {
                            continue;
                        }
                        else
                        {
                            SetAddonSelected(addon, true, true);
                            addon.addonState = AddonState.Installed;
                        }
                    }
                    i++;
                }
            }
        }