public void getCountryElectionInfoCallback(GetCountryElectionInfo_ReturnType returnData) { if (returnData.Success) { StoredCountryInfo info = (StoredCountryInfo)this.countryList[returnData.countryID]; if (info == null) { info = new StoredCountryInfo(); this.countryList[returnData.countryID] = info; } info.m_lastUpdateTime = DateTime.Now; info.lastReturnData = returnData; if (this.currentCountry == returnData.countryID) { this.votingAllowed = returnData.votingAllowed; if (this.countryMembers == null) { this.countryMembers = new List <ParishMember>(); } else { this.countryMembers.Clear(); } if (returnData.countryMembers == null) { this.votesAvailableLabel.Text = SK.Text("CountryPanel_All_Provinces_Needed", "All Provinces need to be active before an election is held"); this.votesAvailableLabel.Position = new Point(0x1f, 12); this.votesAvailableLabel.Size = new Size(400, 100); this.votesAvailableLabel.Font = FontManager.GetFont("Arial", 14f, FontStyle.Regular); this.votesAvailableLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT; this.votesAvailableLabelValue.Visible = false; this.wallInfoImage.invalidate(); } else { this.countryMembers.AddRange(returnData.countryMembers); int numSpareVotes = 0; foreach (ParishMember member in this.countryMembers) { if (member.userID == RemoteServices.Instance.UserID) { numSpareVotes = member.numSpareVotes; break; } } this.votesAvailableLabelValue.Text = numSpareVotes.ToString(); } this.m_userIDOnCurrent = -1; this.electedLeaderID = returnData.leaderID; this.electedLeaderName = returnData.leaderName; this.lastProclamationTime = returnData.lastProclamation; this.currentLeaderID = returnData.leaderID; this.currentLeaderName = returnData.leaderName; this.voteCapLabelValue.Text = returnData.voteCap.ToString(); this.voteCap = returnData.voteCap; this.addPlayers(); } } }
public void OurRemoteAsyncCallBack_GetCountryElectionInfo(IAsyncResult ar) { RemoteAsyncDelegate_GetCountryElectionInfo asyncDelegate = (RemoteAsyncDelegate_GetCountryElectionInfo) ((AsyncResult) ar).AsyncDelegate; try { this.storeRPCresult(ar, asyncDelegate.EndInvoke(ar)); } catch (Exception exception) { GetCountryElectionInfo_ReturnType returnData = new GetCountryElectionInfo_ReturnType(); this.manageRemoteExpection(ar, returnData, exception); } }