//private LEWrapper le; static void Main(string[] args) { /* string userInput; * do * { * Console.Write("Enter EmpireName:"); * userInput = Console.ReadLine(); * if (string.IsNullOrEmpty(userInput)) * { Console.WriteLine("Thanks"); } * else * { * Console.WriteLine("Input [" + userInput + "]"); * // other code to process user input * } * } while (!string.IsNullOrEmpty(userInput)); * * Console.ReadKey(); */ string UserName = "******"; string Password = "******"; string Server = "us1"; LEWrapper le = new LEWrapper("Jazz", "M", "us1"); PrintPlanetList p = new PrintPlanetList(); p.Subscribe(le); le.EmpireLogin(); //Dictionary<string, string> planetList = p.SortPlanetList(); Dictionary <string, string> planetList = p.planetList; foreach (KeyValuePair <string, string> pair in planetList) { le.BodyGetBuildings(pair.Key.ToString()); } //planetList = //le.CloseLog(); Console.ReadKey(); //le.CloseLog(); }
private void loginButton_Click(object sender, EventArgs e) { labelStatusText.Text = "logging in"; LoginMenuHide(); HideBetaWarningLabel(); le = new LEWrapper(userNameBox.Text, passwordBox.Text, url); le.EmpireLogin(); le.ServerResponseEvent += (rresponseSender, responseE) => { Response r; r = responseE as Response; if (r.id == 101) { homePlanetID = r.result.status.empire.home_planet_id; planets = r.result.status.empire.planets; planets = planets.OrderBy(x => x.Value).ToDictionary(x => x.Key, x => x.Value); //alphabetizes planets according to value labelStatusText.Text = "Please wait a few moments. Drawing Planet Map"; //Task d = new Task(); //await DrawPlanetMap(); //var thread = new Thread(()=>DrawPlanetMap()); //thread.Start(); //thread.Join(); DrawPlanetMap(); ShowButtonsOnForm(); RearrangeControlsShow(); //DrawPlanetMap(); ShowPlanetSelectMenu(); cbPlanetsList.ValueMember = "Key"; cbPlanetsList.DisplayMember = "Value"; cbPlanetsList.DataSource = new BindingSource(planets, null); cbPlanetsList.SelectedValue = homePlanetID; } }; }