public static ClanImport GetClanInfo(long ClanID) { try { Setup(); } catch (Exception) { } string path = $"clans/info/?application_id={APP_ID}&clan_id={ClanID}&extra=members"; var response = Client.GetAsync(path).Result; if (response.IsSuccessStatusCode) { var responseContent = response.Content; string responseString = responseContent.ReadAsStringAsync().Result; ClanImport Import = JsonConvert.DeserializeObject <ClanImport>(responseString); return(Import); } return(null); }
private void Clan_Load(object sender, EventArgs e) { string cc = Properties.Settings.Default.Locale; this.Text = ClanID + ": "; ClanImport Import = WGAPI.GetClanInfo(ClanID); if (Import.Status.Equals("ok")) { ClanData Claninfo = Import.Data[ClanID.ToString()]; this.Text = ClanID + ": [" + Claninfo.Tag + "] - " + Claninfo.Name; lblCreated.Text = Commons.ConvertDateToLocalFormat(Commons.ConvertToDate(Claninfo.Created), cc); lblCreatedBy.Text = Claninfo.CreatedBy; lblLeader.Text = Claninfo.Leader; lblMemberCount.Text = Claninfo.Count + " members."; rtDescription.Text = Claninfo.Description; AddHeaders(); AddRows(Claninfo.Members); } }