/// <summary>
        ///     Gets the Latest LeagueOfLegends lol_game_client_sln version
        /// </summary>
        public string[] GetLolClientSlnVersion(MainRegion Region)
        {
            //Get the GameClientSln version
            using (new WebClient())
            {
                ReleaseListing = new WebClient().DownloadString(Region.GameReleaseListingUri);
            }

            return ReleaseListing.Split(new[] {Environment.NewLine}, StringSplitOptions.None).Skip(1).ToArray();
        }
 /// <summary>
 ///     Gets the SolutionManifest
 /// </summary>
 /// <returns>
 ///     The SolutionManifest file from riot
 /// </returns>
 public string CreateConfigurationManifest(MainRegion Region)
 {
     string latestSlnVersion = Convert.ToString(GetLolClientSlnVersion(Region));
     //Get GameClient Language files
     using (new WebClient())
     {
         SolutionManifest =
             new WebClient().DownloadString(
                 "http://l3cdn.riotgames.com/releases/live/solutions/lol_game_client_sln/releases/" +
                 latestSlnVersion + "/solutionmanifest");
     }
     return SolutionManifest;
 }
        public PatcherSettingsPage(bool newsettings = false)
        {
            InitializeComponent();
            if (newsettings)
                SettingsLabel.Content = "Please configure your settings before using LegendaryClient.Patcher!";

            if (Properties.Settings.Default.UseGithub)
                Version.SelectedItem = Github;
            else
                Version.SelectedItem = Appveyor;

            if (Properties.Settings.Default.OnlyLOL)
                UpdateSettings.SelectedItem = OnlyLoL;
            else
                UpdateSettings.SelectedItem = LegendaryClient;

            LOLP2P.IsChecked = Properties.Settings.Default.LOLP2P;
            LCP2P.IsChecked = Properties.Settings.Default.LCP2P;
            LCPP2P.IsChecked = Properties.Settings.Default.LCPP2P;
            AlwaysUpdate.IsChecked = Properties.Settings.Default.AlwaysUpdate;
            PatcherVolume.Value = Properties.Settings.Default.Volume;            

            var regions = Client.GetInstances<MainRegion>();
            foreach (MainRegion region in regions)
            {
                if (region.RegionType == RegionType.Riot)
                    riot.Add(region);
                else if (region.RegionType == RegionType.PBE)
                    pbe = region;
                else if (region.RegionType == RegionType.KR)
                    kr = region;
                else if (region.RegionType == RegionType.Garena)
                    garena.Add(region);
            }

            Region.Items.Add("Riot");
            Region.Items.Add("PBE");
            Region.Items.Add("Korea");
            Region.Items.Add("Garena");
            Region.SelectedIndex = -1;
            if (!string.IsNullOrEmpty(Properties.Settings.Default.RegionType))
            {
                Region.SelectedItem = Properties.Settings.Default.RegionType;
                RegionName.Visibility = System.Windows.Visibility.Visible;
                if (Region.SelectedItem.ToString() == "Riot")
                {
                    foreach (MainRegion region in riot)
                    {
                        RegionName.Items.Add(region.RegionName);
                    }
                    if (!string.IsNullOrEmpty(Properties.Settings.Default.RegionName))
                        RegionName.SelectedItem = Properties.Settings.Default.RegionName;
                }
                else if (Region.SelectedItem.ToString() == "PBE")
                {
                    RegionName.Items.Add("PBE");
                    RegionName.SelectedItem = "PBE";
                    RegionName.IsEnabled = false;
                }
                else if (Region.SelectedItem.ToString() == "Korea")
                {
                    RegionName.Items.Add("KR");
                    RegionName.SelectedItem = "KR";
                    RegionName.IsEnabled = false;
                }
                else if (Region.SelectedItem.ToString() == "Garena")
                {
                    foreach (MainRegion region in garena)
                    {
                        RegionName.Items.Add(region.RegionName);
                    }
                    if (!string.IsNullOrEmpty(Properties.Settings.Default.RegionName))
                        RegionName.SelectedItem = Properties.Settings.Default.RegionName;
                }
                else
                {
                    RegionName.SelectedIndex = -1;
                    RegionName.Visibility = System.Windows.Visibility.Hidden;
                }
            }
        }