Exemplo n.º 1
0
 public void OurRemoteAsyncCallBack_GetOtherUserVillageIDList(IAsyncResult ar)
 {
     RemoteAsyncDelegate_GetOtherUserVillageIDList asyncDelegate = (RemoteAsyncDelegate_GetOtherUserVillageIDList) ((AsyncResult) ar).AsyncDelegate;
     try
     {
         this.storeRPCresult(ar, asyncDelegate.EndInvoke(ar));
     }
     catch (Exception exception)
     {
         GetOtherUserVillageIDList_ReturnType returnData = new GetOtherUserVillageIDList_ReturnType();
         this.manageRemoteExpection(ar, returnData, exception);
     }
 }
 public void villageUserInfoCallback(GetOtherUserVillageIDList_ReturnType returnData)
 {
     if (returnData.Success)
     {
         List<CustomSelfDrawPanel.CSDListItem> items = new List<CustomSelfDrawPanel.CSDListItem>();
         this.villageSearchList.populate(items);
         List<WorldMap.VillageData> list2 = new List<WorldMap.VillageData>();
         List<WorldMap.VillageData> list3 = new List<WorldMap.VillageData>();
         List<WorldMap.VillageData> list4 = new List<WorldMap.VillageData>();
         List<WorldMap.VillageData> list5 = new List<WorldMap.VillageData>();
         List<WorldMap.VillageData> list6 = new List<WorldMap.VillageData>();
         foreach (int num in returnData.userVillageList)
         {
             WorldMap.VillageData item = GameEngine.Instance.World.getVillageData(num);
             if (item != null)
             {
                 if (item.regionCapital)
                 {
                     list3.Add(item);
                 }
                 else if (item.countyCapital)
                 {
                     list4.Add(item);
                 }
                 else if (item.provinceCapital)
                 {
                     list5.Add(item);
                 }
                 else if (item.countryCapital)
                 {
                     list6.Add(item);
                 }
                 else
                 {
                     list2.Add(item);
                 }
             }
         }
         this.villageLines.Clear();
         this.villageScrollArea.clearControls();
         this.villageSearchArea.invalidate();
         int y = 0;
         int position = 0;
         foreach (WorldMap.VillageData data2 in list2)
         {
             VillageLine control = new VillageLine();
             if (y != 0)
             {
                 y += 2;
             }
             control.Position = new Point(3, y);
             control.init(position, this.villageScrollArea.Width - 2, data2, 1, this);
             this.villageScrollArea.addControl(control);
             y += control.Height;
             this.villageLines.Add(control);
             position++;
         }
         foreach (WorldMap.VillageData data3 in list3)
         {
             VillageLine line2 = new VillageLine();
             if (y != 0)
             {
                 y += 2;
             }
             line2.Position = new Point(3, y);
             line2.init(position, this.villageScrollArea.Width, data3, 2, this);
             this.villageScrollArea.addControl(line2);
             y += line2.Height;
             this.villageLines.Add(line2);
             position++;
         }
         foreach (WorldMap.VillageData data4 in list4)
         {
             VillageLine line3 = new VillageLine();
             if (y != 0)
             {
                 y += 2;
             }
             line3.Position = new Point(3, y);
             line3.init(position, this.villageScrollArea.Width, data4, 3, this);
             this.villageScrollArea.addControl(line3);
             y += line3.Height;
             this.villageLines.Add(line3);
             position++;
         }
         foreach (WorldMap.VillageData data5 in list5)
         {
             VillageLine line4 = new VillageLine();
             if (y != 0)
             {
                 y += 2;
             }
             line4.Position = new Point(3, y);
             line4.init(position, this.villageScrollArea.Width, data5, 4, this);
             this.villageScrollArea.addControl(line4);
             y += line4.Height;
             this.villageLines.Add(line4);
             position++;
         }
         foreach (WorldMap.VillageData data6 in list6)
         {
             VillageLine line5 = new VillageLine();
             if (y != 0)
             {
                 y += 2;
             }
             line5.Position = new Point(3, y);
             line5.init(position, this.villageScrollArea.Width, data6, 5, this);
             this.villageScrollArea.addControl(line5);
             y += line5.Height;
             this.villageLines.Add(line5);
             position++;
         }
         this.villageAddButton.Enabled = false;
         this.villageScrollArea.Size = new Size(this.villageScrollArea.Width, y);
         if (y < this.villageBar.Height)
         {
             this.villageBar.Visible = false;
         }
         else
         {
             this.villageBar.Visible = true;
             this.villageBar.NumVisibleLines = this.villageBar.Height;
             this.villageBar.Max = y - this.villageBar.Height;
         }
         this.villageScrollArea.invalidate();
         this.villageBar.invalidate();
         this.changeTabIcons(1);
     }
 }