VixenApplication.SelectProfile.PopulateProfileList C# (CSharp) Method

PopulateProfileList() private method

private PopulateProfileList ( ) : void
return void
        private void PopulateProfileList()
        {
            XMLProfileSettings profile = new XMLProfileSettings();

            //Make sure we start with an empty listbox since we may repopulate after editing profiles
            listBoxProfiles.Items.Clear();
            int profileCount = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "ProfileCount", 0);
            for (int i = 0; i < profileCount; i++)
            {
                var dataFolder = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "Profile" + i.ToString() + "/DataFolder", string.Empty);
                if (!VixenApplication.IsProfileLocked(dataFolder)) //Only add the profile if it is not locked.
                {
                    ProfileItem item = new ProfileItem();
                    item.Name = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "Profile" + i.ToString() + "/Name",
                        "New Profile");
                    item.DataFolder = dataFolder;
                    listBoxProfiles.Items.Add(item);
                }
            }
        }