private void RegionList_SelectedIndexChanged(object sender, EventArgs e) { Settings.Region = RegionList.SelectedItem.ToString(); var cert = Certificates.FirstOrDefault(kv => kv.Key == Settings.Region).Value; if (cert == null) { cert = Certificates.First().Value; } Connection.ChangeRemote(cert.Domain, cert.Certificate); }
private void RegionList_SelectedIndexChanged(object sender, EventArgs e) { LeagueRegion region; if (!LeagueRegion.TryParse(RegionList.SelectedItem.ToString(), out region)) { StaticLogger.Warning("Unknown enum " + RegionList.SelectedItem); return; } Settings.Region = region; var cert = Certificates.FirstOrDefault(kv => kv.Key == Settings.Region).Value; if (cert == null) { cert = Certificates.First().Value; } Connection.ChangeRemote(cert.Domain, cert.Certificate); }