GetMapNames() public method

获取指定服务中的所有的地图名称。
public GetMapNames ( ) : List
return List
 private void btnCheck_Click(object sender, EventArgs e)
 {
     try
     {
         Map map = new Map(this.tbUrl.Text);
         List<string> mapNames = map.GetMapNames();
         if (mapNames != null && mapNames.Count > 0)
         {
             this.cbnMapNames.Items.Clear();
             foreach(string mapName in mapNames)
             {
                 this.cbnMapNames.Items.Add(mapName);
             }
             this.cbnMapNames.SelectedIndex = 0;
             this.btnOk.Enabled = true;
         }
     }
     catch (ArgumentNullException argumengNullException)
     {
         MessageBox.Show(argumengNullException.Message);
     }
     catch (ServiceException serviceException)
     {
         MessageBox.Show(serviceException.Message);
     }
 }
Esempio n. 2
0
        public void GetMapNamesTest_Normal()
        {
            Map map = new Map("http://" + ip + ":8090/iserver/services/map-world/rest");
            List<string> mapNames = map.GetMapNames();

            Assert.IsTrue(mapNames.Count == 5);
            Assert.IsTrue(mapNames[0] == "World");
            Assert.IsTrue(mapNames[1] == "世界地图_Day");
        }